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 ..
# Set environment variables: OAR_DIR should be a relative path to your home. OAR_FTP can include a username if not the same on oar-ftp.
$ export OAR_DIR=${PWD#$HOME/} OAR_FTP=oar-ftp.lig
# First create the remote OAR_DIR directory (e.g. ~/scm/OAR) if it does not already exist
$ ssh $OAR_FTP mkdir -p $OAR_DIR
# Send files
$ 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 "export OAR_VERSION=$OAR_VERSION"
$ export OAR_CHROOT=$(head -n1 oar/debian/changelog |sed -e 's/^.\+)\s\+\([^\;]\+\);.\+$/\1/') && echo "export OAR_CHROOT=$OAR_CHROOT"
$ export OAR_SHORT_VERSION=$(echo $OAR_VERSION | sed -re 's/(.*)\-(.+)/\1/g') && echo "export OAR_SHORT_VERSION=$OAR_SHORT_VERSION"
# oar-ftp sshd accepts env variables OAR_*
# First update the build chroots
oar-ftp$ sudo sbuild-update source:$OAR_CHROOT && sudo sbuild-update --upgrade source:$OAR_CHROOT
# Other arch? arm64 and ppc64el:
oar-ftp$ sudo sbuild-update source:$OAR_CHROOT --arch arm64 && sudo sbuild-update --upgrade source:$OAR_CHROOT --arch arm64
oar-ftp$ sudo sbuild-update source:$OAR_CHROOT --arch ppc64el && sudo sbuild-update --upgrade source:$OAR_CHROOT --arch ppc64el
# Then build:
oar-ftp$ cd $OAR_DIR/build-area
# In some cases (if user on local machine is not the same as the oar-ftp VM), link need to be fixed
oar-ftp$ rm oar_$OAR_SHORT_VERSION.orig.tar.gz
oar-ftp$ ln -s $OAR_DIR/tarballs/oar_$OAR_SHORT_VERSION.orig.tar.gz oar_$OAR_SHORT_VERSION.orig.tar.gz
# amd64 and sources packages:
oar-ftp$ sbuild -As -d $OAR_CHROOT --arch amd64 --debbuildopts "-uc -us" oar_$OAR_VERSION.dsc
# Other arch ? arm64 and ppc64el binary packages:
oar-ftp$ sbuild -A -d $OAR_CHROOT --arch arm64 --debbuildopts "-uc -us" oar_$OAR_VERSION.dsc
oar-ftp$ sbuild -A -d $OAR_CHROOT --arch ppc64el --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} .
# require in some cases, as on oar-ftp
$ rm build-area/oar_${OAR_SHORT_VERSION}.orig.tar.gz
$ ln -s ../tarballs/oar_${OAR_SHORT_VERSION}.orig.tar.gz build-area/oar_${OAR_SHORT_VERSION}.orig.tar.gz

Verify and sign the generated packages

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

# 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
# or for multi-arch:
$ mergechanges -f oar_${OAR_VERSION}_*.changes
$ debsign oar_${OAR_VERSION}_multi.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
# Or if multi-arch:
$ cd ../build-area && dput oar_${OAR_VERSION}_multi.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: 2021/06/29 10:24 by snoir
Recent changes RSS feed GNU Free Documentation License 1.3 Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki