Created
December 30, 2015 18:09
-
-
Save oerdnj/2961ead0eb144e05db1a to your computer and use it in GitHub Desktop.
Ubuntu PPA Build scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case "$PPA" in | |
php5-5.4) DISTS="precise";; | |
php5-5.5) DISTS="trusty vivid wily";; | |
php5-5.6) DISTS="trusty vivid wily";; | |
php-7.0) DISTS="trusty vivid wily";; | |
php) DISTS="trusty vivid wily";; | |
apache2) DISTS="trusty vivid wily";; | |
bird) DISTS="precise trusty vivid wily";; | |
knot) DISTS="trusty vivid wily";; | |
knot-lts) DISTS="precise trusty vivid wily";; | |
datovka) DISTS="trusty vivid wily";; | |
turris) DISTS="trusty vivid wily";; | |
cyrus-imapd) DISTS="trusty vivid wily";; | |
knot-experimental) DISTS="trusty vivid wily";; | |
knot-nightly) DISTS="trusty vivid wily";; | |
gearman*) DISTS="trusty vivid wily";; | |
redmine|ruby) DISTS="trusty vivid wily";; | |
dpa) DISTS="wheezy jessie";; | |
mysql-5.7) DISTS="trusty vivid wily";; | |
*) DISTS="trusty vivid wily";; | |
esac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -ex | |
DEBSIGN_KEYID=0x57067BAA1314C7FC | |
TEMP=$(getopt -o ip:b:u:k: --long ignore,patch:,branch:,upload:,keyid -n $0 -- "$@") | |
eval set -- "$TEMP" | |
PATCH=1 | |
BRANCH= | |
IGNORE= | |
PPA= | |
while true; do | |
case "$1" in | |
-k|--keyid) DEBSIGN_KEYID=$2; shift 2 ;; | |
-p|--patch) PATCH=$2; shift 2 ;; | |
-b|--branch) BRANCH="--git-debian-branch=$2"; shift 2 ;; | |
-i|--ignore) IGNORE="--git-ignore-new"; shift ;; | |
-u|--upload) PPA=$2; shift 2 ;; | |
--) shift ; break ;; | |
esac | |
done | |
# Mark variables for export | |
export DIST ARCH EXTRA_VERSION DEBSIGN_KEYID | |
[ "$PPA" = "-" ] && PPA=$(basename $(pwd)) | |
[ -f ~/bin/ubuntu-dists ] && . ~/bin/ubuntu-dists | |
[ -f ../ubuntu-dists ] && . ../ubuntu-dists | |
[ -f debian/ubuntu-dists ] && . debian/ubuntu-dists | |
S=$(dpkg-parsechangelog | sed -n "s/^Source: //p;") | |
V=$(dpkg-parsechangelog | sed -n "s/^Version: //p;" | sed -e "s/^[0-9]*://") | |
for DIST in $DISTS; do | |
case "${S}" in | |
bird|knot) | |
EXTRA_VERSION='+'${DIST}'+'${PATCH:-1} | |
;; | |
*) | |
EXTRA_VERSION='+deb.sury.org~'${DIST}'+'${PATCH:-1} | |
;; | |
esac | |
if [ \! -f "../build-area/${S}_${V}${EXTRA_VERSION}_source.changes" ]; then | |
gbp buildpackage \ | |
--git-export-dir=../build-area \ | |
--git-postexport=$HOME/bin/auto-backport-wrapper \ | |
${BRANCH} \ | |
${IGNORE} \ | |
--git-builder=debuild \ | |
--git-dist=$DIST \ | |
--git-arch=$ARCH \ | |
-S -sa \ | |
$@ | |
# --git-postbuild="debsign --re-sign -k${DEBSIGN_KEYID} \${GBP_CHANGES_FILE}" \ | |
fi | |
done | |
if [ -n "${PPA}" ]; then | |
ubuntu-ppa-upload "${PPA}" "${S}_${V}" "${PATCH}" | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -ex | |
PPA=$1 | |
PACKAGE=$2 | |
PATCH=${3:-1} | |
FORCE=$4 | |
DEBSIGN_KEYID=0x57067BAA1314C7FC | |
if [ -f ~/bin/ubuntu-dists ]; then . ~/bin/ubuntu-dists; fi | |
if [ -f ../ubuntu-dists ]; then . ../ubuntu-dists; fi | |
if [ -f debian/ubuntu-dists ]; then . debian/ubuntu-dists; fi | |
for dist in $DISTS; do | |
if [ -f $2+${dist}+${PATCH}_source.changes ]; then | |
build_dir=. | |
else | |
build_dir=../build-area | |
fi | |
case "$PACKAGE" in | |
bird_*|knot_*) | |
CHANGES=${build_dir}/$2+${dist}+${PATCH}_source.changes | |
;; | |
*) | |
CHANGES=${build_dir}/$2+deb.sury.org~${dist}+${PATCH}_source.changes | |
;; | |
esac | |
debsign --no-re-sign -k$DEBSIGN_KEYID $CHANGES | |
dput $FORCE $1-ppa $CHANGES | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment