- 将代码放到launchpad,生成PPA
- 如果生成recipe能方便之后参考
- 安装bzr-builder和pbuilder
- 生成项目名.recipe
# bzr-builder format 0.3 deb-version {debupstream}+{revno}+{revno:packaging}或{debupstream}-0-{revno}
lp:项目名
merge 编译用分支名 lp:~用户名/项目名/分支名 -
bzr dailydeb --allow-fallback-to-native 项目名.recipe 编译用目录(一临时目录即可)
- 生成~/.pbuilderrc
COMPONENTS="main universe multiverse restricted"
- sudo pbuilder create 使用前注意下个步骤
- 如果有其它依赖,可参考使用参数 --othermirror,如--othermirror "deb http://ppa.launchpad.net/bon-ami/ezcommon/ubuntu precise main|deb-src http://ppa.launchpad.net/bon-ami/ezcommon/ubuntu precise main|deb https://launchpad.net/~dolik-rce/+archive/upp/ precise main"
或用sudo pbuilder --login --save-after-login
修改已经生成的pbuilder(),如果没有--save-after-login则退出时都不会保存 -
sudo pbuilder build 编译用目录/项目名_版本号.dsc
以下内容是探索过程,链接比较有用。
bzr 提交到新分支:bzr push lp:~用户名/项目名/分支名
- Download the upstream source
- Rename to 源包名_上游版本号.orig.tar.gz
- untar it
- Rename the directory to 源包名-上游版本号
- under that directory
- dh_mak(见下面的bzr dh-make)之后debian目录会生成很多文件
- 修改debian/changelog用dch -i
- 修改debian/control
- debian/rules会调用debhelper(dh_*)
- 包不在Debian目录:mk-build-deps -ir
- debuild或dpkg-buildpackage -us -uc(见下面的bzr builddeb -- -us -uc)
- ……pbuilder or schroot and sbuild……
sudo apt-get install dh-make bzr-builddeb cd hello make dist 如果已经有了debian目录,可能直接到步骤9
-
bzr dh-make hello 2.7 hello-2.7.tar.gz 这步会生成debian目录,如果之前已经有了,则会重命名,在服务器上形成新的代码提交
-
cd hello/debian
-
rm *ex *EX
- rm README.sourceREADME.Debian
- vi changelog control copyright
- vi hello-dev.install
- cd ..
-
bzr commit -m "Initial commit of Debian packaging."
-
bzr builddeb -- -us -uc
or, use "debuild" to see what goes wrong when building results will be in debian/tmp. - cd ..
- lesspipe hello_2.7-0ubuntu1_amd64.deb
-
sudo dpkg --install hello_2.7-0ubuntu1_amd64.deb
-
lintian hello_2.7-0ubuntu1.dsc
-
lintian hello_2.7-0ubuntu1_amd64.deb
- cd hello
-
bzr builddeb -S
-
cd ../build-area
-
pbuilder-dist precise build hello_2.7-0ubuntu1.dsc
提交后,
dput ppa:<lp-username> hello_2.7-0ubuntu1.changes
将bzr提交与缺陷关联:在缺陷号处填 lp:号码
提交代码后,在launchpad上生成recipe让服务器编译
参考: