Skip to content

Instantly share code, notes, and snippets.

@imincik
Created January 25, 2015 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imincik/6bd3d5df52318801d135 to your computer and use it in GitHub Desktop.
Save imincik/6bd3d5df52318801d135 to your computer and use it in GitHub Desktop.
My configuration of Debian packaging tools
FILE: ~/.pbuilderrc
==============================================================================
# Create Pbuilder image on Ubuntu
# sudo DIST=precise pbuilder create
# sudo DIST=precise pbuilder --update
# Build on Ubuntu
# DIST=precise git-buildpackage
# Create Pbuilder image on Debian
# sudo DIST=sid pbuilder create --debootstrapopts --keyring=/usr/share/keyrings/debian-archive-keyring.gpg
# sudo DIST=sid pbuilder --update
# Build on Debian
# DIST=sid git-buildpackage
# Login to image
# sudo pbuilder --login --basetgz /var/cache/pbuilder/base-precise-amd64.tgz (to save changes add --save-after-login option)
# Codenames for Debian suites according to their alias. Update these when
# needed.
UNSTABLE_CODENAME="sid"
TESTING_CODENAME="jessie"
STABLE_CODENAME="wheezy"
STABLE_BACKPORTS_SUITE="$STABLE_CODENAME-backports"
# List of Debian suites.
DEBIAN_SUITES=($UNSTABLE_CODENAME $TESTING_CODENAME $STABLE_CODENAME
"unstable" "testing" "stable")
# List of Ubuntu suites. Update these when needed.
UBUNTU_SUITES=("trusty", "saucy" "raring" "quantal" "precise" "oneiric" "natty" "lucid" "hardy")
# Mirrors to use. Update these to your preferred mirror.
DEBIAN_MIRROR="ftp.sk.debian.org"
UBUNTU_MIRROR="sk.archive.ubuntu.com"
# Optionally use the changelog of a package to determine the suite to use if
# none set.
if [ -z "${DIST}" ] && [ -r "debian/changelog" ]; then
DIST=$(dpkg-parsechangelog | awk '/^Distribution: / {print $2}')
# Use the unstable suite for Debian experimental packages.
if [ "${DIST}" == "experimental" ]; then
DIST="unstable"
fi
fi
# Optionally set a default distribution if none is used. Note that you can set
# your own default (i.e. ${DIST:="unstable"}).
: ${DIST:="$(lsb_release --short --codename)"}
# Optionally change Debian codenames in $DIST to their aliases.
case "$DIST" in
$UNSTABLE_CODENAME)
DIST="unstable"
;;
$TESTING_CODENAME)
DIST="testing"
;;
$STABLE_CODENAME)
DIST="stable"
;;
esac
# 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/"
if $(echo ${DEBIAN_SUITES[@]} | grep -q $DIST); then
# Debian configuration
MIRRORSITE="http://$DEBIAN_MIRROR/debian/"
COMPONENTS="main contrib non-free"
if $(echo "$STABLE_CODENAME stable" | grep -q $DIST); then
EXTRAPACKAGES="$EXTRAPACKAGES debian-backports-keyring"
OTHERMIRROR="$OTHERMIRROR | deb http://backports.debian.org/debian $STABLE_BACKPORTS_SUITE $COMPONENTS"
fi
elif $(echo ${UBUNTU_SUITES[@]} | grep -q $DIST); then
# Ubuntu configuration
MIRRORSITE="http://$UBUNTU_MIRROR/ubuntu/"
OTHERMIRROR="$OTHERMIRROR | deb http://ppa.launchpad.net/imincik/general/ubuntu $DIST main | deb http://ppa.launchpad.net/imincik/gis-dev/ubuntu $DIST main"
COMPONENTS="main restricted universe multiverse"
else
echo "Unknown distribution: $DIST"
exit 1
fi
BUILDRESULT=~/tmp/pbuilder-results
HOOKDIR=~/.pbuilder/hooks
EXTRAPACKAGES="${EXTRAPACKAGES} devscripts gnupg patchutils vim-tiny openssh-client lintian"
ALLOWUNTRUSTED=yes
FILE: ~/.gbp.conf
==============================================================================================
# build binary package: git-buildpackage --git-debian-branch=<branch>
# build source package: git-buildpackage --git-debian-branch=<branch> --git-builder="debuild -S -sa"
# build source package (no src to upload): git-buildpackage --git-debian-branch=<branch> --git-builder="debuild -S -sd"
# upload package: dput ppa:imincik/<ppa> ./<package>_source.changes
[DEFAULT]
builder = pdebuild
cleaner = fakeroot debian/rules clean
pristine-tar = True
keyid = 0x79529A1E
[git-dch]
git-log=--no-merges
[git-buildpackage]
export-dir=../build-area
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment