Back to releasing

Debian packaging

Prepare your packaging environment

Build for sid

Import origin tarball

With uscan

If tarball is published, use uscan:

$ git checkout debian/2.5
# Workaround for bugs in gbp/uscan ($USCAN_DESTDIR not considered and no way to pass uscan options to the gpb import-orig --uscan the command line):
$ uscan --no-conf -ddd --destdir=../tarballs/
$ gbp import-orig $(ls ../tarballs/oar_*.orig.tar.gz | tail -n1)


$ git checkout debian/2.5
$ gbp import-orig ../tarballs/oar-2.5.3.tar.gz
# or if the tarball is already uploaded: git-import-orig --uscan
What is the upstream version? [2.5.3] 
gbp:info: Importing '../tarballs/oar-2.5.3.tar.gz' to branch 'debian-upstream/2.5'...
gbp:info: Source package is oar
gbp:info: Upstream version is 2.5.3
pristine-tar: committed to branch pristine-tar
gbp:info: Merging to 'debian/2.5'
gbp:info: Successfully imported version 2.5.3 of ../tarballs/oar-2.5.3.tar.gz

WARNING: in case of a RC version, use git-import-orig with -u “version with ~ instead of +”

$ git checkout debian/2.5
$ gbp import-orig ../tarballs/oar-2.5.4+rc2.tar.gz -u 2.5.4~rc2

Update the debian changelog

After finishing any required modifications to the debian/* files, update the debian/changelog file using dch:

$ dch -i

Then release:

$ dch -r

Beware: you need to take care of the distribution and the version. The distribution is generally 'unstable' (the package will be uploaded to the unstable distribution). The version must be something like <source_version>-<debian_revision>

Then commit :

$ debcommit -a

Build the source package

We first only build the source package, the binary packages will be built later in a dedicated environment (sbuild).

$ gbp buildpackage -S

If everything goes well, tag:

$ gbp buildpackage -S --git-tag-only

or all at once:

$ gbp buildpackage -S --git-tag

Sync the files with the oar-ftp machine

$ cd ..
$ export OAR_DIR=$PWD OAR_FTP=oar-ftp.lig
$ rsync -avz --delete build-area tarballs $OAR_FTP:$OAR_DIR

Build the binary packages

The sbuild-debian environments must be installed on oar-ftp.

$ export OAR_VERSION=$(head -n1 oar/debian/changelog |sed -e 's/^.\+(\(.\+\)).\+$/\1/') && echo $OAR_VERSION
$ export OAR_CHROOT=$(head -n1 oar/debian/changelog |sed -e 's/^.\+)\s\+\([^\;]\+\);.\+$/\1/') && echo $OAR_CHROOT
# oar-ftp sshd accepts env variables OAR_*
$ ssh $OAR_FTP -o SendEnv=OAR_VERSION -o SendEnv=OAR_DIR -o SendEnv=OAR_CHROOT
oar-ftp$ sudo sbuild-update source:$OAR_CHROOT && sudo sbuild-update --upgrade source:$OAR_CHROOT
oar-ftp$ cd $OAR_DIR/build-area
oar-ftp$ sbuild -As -d $OAR_CHROOT --arch amd64 --debbuildopts "-uc -us" oar_$OAR_VERSION.dsc
# if multi-arch: sbuild -d $OAR_CHROOT --arch $OTHER_ARCH --debbuildopts "-uc -us" oar_$OAR_VERSION.dsc
oar-ftp$ logout

Sync the files back from the oar-ftp machine

$ rsync -avz $OAR_FTP:$OAR_DIR/{build-area,tarballs} .

Verify and sign the generated packages

If multiarch, merge the changes files and run lintian. If everything goes well, sign the changes

# if multi-arch: mergechanges -f oar_${OAR_VERSION}_*.changes; then replace amd64 by multi, below.
# update lintian
$ sudo apt-get update && sudo apt-get install -t sid lintian
$ cd build-area
$ lintian --pedantic -I -i oar_${OAR_VERSION}_amd64.changes
$ debsign oar_${OAR_VERSION}_amd64.changes

Push to remote

If happy so far, push everything:

$ cd ../oar
$ REMOTE=github # or REMOTE=origin
$ git push $REMOTE debian/2.5 && \
  git push $REMOTE debian-upstream/2.5 && \
  git push $REMOTE pristine-tar && \
  git push $REMOTE --tags

Push to oar-ftp

$ cd ../build-area && dput oar_${OAR_VERSION}_amd64.changes

Packages will go to the sid_alpha distribution if in the UNRELEASED state, or to sid_beta distribution if in the unstable state (see dch)

Build for backports distributions

Beforehand, configure dpkg-mergechangelogs to ease the debian changelog file merge. See the manual of dpkg-mergechangelogs which explains the setup.

Checkout the bpo branch for the target distribution:

  • for stretch: debian/2.5_bpo9 → deb version suffix: ~bpo9+N
  • for jessie: debian/2.5_bpo8 → deb version suffix: ~bpo8+N
  • for wheezy: debian/2.5_bpo70 → deb version suffix: ~bpo70+N

In the following, we take as example a build for jessie backports.

$ git checkout debian/2.5_bpo8

Merge the commit tag for the packaging of the debian/2.5 branch:

$ git merge debian/2.5.5-1

Fix the conflicts:

  • fix any issues due to differences between sid and the older backports distribution
  • move the changelog: put everything chronologically ! (no remove, just re-order)
  • or use the mergechanges tool

Commit to finilize the merge

$ git commit ...

Add the new changelog entry for the new backports, and commit

$ dch --bpo
# adapt the version if not good -> ~bpo8-N for jessie backports (see above)
$ debcommit -a

Then same as above: build the source package…

$ gbp buildpackage -S --git-tag

Then follow again the build procedure on oar-ftp (make sure OAR_VERSION is suffixed by bpoX, and OAR_CHROOT targets the correct backport distribution)

If OK, we only need to push the bpo branch + tags

$ git push $REMOTE && git push $REMOTE --tags

And finally dput just as with sid, the backported version should now show up in the jessie_backports_beta distribution of oar-ftp (resp. stretch-backports_beta for bpo9 packages and wheezy-backports_beta for bpo70 packages).

Push the packages to Debian official repositories

See with DD.

Some links:

wiki/debian_packaging.txt · Last modified: 2018/06/26 20:59 by neyron
Recent changes RSS feed GNU Free Documentation License 1.3 Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki