deb包的制作方法有:
1. 使用checkinstall方法创建deb包:
checkinstall不仅可以生成deb包,还可以生成rpm包,使用简单,但是不灵活,功能粗糙,只做介绍,不推荐使用。
$ tar xvjf pcre-8.32.tar.bz2 // 解包 $ cd pcre-8.32 $ ./configure & make // 编译 $ checkinstall // 制作deb包 (后面的一些参数可以自己根据需要添加,这里不作介绍)
此时当前目录下生成了deb包
2. 使用dpkg方法创建deb包:
dpkg是最基本的制作deb包的方法,推荐使用。
a)首先要安装制作deb包所必需的软件包:
sudo apt-get install build-essential autoconf automake autotools-dev dh-make debhelper devscripts fakeroot xutils lintian pbuilder
$ tar xvjf pcre-8.32.tar.bz2 // 解包 $ cd pcre-8.32
dh_make -s -c gpl -n -e [email protected]
Source: pcre Section: devel Priority: optional Maintainer: Joe <[email protected]> Build-Depends: debhelper (>= 7), autotools-dev Standards-Version: 3.7.3 Homepage: http://sourceforge.net/projects/pcre/files/pcre/ Package: pcre Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5. The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5. PCRE has its own native API, as well as a set of wrapper functions that correspond to the POSIX regular expression API. The PCRE library is free, even for building proprietary software.
比如需要使pcre支持jit功能,那就要在rules中的编译选项中添加 --enable-jit 。
./configure $(CROSS) --prefix=/usr --enable-jit --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,def
f)使用$ dpkg-buildpackage -rfakeroot命令生成deb包:
$ dpkg-buildpackage -rfakeroot
有些可能还包含以下内容:
Version:显然是程序的版本。确保这里的值不包括连字符。
Eseential:指该软件包是否是必须的(大部分的时候不是)。
Recommends:指除了极特殊情况下的安装之外,大多数时候都需要的依赖关系。
Suggests:意味可能给这个软件带来更多功能的,但是没有完全没有问题的依赖关系<译者注:同Recommands>。
你可以用英文的半角逗号分开不同的依赖关系(,)。如果两个软件中的任何一个可以工作,用竖线"|"分开它们。你也可以指定特定的版本,用在括号里用<<(小于),<=(小于或等于),=(等于),>=(大于或等于),或>>(大于)来表示。Install-Size是程序安装后的大小,按KB算。
Conflicts:表示跟这个程序冲突的软件。
Replaces:表明哪些软件包将被这个程序取代。
注:记住在control文件的最后一行留一空行,否则deb包无法运行。
参考:
http://os.51cto.com/art/201001/176881.htm
http://happycasts.net/episodes/14?autoplay=true
http://blog.longwin.com.tw/2009/03/debian-linux-package-build-deb-2009/
http://www.webupd8.org/2010/01/how-to-create-deb-package-ubuntu-debian.html
http://blog.chinaunix.net/uid-26488891-id-3204832.html
https://www.deleak.com/blog/2010/11/21/make-deb-pkg/
http://users.telenet.be/mydotcom/howto/linux/package.htm
http://www.debian.org/doc/manuals/maint-guide/dreq.zh-tw.html