---
# System prepended metadata

title: Debian packaging workshop (6)
tags: [' tossug', hackpad-import]

---

---
hackpadID: DWXo6WnLeOf
hackpadWorkspace: tossug
tags: hackpad-import, tossug
---
# Debian packaging workshop (6)

上週筆記：[Debian packaging workshop 5](/FsvIrUHC7iR)

下週筆記：[Debian packaging workshop 7](/LqufwsVhqbE)

日期：2015/05/12

網路聊天室：[](http://webchat.freenode.net/?channels=tossug)[http://webchat.freenode.net/?channels=tossug](http://webchat.freenode.net/?channels=tossug)

YouTube 直播及錄影：[](http://youtu.be/iniSJoLg-HU)http://youtu.be/iniSJoLg-HU

## 主題一：git-buildpackage

預備知識：需要知道 git 的基本使用方法以及概念

[](https://wiki.debian.org/PackagingWithGit)https://wiki.debian.org/PackagingWithGit <= 入門

[](http://honk.sigxcpu.org/projects/git-buildpackage/manual-html/gbp.html)http://honk.sigxcpu.org/projects/git-buildpackage/manual-html/gbp.html <= 使用手冊

[](https://enc.com.au/2015/04/28/backporting-and-git-buildpackage/)[https://enc.com.au/2015/04/28/backporting-and-git-buildpackage/](https://enc.com.au/2015/04/28/backporting-and-git-buildpackage/) <= backport 經驗分享

如果 Debian package 不跟上游一起管理 ***這個是預設的行為***

*   master 用來管理 debian/* 的分支
*   upstream 用來放上游釋出版本的分支
*   pristine-tar 用來放上游釋出 tarball 的分支

如果 Debian package 跟上游一起管理

*   master 原始上游軟體在版本控管的分支
*   debian 用來管理 debian/* 的分支
*   upstream 用來放上游釋出版本的分支
*   pristine-tar 用來放上游釋出 tarball 的分支 

如果只給 Debian package 開發的話 (Debian native package)

*   master 用來管理所有檔案的地方，包括 debian/*

安裝軟體套件

*   apt-get install git-buildpackage pristine-tar

$ gbp import-dsc hello_2.8-4.dsc 

gbp:info: No git repository found, creating one.

gbp:info: Tag upstream/2.8 not found, importing Upstream tarball

gbp:info: Version ’2.8-4’ imported under ’hello’

$ gbp import-dsc hello_2.8-4.dsc **--pristine-tar**

gbp:info: No git repository found, creating onie.

gbp:info: Tag upstream/2.8 not found, importing Upstream tarball

pristine-tar: committed hello_2.8.orig.tar.gz.delta to branch pristine-tar

gbp:info: Version ’2.8-4’ imported under ’hello’

$ gbp import-dsc ../hello_2.10-0.1.dsc

gbp:info: Tag upstream/2.10 not found, importing Upstream tarball

gbp:info: Version ’2.10-0.1’ imported under ’hello’

$ gbp import-dsc ../hello_2.10-0.1.dsc **--pristine-tar**

gbp:info: Tag upstream/2.10 not found, importing Upstream tarball

pristine-tar: committed hello_2.10.orig.tar.gz.delta to branch pristine-tar

gbp:info: Version ’2.10-0.1’ imported under ’hello’

$ git-buildpackage -S --lintian-opts --profile debian

$ sbuild -A -d sid-amd64 hello_2.10-0.1.dsc

安裝設定參考：[](http://fourdollars.blogspot.tw/2015/05/ubuntu-1404-sbuild-debian-unstable.html)http://fourdollars.blogspot.tw/2015/05/ubuntu-1404-sbuild-debian-unstable.html

$ git-buildpackage --git-tag --git-sign-tags -S --lintian-opts --profile debian

$ git clone [](git://anonscm.debian.org/pkg-ime/libchewing.git)[git://anonscm.debian.org/pkg-ime/libchewing.git](git://anonscm.debian.org/pkg-ime/libchewing.git)

$ DIST=sid git-pbuilder create

[](https://help.launchpad.net/Code/Git)[https://help.launchpad.net/Code/Git](https://help.launchpad.net/Code/Git)

插曲：Fix a Debian bug.

[](https://www.debian.org/Bugs/server-control)https://www.debian.org/Bugs/server-control

[](https://www.debian.org/Bugs/Developer#closing)https://www.debian.org/Bugs/Developer#closing

## 主題二：metapackage/transitional/dummy package

(延到下次，有沒有誰要認領？)

[](https://wiki.debian.org/metapackage)https://wiki.debian.org/metapackage

[](https://wiki.debian.org/Renaming_a_Package)https://wiki.debian.org/Renaming_a_Package

[](https://wiki.debian.org/PackageTransition)https://wiki.debian.org/PackageTransition

[](http://www.brain-dump.org/blog/entry/40/Creating_dummy_packages_to_fullfill_dependencies_in_Debian)http://www.brain-dump.org/blog/entry/40/Creating_dummy_packages_to_fullfill_dependencies_in_Debian

[](https://wiki.debian.org/DebianPureBlends)[https://wiki.debian.org/DebianPureBlends](https://wiki.debian.org/DebianPureBlends)

## 主題三：在本地端建立類似 Ubuntu PPA 的使用環境

(延到下次，有沒有誰要認領？)

[](https://wiki.debian.org/HowToSetupADebianRepository)https://wiki.debian.org/HowToSetupADebianRepository

[](https://scotbofh.wordpress.com/2011/04/26/creating-your-own-signed-apt-repository-and-debian-packages/)https://scotbofh.wordpress.com/2011/04/26/creating-your-own-signed-apt-repository-and-debian-packages/

[](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=714883)https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=714883

看能不能用 Docker 還是 LXC 的技術，自己建立一個類似 Ubuntu PPA 給 Debian oldstable/stable/testing/unstable ？

[](http://mini-buildd.installiert.net/)http://mini-buildd.installiert.net/
