Package maintainance using CDBS and git-buildpackage
Contents
Building the package
No special handling is required for normal package builds.
In particular, you can completely ignore the file debian/control.in file and simply use debian/control directly, if you are not interested in CDBS.
Upgrading to new upstream source
Official releases are tagged and signed and binary diffs of tarballs are stored using pristine-tar. This is documented below /usr/share/doc/git-buildpackage/manual-html/.
A custom build target shows current upstream and packaging versions:
debian/rules print-version
Current upstream source is fetched (and repackaged as needed) using this other build target:
debian/rules get-orig-source
To fetch newer upstream source, override DEB_UPSTREAM_TARBALL_VERSION and suppress DEB_UPSTREAM_TARBALL_MD5 like this:
debian/rules get-orig-source DEB_UPSTREAM_TARBALL_MD5= DEB_UPSTREAM_TARBALL_VERSION=${new_upstream_version}-1Store new md5sum to help ensure identical source is received later.
Other upgrade methods using the watch file may work too but is currently discouraged, especially when repackaging to strip non-DFSG files is needed.
Copyright check
When copyright check is enabled and the source package is detected to contain new files or changed copyright or licensing statements, the following is emitted during normal builds:
WARNING: The following (and possibly more) new or changed notices discovered: ... To fix the situation please do the following: 1) Fully compare debian/copyright_hints with debian/copyright_newhints 2) Update debian/copyright as needed 3) Replace debian/copyright_hints with debian/copyright_newhints
To treat such warnings as errors and avoid removing debian/copyright_newhints in clean target when different, set DEB_MAINTAINER_MODE=1 during build.
Maintaining packaging build routines
This source package wraps debhelper commands and other tedious parts of the build routines using the CDBS framework. Please refer to the actual makefile snippets included from debian/rules for details on their purpose and ways to override defaults.
Setting DEB_MAINTAINER_MODE=1 enables additional build routines helpful during development of the package, but unfit for normal builds. This typically includes the CDBS feature of auto-updating debian/control with CDBS-related build-dependencies, which is forbidden by Debian Policy as build environment must not change during automated builds.
Use git for your package at collab-maint area of Alioth
Create new git locally from pristine tarball:
mkdir mypkg
cd mypkg
git init
cd ..
mkdir tarballs
cd tarballs
wget http://example.org/source/my_pkg-1.2r3.tgz
mv my_pkg.tgz mypkg_1.2.3.orig.tar.gz
cd ../mypkg
git-import-orig --pristine-tar --sign-tags ../tarballs/mypkg_1.2.3.orig.tar.gzCreate debian packaging
mkdir debian
nano debian/rules
nano debian/control
nano debian/gbp.conf
...
git add debian
git commitPublish git at collab-maint area of Alioth
git remote add origin git.debian.org:/git/collab-maint/mypkg
git config branch.master.remote origin
git config branch.master.merge refs/heads/master
ssh git.debian.org "cd /git/collab-maint && ./setup-repository mypkg 'mypkg Debian packaging'"
git push --all; git push --tags
If you already have some Debian packaging then it is even easier
Bootstrap local git
git-import-dsc --pristine-tar --sign-tags mypkg_1.2.3.dsc
Or more elegantly you can bootstrap with as much history from past packaging as is possible:
Bootstrap local git
iceweasel http://packages.qa.debian.org/m/mypkg.html
(copy URLs from icons at right of "versions" in left side)
dget -d http://ftp.debian.org/debian/pool/main/m/mypkg/mypkg_1.2.2-6.dsc
...
debsnap -d . mypkg
...
git-import-dscs --pristine-tar --sign-tags mypkg*You might still want to apply my cdbs-skel files. Use same commands and follow the git instructions to resolve any conflicts that might occur (if e.g. the packaging already contained a README.source).
