0. 原因
尽管你是在 Ubuntu 下工作,但由于种种原因[1],你还是需要给 Debian 做打包工作,如果你不想你做的包因为一些简单的错误被退回,比如无法在 Debian 下编译,没有处理好 lintian 警告,那么最好在 Ubuntu 下给 Debian 打包的环境,步骤如下所示:
1. 安装 approx
打包时经常需要反复下载一些包, 如果你的网速不够快,建议安装 approx 透明代理, 可以缓存大部分包。安装方法: "sudo apt-get install approx", 然后修改配置文件 /etc/approx/approx.conf 为
ubuntu http://cn.archive.ubuntu.com/ubuntu
debian http://mirrors.163.com/debian
2. 修改 /etc/apt/sources.list, 修改为如下的内容
deb http://127.0.0.1:9999/ubuntu lucid main restricted universe multiverse
deb http://127.0.0.1:9999/ubuntu lucid-security main restricted universe multiverse
deb http://127.0.0.1:9999/ubuntu lucid-updates main restricted universe multiverse
3. 安装工具包, 运行 "sudo apt-get install ubuntu-dev-tools cowbuilder"
4. 准备 cowbuilder-sid
$ sudo cp /usr/bin/pbuilder-dist /usr/bin/cowbuilder-sid
$ sudo sed -ie 's,ftp://ftp.debian.org/debian,http://127.0.0.1:9999/debian,' /usr/bin/cowbuilder-sid
5. 准备开发环境
$ sudo mkdir /var/cache/pbuilder-dist/sid_result
$ cowbuilder-sid create
6. 开始开发
$ dget http://ftp.debian.org/debian/pool/main/h/hello/hello_2.6-1.dsc
$ dpkg-source -x hello_2.6-1.dsc
$ cd hello-2.6
$ # 修改 debian 包,版本改为 2.6-2
$ debuild -S -sa
$ cd ..
$ cowbuilder-sid hello_2.6-2.dsc # 使用 sid 环境进行编译
7. 检查
7.1 安装最新版的 lintian
Ubuntu 自带的 lintian 版本不够新,需要从 Debian 安装最新版本
$ # 到 http://ftp.us.debian.org/debian/pool/main/l/lintian/ 下载最新版本的 lintian
$ wget http://ftp.us.debian.org/debian/pool/main/l/lintian/lintian_2.4.3_all.deb
$ sudo dpkg -i lintian_2.4.3_all.deb
$ sudo apt-get -f install
7.2 对包做最后的检查
$ cd /var/cache/pbuilder-dist/sid_result
$ lintian -i hello_2.6-2_amd64.changes
$ #如果上一步出现错误,则继续修正
$ debsign hello_2.6-2_amd64.changes #签名
8. 上传
根据 http://mentors.debian.net/cgi-bin/maintainer-intro 的介绍准备好 mentors.debian.net 的上传的环境, 然后用如下的命令上传
$ dput mentors hello_2.6-2_amd64.changes
9. 召唤 Debian Developer (DD)
到 mentors.debian.net, 登录后可以找到一份模板邮件, 把模板邮件中的内容填好,然后发到 debian-mentors@lists.debian.org
如果你有相熟的 DD, 也可以直接发信给他让他帮忙检查。
Hello, I am LI Daobing(first name is family name). You can talk with me in English or Chinese.
Showing posts with label packaging. Show all posts
Showing posts with label packaging. Show all posts
2010-10-02
2009-05-01
debian/control: switch between debian and ubuntu format
#!/usr/bin/env python
import logging
import sys
log = logging.getLogger(__name__)
def main():
lines = file('debian/control').readlines()
l1 = None
l2 = None
for idx, x in enumerate(lines):
if x.startswith('Maintainer:'):
l1 = idx
elif x.startswith('XSBC-Original-Maintainer:'):
l2 = idx
if l1 is None:
log.error("can't find maintainer line")
sys.exit(1)
isUbuntu = l2 is not None
if isUbuntu:
maintainer = lines[l2].lstrip('XSBC-Original-Maintainer:').strip()
else:
maintainer = lines[l1].lstrip('Maintainer:').strip()
if isUbuntu:
lines[l1] = 'Maintainer: %s\n' % maintainer
del lines[l2]
else:
lines[l1] = 'Maintainer: Ubuntu MOTU Developers <ubuntu-motu@lists.ubuntu.com>\n' \
+ 'XSBC-Original-Maintainer: %s\n' % maintainer
file('debian/control', 'w').writelines(lines)
if __name__ == '__main__':
main()
Subscribe to:
Posts (Atom)