Debian 新维护者
官方维护文档网址, 关联包:
- build-essential.
- autoconf, automake, autotools-dev.
- debhelper, dh-make.
- devscripts.
- fakeroot.
- file.
- gfortran.
- git.
- gnupg.
- gpc.
- lintian.
- patch.
- patchutils.
- pbuilder.
- perl.
- python.
- quilt.
- xutils-dev.
执行安装命令:
sudo apt-get install build-essential autoconf automake \
autotools-dev debhelper dh-make devscripts fakeroot file \
gfortran git gnupg gpc lintian patch patchutils pbuilder \
perl python quilt xutils-dev
文档包
- gnu-standards
执行安装命令:
sudo apt-get install -y gnu-standards
Debian 包构建流程
-
获取上游包,通常是一个 .tar.gz 压缩包
- package-version.tar.gz
-
在
debian
文件夹内添加 Debian 特定内容。以 3.0 (quilt) 格式- package_version.orig.tar.gz
- package_version-revision.debian.tar.gz
- package_version-revision.dsc
-
构建 Debian 二进制包
.deb
包格式- package_version-revision_arch.deb
设置 dh_make
```bash
$ cat >>~/.bashrc <<EOF
DEBEMAIL="your.email.address@example.org"
DEBFULLNAME="Firstname Lastname"
export DEBEMAIL DEBFULLNAME
EOF
$ . ~/.bashrc
```
初始化非原生 Debian 包
$ cd ~/gentoo
$ wget http://example.org/gentoo-0.9.12.tar.gz
$ tar -xvzf gentoo-0.9.12.tar.gz
$ cd gentoo-0.9.12
$ dh_make --copyright gpl2 -f ../gentoo-0.9.12.tar.gz
dh_make 命令创建一个 tar 包副本 gentoo_0.9.12.orig.tar.gz,这个包为生成 debian.tar.gz 作准备
$ cd ~/gentoo ; ls -F
gentoo-0.9.12/
gentoo-0.9.12.tar.gz
gentoo_0.9.12.orig.tar.gz
同时还会生成一堆文件在 debian
文件夹内。
control
这份文件中包含了 dpkg, dselect, apt-get, apt-cache, aptitude 等工具需要使用到的包信息。在 Debian Policy Manual, 5 "Control files and their fields" 中定义。
这里是一份 dh_make 为我们创建的 control 文件:
1 Source: gentoo
2 Section: unknown
3 Priority: extra
4 Maintainer: Josip Rodin <joy-mg@debian.org>
5 Build-Depends: debhelper (>=9)
6 Standards-Version: 3.9.4
7 Homepage: <insert the upstream URL, if relevant>
8
9 Package: gentoo
10 Architecture: any
11 Depends: ${shlibs:Depends}, ${misc:Depends}
12 Description: <insert up to 60 chars description>
13 <insert long description, indented with spaces>
我已经在上面添加了行数。第 1 行至第 7 行是源码包的控制信息。第 9 至第 13 行是二进制包的控制信息。
-
Source 第 1 行是源码包名称;
-
Section 第 2 行是源码包的分发部分;
你可能已经注意到,Debian 包分为多个部分:main (自由软件)、non-free (非自由软件)以及 contrib (依赖非自由软件的自由软件)。它们都分为几个类别:
- admin 系统管理员工具;
- devel 开发工具;
- doc 文档;
- libs 库文件;
- mail 邮件阅读器和守护程序;
- net 网络程序和守护程序;
- x11 图形界面程序;
- libdevel 库开发包。
Section
写法如下:- section 如果包属于 main 部分;
- area/section 如果包属于 contrib 或者 non-free 部分。
-
第 3 行定义了用户安装这个包的重要程度;
- optional
- extra
copyright
dh_make 为你提供了一份 copyright 的模板。通过指定 --copyright gpl2 产生一份 GPL2 版本的 copyright 模板。
最后,完成的 gentoo copyright 长得类似如此:
1 Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
2 Name: gentoo
3 Maintainer: Josip Rodin <joy-mg@debian.org>
4 Source: http://sourceforge.net/projects/gentoo/files/
5
6 Copyright: 1998-2010 Emil Brink <emil@obsession.se>
7 License: GPL-2+
8
9 Files: icons/*
10 Copyright: 1998 Johan Hanson <johan@tiq.com>
11 License: GPL-2+
12
13 Files: debian/*
14 Copyright: 1998-2010 Josip Rodin <joy-mg@debian.org>
15 License: GPL-2+
16
17 License: GPL-2+
18 This program is free software; you can redistribute it and/or modify
19 it under the terms of the GNU General Public License as published by
20 the Free Software Foundation; either version 2 of the License, or
21 (at your option) any later version.
22 .
23 This program is distributed in the hope that it will be useful,
24 but WITHOUT ANY WARRANTY; without even the implied warranty of
25 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 GNU General Public License for more details.
27 .
28 You should have received a copy of the GNU General Public License along
29 with this program; if not, write to the Free Software Foundation, Inc.,
30 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
31 .
32 On Debian systems, the full text of the GNU General Public
33 License version 2 can be found in the file
34 `/usr/share/common-licenses/GPL-2'.