dpatch ve pbuilder ile paketleme örneği

$ mkdir -p /path/to # new empty directory
$ cd /path/to
$ tar -xvzf /path/from/gentoo-1.0.2.tar.gz
$ cp -a  gentoo-1.0.2 gentoo-1.0.2-orig
$ cd gentoo-1.0.2
$ dh_make -e name@domain.dom -f /path/from/gentoo-1.0.2.tar.gz
... Answer prompts.

debian/rules dosyasının özgün hali:

configure: configure-stamp
configure-stamp:
dh_testdir
# Add here commands to configure the package.
touch configure-stamp
build: build-stamp
build-stamp: configure-stamp 
dh_testdir
# Add here commands to compile the package.
$(MAKE)
#docbook-to-man debian/gentoo.sgml > gentoo.1
touch $@
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process.
-$(MAKE) clean
dh_clean

debian/rules dosyasının bu bölümünü bir editör yardımıyla aşağıdaki gibi dpatch kullanması için değiştirebilirsiniz ve Build-Depends'e dpatch'i ekleyebilirsiniz: debian/control'ün ilgili satırları:

configure: configure-stamp
configure-stamp: patch
dh_testdir
# Add here commands to configure the package.
touch configure-stamp
build: build-stamp
build-stamp: configure-stamp 
dh_testdir
# Add here commands to compile the package.
$(MAKE)
#docbook-to-man debian/gentoo.sgml > gentoo.1
touch $@
clean: clean-patched unpatch
clean-patched:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process.
-$(MAKE) clean
dh_clean 
patch: patch-stamp
patch-stamp:
dpatch apply-all
dpatch call-all -a=pkg-info >patch-stamp
unpatch:
dpatch deapply-all
rm -rf patch-stamp debian/patched

Şimdi dpatch-edit-patch yardımıyla ve dpatch sistemiyle kaynak ağacını yeniden paketlemeye hazırız.

$ dpatch-edit-patch patch 10_firstpatch
... Fix source tree by editor
$ exit 0
... Try building packages with "debuild -us -uc"
... Clean source with "debuild clean"
... Repeat dpatch-edit-patch until making source buildable.
$ sudo pbuilder update
$ pdebuild
$ cd /var/cache/pbuilder/result/
$ dupload -t nm_target gentoo_1.0.2-1_i386.changes