编译gnuplot的Deb包 @log

因为要用到Gnuplot画图,就去官网上找教程,没想到新的4.6版早就发布了,加上现在用的这个版本(4.2)当初在编译的时候没加Latex的样式目录和readline支持,尤其是后者的缺失搞得我现在苦不堪言,于是就试下这个新版的。

编译安装很容易,用到的参数只要有 –with-readline=gnu –with-texdir和–prefix=/usr/。今天要记的是如何将其打包成Deb,方便以后安装,之所以要打包是因为现在Lenny上软件包基本上已经停止更新了,要想用新版本的工具差不多都得自己动手。

我以前也试过自己打包Deb,但用的是checkinstall,感觉不是很稳定,今天要用的是原生的dpkg,步骤如下:

  • 先进行编译和安装,配置安装的目录在当前工作目录下的usr文件夹,make && make install后会看到当前文件夹下的usr里即是全部要安装的文件了。
  • 在当前目录下创建一个DEBIAN文件夹,这个文件夹是用来放置控制打包的相关配置文件的,有两个分别是control和md5sums,后者可有可无,为了保险起见我还是做了个。
    control中的内容如下:  Package: gnuplot Version: 4.6.0 Architecture: i386 Maintainer: Sheng Pengfei Original-Maintainer: Thomas Williams, Colin Kelley, Russell Lang, Dave Kotz, John Campbell, Gershon Elber, Alexander Woo and many others. Installed-Size: 6640K Depends: Section: utils Priority: optional Description: Gnuplot is a portable command-line driven graphing utility The source code is copyrighted but freely distributed (i.e., you don't have to pay for it). It was originally created to allow scientists and students to visualize mathematical functions and data interactively, but has grown to support many non-interactive uses such as web scripting. It is also used as a plotting engine by third-party applications like Octave. Gnuplot has been supported and under active development since 1986. . Homepage: http://www.gnuplot.info  很容量理解的对吧,要注意的是Description后跟的是描述,下面的详细描述前需要有个空格,结束后还有那个点“.”。

    md5sums通过命令自动生成:cd ../ ; find usr -type f -print0 | xargs -0 md5sum > DEBIAN/md5sums

  • 退回到DEBIAN的父目录中,使用dpkg -b ./ gnuplot-4.6.0-Debian-lenny.i386.deb生成Deb包
  • 除了那个Deb包,其它的文件都可以刪掉了,使用dpkg -i debpackge即可安装这个Deb包了,安装后可以用apt-cache search gnuplot看到自己的成果了哈。
Advertisements
此条目发表在未分类分类目录。将固定链接加入收藏夹。

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s