# Debian packaging workshop (5) ###### tags: `Debian packaging workshop` 上週筆記:Debian packaging workshop 4 下週筆記:Debian packaging workshop 6 日期:2015/05/05 網路聊天室:http://webchat.freenode.net/?channels=tossug YouTube直播錄影:http://youtu.be/iE92-bfAWEk 主題:pbuilder 跟 sbuild 以及相關的工具 pbuilder/cowbuilder http://pbuilder.alioth.debian.org/ http://wen00072.github.io/blog/2014/11/20/package-debian-packages-using-local-debian-pbuilder-package/ 安裝所需要的工具 $ sudo apt-get install pbuilder cowbuilder ubuntu-dev-tools pbuilder - personal package builder for Debian packages cowbuilder - pbuilder running on cowdancer cowdancer - Copy-on-write directory tree utility. ubuntu-dev-tools: /usr/bin/pbuilder-dist ubuntu-dev-tools: /usr/bin/cowbuilder-dist 以 Debian unstable 為例 在 ~/bin/ 底下建立 Soft link pbuilder-unstable-amd64 -> /usr/bin/pbuilder-dist $ pbuilder-unstable-amd64 create # 建立基本環境 $ pbuilder-unstable-amd64 update # 更新環境 $ pbuilder-unstable-amd64 build hello_2.10-0.1.dsc # 編譯該套件 pbuilder 1st: 1m38.364s, 2nd: 1m50.065s, 3rd: 1m24.354s cowbuilder 1st: 1m32.800s, 2nd: 1m42.222s, 3rd: 1m7.449s sbuild https://wiki.debian.org/sbuild 安裝所需要的工具 $ sudo apt-get install sbuild ubuntu-dev-tools 以 Debian unstable 為例 $ mk-sbuild --arch amd64 --distro debian unstable # 第一次執行時會把你加入 sbuild 群組 $ newgrp sbuild # 馬上得到 sbuild $ mk-sbuild --arch amd64 --distro debian unstable To CHANGE the golden image: sudo schroot -c source:sid-amd64 -u root To ENTER an image snapshot: schroot -c sid-amd64 To BUILD within a snapshot: sbuild -A -d sid-amd64 PACKAGE*.dsc $ sbuild -A -d sid-amd64 hello_2.10-0.1.dsc E: Local archive GPG signing key not found I: Please generate a key with 'sbuild-update --keygen' $ sbuild-update --keygen # 第一次需要產生一組公私鑰給它用 $ sbuild -A -d sid-amd64 hello_2.10-0.1.dsc sbuild, 1st: 0m59.525s, 2nd: 0m59.437s pdebuild pdebuild - pbuilder way of doing debuild 這個就比較沒有那麼彈性,只能依照 ~/.pbuilderrc 裡面設定或是指令所下的參數來建立環境 Host 為 Ubuntu 14.04 http://askubuntu.com/questions/435450/how-to-get-a-sid-pbuilder-in-ubuntu $ sudo apt-get install debian-archive-keyring $ sudo pbuilder --create --mirror http://free.nchc.org.tw/debian --distribution unstable --architecture amd64 --debootstrapopts --keyring=/usr/share/keyrings/debian-archive-keyring.gpg # 產生 Debian unstable amd64 的環境 $ cd ~/workshop/hello-2.10 # 直接進到 Debian source package 解開後的目錄底下 $ pdebuild Host 為 Debian $ sudo pbuilder --create --mirror http://free.nchc.org.tw/debian --distribution unstable --architecture amd64 如果沒有特別設定的話,Debian binary package 會產生在 /var/cache/pbuilder/result 底下 "Only the root user can perform a chroot. This is intended to prevent users from putting a setuid program inside a specially crafted chroot jail (for example, with a fake /etc/passwd and /etc/shadow file) that would fool it into a privilege escalation." -- Wikipedia "Schroot allows users to execute commands or interactive shells in different chroots (see schroot)." -- Debian wiki 下週主題:git-buildpackage https://enc.com.au/2015/04/28/backporting-and-git-buildpackage/ $ git clone git://anonscm.debian.org/pkg-ime/libchewing.git $ DIST=sid git-pbuilder create https://help.launchpad.net/Code/Git 下週主題二:metapackage/transitional/dummy package, https://wiki.debian.org/DebianPureBlends
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up