Version 102 (modified by 9 years ago) ( diff ) | ,
---|
Table of Contents
This page contains notes about Debian and Ubuntu packaging.
Debian
- Debian Package Auto-Building
- Debian Package Tracker
- Alioth.debian.org Git Repository
- Debian GIS Policy
Ubuntu
Launchpad
Requirement to upload packages:
- update OpenGPG to http://keyserver.ubuntu.com and then register OpenGPG in your Launchpad account
Git workflow using the GRASS specific branches
Set up building environment
Install requirements:
sudo apt-get install git-buildpackage # on Debian also sudo apt-get install ubuntu-archive-keyring
Set sudo access
Run
sudo visudo
and add lines bellow:
# Cmnd alias specification Cmnd_Alias PBUILDERS=/usr/sbin/pbuilder, /usr/sbin/cowbuilder # User privilege specification <username> ALL=(root) NOPASSWD:PBUILDERS
Configuration file
Configuration file for pbuilder (~/.pbuilderrc
):
# Optionally set the architecture to the host architecture if none set. Note # that you can set your own default (i.e. ${ARCH:="i386"}). ###: ${ARCH:="$(dpkg --print-architecture)"} NAME="$DIST" if [ -n "${ARCH}" ]; then NAME="$NAME-$ARCH" DEBOOTSTRAPOPTS=("--arch" "$ARCH" "${DEBOOTSTRAPOPTS[@]}") fi BASETGZ="/var/cache/pbuilder/$NAME-base.tgz" DISTRIBUTION="$DIST" BUILDRESULT="/var/cache/pbuilder/$NAME/result/" APTCACHE="/var/cache/pbuilder/$NAME/aptcache/" BUILDPLACE="/var/cache/pbuilder/build/" DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}" "--keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg") MIRRORSITE="http://cz.archive.ubuntu.com/ubuntu/" OTHERMIRROR="deb http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu $DIST main" COMPONENTS="main restricted universe multiverse" BUILDRESULT=/root/tmp/pbuilder-results HOOKDIR=/root/pbuilder-hooks EXTRAPACKAGES="${EXTRAPACKAGES} devscripts gnupg patchutils vim-tiny openssh-client lintian" ALLOWUNTRUSTED=yes
It's a good idea to configure also lintian pbuilder hook:
mkdir ~/pbuilder-hooks cp /usr/share/doc/pbuilder/examples/B90lintian ~/pbuilder-hooks/ sed -i 's/lintian -I --show-overrides/& --pedantic -E/; s/^su /##&/; s/^#su /su /' ~/pbuilder-hooks/B90lintian
Create chroot environment
Create specific chroot environment by (example for Ubuntu Wily - 15.10):
export DIST=wily sudo -E cowbuilder --create --distribution=$DIST --basepath=/var/cache/pbuilder/base-${DIST}-ubuntugis.cow --save-after-login
Build new package
Clone Git repository
mkdir pkg-grass cd pkg-grass debcheckout --user <username> --git-track '*' grass
and checkout selected branch (example for Ubuntu Wily - 15.10):
export DIST=wily export VERSION=7.0.3~rc2 export PATCH=1 cd pkg-grass/grass git checkout ubuntugis/$DIST
Update changelog by
dch -v ${VERSION}-${PATCH}~exp1~${DIST}1
and put lines (example for GRASS GIS 7.0.3RC1):
grass (7.0.3~rc1-1~exp1~wily1) wily; urgency=medium * New upstream release candidate. -- [commiters_name] <[commiters_email]> Tue, 12 Jan 2016 20:57:45 +0100
Commit changes to Git repository:
git commit -am"New upstream release candidate ($VERSION)"
Build package:
gbp buildpackage -S -sa --git-pbuilder --git-dist=${DIST}-ubuntugis >../log.packager-$DIST 2>&1
Note1: use -sa
only when build/uploading first package for GRASS version
Note2: all lintian issues of severity info (I:) and higher need to be reviewed and fixed before the upload
cat ../log.packager-$DIST | awk '/+++ lintian output +++/,/+++ end of lintian output +++/' | grep -v ^+++
Tag release version in Git repository:
git tag ubuntugis/`echo $VERSION | sed 's/~/./g'`-${PATCH}.exp1.${DIST}1
Push the package:
git push --all --set-upstream && git push --tags
Upload to Launchpad
Configuration file ~/.dput.cf
:
[ubuntugis-unstable] fqdn = ppa.launchpad.net method = sftp incoming = ~ubuntugis/ubuntugis-unstable/ubuntu/ login = <yours-launchpad-id> allow_unsigned_uploads = 0
Sign created package
debsign ../grass_${VERSION}-${PATCH}~exp1~${DIST}1_source.changes
and upload to Launchpad:
dput ubuntugis-unstable ../grass_${VERSION}-${PATCH}~exp1~${DIST}1_source.changes
Notes
Create new branch for Ubuntu version
Create a new branch if not exists:
git checkout -b ubuntugis/$DIST debian/7.0.3.rc1-1.exp2 git push origin ubuntugis/$DIST
Update branch in gbp.conf & Vcs-Git URL, see example.
Merge changes related to given tag
git checkout pristine-tar git pull git checkout ubuntugis/$DIST git merge debian/`echo $VERSION | sed 's/~/./g'`-${PATCH}.exp1 cp debian/changelog /tmp git checkout ORIG_HEAD -- debian/control debian/control.in debian/gbp.conf debian/changelog dch -v ${VERSION}-${PATCH}~exp1~${DIST}1 # merge logs
Build package from tarball
Warning: this part is out-dated, use Git workflow using the GRASS specific branches instead.
### Based on notes by Ivan Mincik ### http://lists.osgeo.org/pipermail/grass-dev/2015-January/073444.html export BASE=7 export MVER=70 export CUR=7.0.1RC1-1 export NEW=7.0.1RC2 export PATCH=1 # 1. Download latest existing version of package from Launchpad dget https://launchpad.net/~grass/+archive/ubuntu/grass-stable/+files/grass${BASE}_${CUR}~ubuntu14.04.1.dsc # 2. Prepare working directory with git enabled mkdir pkg-grass cd pkg-grass git init # 3. Import downloaded version of package from Launchpad git-import-dsc ../grass${BASE}_${CUR}~ubuntu14.04.1.dsc # 4. Import new tarball we want to build (cd .. ; wget http://grass.osgeo.org/grass${MVER}/source/grass-${NEW}.tar.gz) git-import-orig ../grass-${NEW}.tar.gz # 5. Optionally, merge Debian packaging bzr branch lp:~grass/grass/grass70_release_debian debian ### RUN IN LOOP # Update Debian changelog dch -i # enter lines like: # grass${BASE} (${NEW}-${PATCH}~ubuntu15.10.1) wily; urgency=medium # ... # grass${BASE} (${NEW}-${PATCH}~ubuntu15.04.1) vivid; urgency=medium # ... # grass${BASE} (${NEW}-${PATCH}~ubuntu14.04.1) trusty; urgency=medium # ... # grass${BASE} (${NEW}-${PATCH}~ubuntu12.04.1) precise; urgency=medium # Update local Git git add debian/changelog git commit -m "Debian changelog update" # Prepare source upload git-buildpackage --git-debian-branch=master --git-builder="debuild -S -sa" --git-ignore-new ### LOOP ENDS HERE # Upload source package for build to Launchpad dput ppa:grass/grass-stable ../grass${BASE}_${NEW}-${PATCH}~ubuntu15.10.1_source.changes dput ppa:grass/grass-stable ../grass${BASE}_${NEW}-${PATCH}~ubuntu15.04.1_source.changes dput ppa:grass/grass-stable ../grass${BASE}_${NEW}-${PATCH}~ubuntu14.04.1_source.changes dput ppa:grass/grass-stable ../grass${BASE}_${NEW}-${PATCH}~ubuntu12.04.1_source.changes