Pre-requisites

  • a Debian Stretch (or newer) system
  • Tails' devel APT suite enabled
  • the latest version of the tails-perl5lib package installed

Install build and test dependencies

git checkout master && \
sudo apt install \
   devscripts \
   dh-make-perl \
   libdist-zilla-app-command-authordebs-perl && \
dzil authordebs --install && \
git checkout debian && \
mk-build-deps -i -r --root-cmd sudo

Make an upstream release

git checkout master

Enable new translations in po/PACKAGE and commit.

Export new upstream version number:

export VERSION=XXX

Update version number in bin/tails-persistence-setup and commit all files that need to be:

perl -pi -E 's,^Version [0-9.]+,Version $ENV{VERSION},' bin/tails-persistence-setup && \
perl -pi -E "s,^our \\\$VERSION = '[0-9.]+';\$,our \\\$VERSION = '$VERSION';," bin/tails-persistence-setup && \
git commit bin/tails-persistence-setup -m "tails-persistent-setup $VERSION"

Optionally, run the upstream test suite (it is run as part of the Debian package build later, but running it early may avoid publishing a broken upstream release; however, beware if you are running Debian testing/sid: it has happened in the past that this code base required adjustments to work with newer versions of the libraries it depends on, so if tests fail on testing/sid, retry on Debian stable before going amok):

RELEASE_TESTING=1 LC_ALL=C fakeroot dzil test

Build an upstream tarball, tag the release, move the tarball out of the build repository and cleanup:

dzil build && \
   git tag -s $VERSION -m "tails-persistent-setup $VERSION" && \
   mv Tails-Persistence-*.tar.gz .. && \
   rm -rf Tails-Persistence-* .build po/*.mo

Update the Debian package

Checkout the Debian packaging branch and import the new upstream tarball:

git checkout debian && \
   gbp import-orig --upstream-vcs-tag=$VERSION \
   ../Tails-Persistence-$VERSION.tar.gz

Update debian/changelog:

gbp dch --auto --spawn-editor=always

(Do not forget to set the appropriate release.)

Commit debian/changelog:

    git commit debian/changelog \
        -m "$(dpkg-parsechangelog -SSource) ($(dpkg-parsechangelog -SVersion))

Git-Dch: Ignore "

Build a Debian package (use a Stretch/amd64 chroot, that has stretch-backports enabled and on top of that: either tails-perl5lib installed or the Tails APT repository configured):

gbp buildpackage

If everything is fine, add a signed tag to the repository and push the changes:

gbp buildpackage --git-tag-only --git-sign-tags && \
git push --follow-tags \
               origin master:master \
               debian:debian \
               pristine-tar:pristine-tar \
               upstream:upstream

(Make sure master, upstream, debian and pristine-tar were all pushed.)

Add the Debian package to Tails

Sign the package:

debsign $CHANGES_FILE

Upload:

dupload --to tails $CHANGES_FILE