Difference between revisions of "Debian Packaging Workflow"

From opm
Jump to navigation Jump to search
Line 40: Line 40:
 
* change the commit message to something more meaningful
 
* change the commit message to something more meaningful
  
==== Import a prerelease version using a tarball of a git commit ====
+
==== Import a prerelease version using an upstream git commit ====
  
Instead of importing the new version using uscan as above, you manually create a tarball based on a git check checkout of upstream.
+
Instead of importing the new version using uscan as above, you manually create a tarball based on a git checkout of upstream.
This assumes that you have checked out the version that you need.
+
This assumes that you have checked out the version that you need (e.g. by <code>git checkout upstream/master</code>).
  
 
  PACKAGE=opm-common # name of the package
 
  PACKAGE=opm-common # name of the package
 
  NEXTVERSION=2022.04 # next stable version
 
  NEXTVERSION=2022.04 # next stable version
 
  VERSION=$(git log -1 --date=format:%Y%m%d --pretty=$NEXTVERSION~git%cd.%h)
 
  VERSION=$(git log -1 --date=format:%Y%m%d --pretty=$NEXTVERSION~git%cd.%h)
 +
TAG=$(git rev-parse --short HEAD)
 
  PREFIX=${PACKAGE}_${VERSION}; DIR_PREFIX=${PACKAGE}-${VERSION};
 
  PREFIX=${PACKAGE}_${VERSION}; DIR_PREFIX=${PACKAGE}-${VERSION};
 
  git archive --format=tar --prefix=$DIR_PREFIX/ HEAD | gzip -c > ../$PREFIX.orig.tar.gz
 
  git archive --format=tar --prefix=$DIR_PREFIX/ HEAD | gzip -c > ../$PREFIX.orig.tar.gz
 
  git checkout master # branch with the debian packaging
 
  git checkout master # branch with the debian packaging
 +
gbp import-orig --upstream-vcs-tag=$TAG ../$PREFIX.orig.tar.gz
 +
 +
Doing it this way will make sure that branch upstream contains the complete upstream git history

Revision as of 13:29, 30 March 2022

Notes on Maintaining the Debian Packages

Although you may still find a debian subdirectory in our OPM repositories this is obsolete and should not be used as it is rather outdated. The Debian packaging effort takes place on salsa.debian.org and is managed by the Debian Science Team. To contribute you will have to create an account on salsa.debian.org and apply for being added to the Debian Science Team. If it takes long then you might want to send an email to the Debian Science mailinglist debian-science@lists.debian.org.

Repositories on Salsa

For each module there is a corresponding repository on sala. These are:

The packaging effort uses git-buildpackage as the main tool and bases the packaging on release tarballs and quilt for patching the upstream versions found in OPM's git repositories.


git-buildpackage instruction

repository management with git-buildpackage

This will clone the repository with the three banches master (Where the debian packaging effort is), upstream (The upstream repository as of the last release that was imported), and pristine-tar (The branch holding the deltas for reconstructing the original tarball).

  • To download the recent changes to the packaging effort from other do gbp pull
  • To upload your recent changes (to all relevant branches) use gbp push

Import new (final) upstream release

For more information see gbp documentation.

For importing a new upstream version, please follow the following recipe:

  • If not done yet, add the upstream git to repo , e.g. git remote add upstream https://github.com/OPM/opm-common
  • make sure the patch-queue branch is up to date
  • update upstream: git fetch upstream
  • update necessary branches from debian repo (in case of changes from others): gbp pull
  • import new version: gbp import-orig --uscan
  • rebase patch queue: gbp pq rebase
  • resolve conflicts, etc.
  • export the patch queue: gbp pq export --commit
  • change the commit message to something more meaningful

Import a prerelease version using an upstream git commit

Instead of importing the new version using uscan as above, you manually create a tarball based on a git checkout of upstream. This assumes that you have checked out the version that you need (e.g. by git checkout upstream/master).

PACKAGE=opm-common # name of the package
NEXTVERSION=2022.04 # next stable version
VERSION=$(git log -1 --date=format:%Y%m%d --pretty=$NEXTVERSION~git%cd.%h)
TAG=$(git rev-parse --short HEAD)
PREFIX=${PACKAGE}_${VERSION}; DIR_PREFIX=${PACKAGE}-${VERSION};
git archive --format=tar --prefix=$DIR_PREFIX/ HEAD | gzip -c > ../$PREFIX.orig.tar.gz
git checkout master # branch with the debian packaging
gbp import-orig --upstream-vcs-tag=$TAG ../$PREFIX.orig.tar.gz

Doing it this way will make sure that branch upstream contains the complete upstream git history