- 將代碼放到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讓服務器編譯
參考: