diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2013-07-19 13:48:49 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2013-07-19 13:48:49 +0200 |
commit | d114903e52e532fcb1587ceaf5eadbe9d26e45ac (patch) | |
tree | 1b7df61581fb3ef5b6b3ca195dce6b60b4209c67 /bin/build-package | |
parent | 0fe6d2898a908e40d1cde9669ebc450a8792c3b6 (diff) | |
download | buildscripts-d114903e52e532fcb1587ceaf5eadbe9d26e45ac.tar.gz buildscripts-d114903e52e532fcb1587ceaf5eadbe9d26e45ac.tar.bz2 buildscripts-d114903e52e532fcb1587ceaf5eadbe9d26e45ac.zip |
build 3.0 (quilt) packages, as well
Diffstat (limited to 'bin/build-package')
-rwxr-xr-x | bin/build-package | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/bin/build-package b/bin/build-package index 7b2549f..59da3ea 100755 --- a/bin/build-package +++ b/bin/build-package @@ -102,16 +102,19 @@ prepare_workspace() { if [ -d "$PROJECT_DIR/.git" ]; then cd "$PROJECT_DIR" && git reset --hard git checkout --force $CHECKOUT || git checkout --force -b $CHECKOUT - git pull --all origin $CHECKOUT + git pull origin $CHECKOUT + git fetch origin upstream:upstream || true + git fetch origin pristine-tar:pristine-tar || true # and again, get the $CHECKOUT refspec in pure state git reset --hard git clean -df else cd "$(dirname $PROJECT_DIR)" git clone git://$GIT_HOSTNAME/$PROJECT_PATH.git - git fetch origin upstream:upstream cd "$PROJECT" git checkout --force $CHECKOUT || git checkout --force -b $CHECKOUT; + git fetch origin upstream:upstream + git fetch origin pristine-tar:pristine-tar || true git clean -df fi cd "$PROJECT_DIR" @@ -191,12 +194,18 @@ build_packages() { git checkout $CHECKOUT || git checkout master find $PROJECT_DIR/../ -type f -maxdepth 0 -mindepth 0 | grep $PROJECT_*.orig.tar.gz &>/dev/null && cp $PROJECT_DIR/../$PROJECT_*.orig.tar.gz .. GITREV=$(gitrevno) + + # we always build native packages for our repos + SA_OPTION="" + # we always build native packages for our repos test -f debian/source/format && cat debian/source/format | egrep '^3.0.*\(quilt\)$' >/dev/null && { git fetch origin upstream:upstream - UPSTREAM_VERSION=$(dpkg-parsechangelog | grep Version: | cut -d " " -f2 | sed -e 's/-.*// -e '/^.*://') - git archive --prefix=${PROJECT}-${UPSTREAM_VERSION} -o ../${PROJECT}_${UPSTREAM_VERSION}.orig.tar.gz upstream/${UPSTREAM_VERSION} || \ - echo "3.0 (native)" > debian/source/format + UPSTREAM_VERSION=$(dpkg-parsechangelog | grep Version: | cut -d " " -f2 | sed -e 's/-.*//' -e 's/^.*://') + REVISION=$(dpkg-parsechangelog | grep Version: | cut -d " " -f2 | sed -e 's/.*-//') + git archive --prefix=${PROJECT}-${UPSTREAM_VERSION}/ -o ../${PROJECT}_${UPSTREAM_VERSION}.orig.tar.gz upstream/${UPSTREAM_VERSION} && { + SA_OPTION="--debbuildopts=-sa" + } || echo "3.0 (native)" > debian/source/format } # for Ubuntu version is the codename of the distribution release @@ -227,32 +236,32 @@ build_packages() { [ "x$USE_SUDO" != "xyes" ] && { [ "x$EXTRA_ARCHS_ONLY" = "x" ] && { [ "x$SKIP_ARCH" != "xamd64" ] && cat debian/control | egrep 'Architecture.*(all|any|amd64)' >/dev/null && { - DIST=$l_DIST CODENAME=$l_CODENAME ARCH=amd64 $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult "$PKGDIST/$l_DIST/$l_CODENAME/amd64" -- --allow-untrusted 0<&- + DIST=$l_DIST CODENAME=$l_CODENAME ARCH=amd64 $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult "$PKGDIST/$l_DIST/$l_CODENAME/amd64" -- --allow-untrusted $SA_OPTION 0<&- } [ "x$SKIP_ARCH" != "xi386" ] && cat debian/control | egrep 'Architecture.*(any|i386)' >/dev/null && { - DIST=$l_DIST CODENAME=$l_CODENAME ARCH=i386 $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult "$PKGDIST/$l_DIST/$l_CODENAME/i386" -- --binary-arch --allow-untrusted 0<&- + DIST=$l_DIST CODENAME=$l_CODENAME ARCH=i386 $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult "$PKGDIST/$l_DIST/$l_CODENAME/i386" -- --binary-arch --allow-untrusted $SA_OPTION 0<&- } } for extra_arch in $EXTRA_ARCHS; do mkdir -p "$PKGDIST/$l_DIST/$l_CODENAME/$extra_arch" cat debian/control | egrep "Architecture.*(any|$extra_arch)" >/dev/null && { - DIST=$l_DIST CODENAME=$l_CODENAME ARCH=$extra_arch $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult "$PKGDIST/$l_DIST/$l_CODENAME/$extra_arch" -- --binary-arch --allow-untrusted 0<&- + DIST=$l_DIST CODENAME=$l_CODENAME ARCH=$extra_arch $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult "$PKGDIST/$l_DIST/$l_CODENAME/$extra_arch" -- --binary-arch --allow-untrusted $SA_OPTION 0<&- } done } [ "x$USE_SUDO" = "xyes" ] && { [ "x$EXTRA_ARCHS_ONLY" = "x" ] && { [ "x$SKIP_ARCH" != "xamd64" ] && cat debian/control | egrep 'Architecture.*(all|any|amd64)' >/dev/null && { - sudo GNUPGHOME=$GNUPGHOME DIST=$l_DIST CODENAME=$l_CODENAME ARCH=amd64 OTHERMIRROR="$OTHERMIRROR" $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult $PKGDIST/$l_DIST/$l_CODENAME/amd64 -- --allow-untrusted 0<&- + sudo GNUPGHOME=$GNUPGHOME DIST=$l_DIST CODENAME=$l_CODENAME ARCH=amd64 OTHERMIRROR="$OTHERMIRROR" $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult $PKGDIST/$l_DIST/$l_CODENAME/amd64 -- --allow-untrusted $SA_OPTION 0<&- } [ "x$SKIP_ARCH" != "xi386" ] && cat debian/control | egrep 'Architecture.*(any|i386)' >/dev/null && { - sudo GNUPGHOME=$GNUPGHOME DIST=$l_DIST CODENAME=$l_CODENAME ARCH=i386 OTHERMIRROR="$OTHERMIRROR" $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult $PKGDIST/$l_DIST/$l_CODENAME/i386 -- --binary-arch --allow-untrusted 0<&- + sudo GNUPGHOME=$GNUPGHOME DIST=$l_DIST CODENAME=$l_CODENAME ARCH=i386 OTHERMIRROR="$OTHERMIRROR" $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult $PKGDIST/$l_DIST/$l_CODENAME/i386 -- --binary-arch --allow-untrusted $SA_OPTION 0<&- } } for extra_arch in $EXTRA_ARCHS; do mkdir -p "$PKGDIST/$l_DIST/$l_CODENAME/$extra_arch" cat debian/control | egrep "Architecture.*(any|$extra_arch)" >/dev/null && { - sudo GNUPGHOME=$GNUPGHOME DIST=$l_DIST CODENAME=$l_CODENAME ARCH=$extra_arch OTHERMIRROR="$OTHERMIRROR" $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult "$PKGDIST/$l_DIST/$l_CODENAME/$extra_arch" -- --binary-arch --allow-untrusted 0<&- + sudo GNUPGHOME=$GNUPGHOME DIST=$l_DIST CODENAME=$l_CODENAME ARCH=$extra_arch OTHERMIRROR="$OTHERMIRROR" $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult "$PKGDIST/$l_DIST/$l_CODENAME/$extra_arch" -- --binary-arch --allow-untrusted $SA_OPTION 0<&- } done } |