]> mj.ucw.cz Git - libucw.git/commitdiff
Build: Added support for chrooted building from Centrum Gigamail repository.
authorPavel Charvat <pchar@ucw.cz>
Tue, 18 Apr 2017 11:20:37 +0000 (13:20 +0200)
committerPavel Charvat <pchar@ucw.cz>
Tue, 18 Apr 2017 11:20:37 +0000 (13:20 +0200)
debian/mk
debian/pkg-lib

index 517faec3b0d949d1cd659503029d005f16211c14..84b92b5f32053b06b6b13df23325e52271da59a1 100755 (executable)
--- a/debian/mk
+++ b/debian/mk
@@ -1,6 +1,6 @@
 #!/bin/bash
 # A script for building of LibUCW packages
-# (c) 2013--2014 Pavel Charvat <pchar@ucw.cz>
+# (c) 2013--2017 Pavel Charvat <pchar@ucw.cz>
 
 set -e
 . debian/pkg-lib
@@ -16,6 +16,7 @@ Options:
 --abi-version=<ver>    Custom version number of the LibUCW's ABI (default: defined in ucw/default.cfg)
 --gen-script=<script>  Custom script to postprocess
 --extra-conf=<args>    Add extra arguments to the configure script
+--no-checkout          Expect manually checked out sources to build directory (useful for chrooted building; --version is mandatory)
 EOF
        exit 1
 }
@@ -69,7 +70,9 @@ while [ -n "$1" ] ; do
                        ;;
        --extra-conf=*) CONF="$CONF ${1:13}"
                        ;;
-        *)             usage
+       --no-checkout)  PKG_NO_CHECKOUT=1
+                       ;;
+       *)              usage
                        ;;
        esac
        shift
@@ -78,7 +81,7 @@ done
 pkg-git-version
 pkg-git-checkout
 
-echo $TREEVER >$BUILDDIR/UCW_VERSION
+echo $VER >$BUILDDIR/UCW_VERSION
 pkg-gen-debian
 
 BUILDOPTS=
index 62f32ce981095e965ed69b87290f97e7856459e9..4918e83d21df518c3f2a0094db7ec9302b2fedc3 100755 (executable)
@@ -1,17 +1,22 @@
 # A library of shell functions for building of Debian packages
 # (c) 2008--2009 Martin Mares <mj@ucw.cz>
-# (c) 2009--2013 Pavel Charvat <pchar@ucw.cz>
+# (c) 2009--2017 Pavel Charvat <pchar@ucw.cz>
 
 # Expects:
 # PKG          name of the package
 # ROOT         absolute path to the root of the source tree
 # PKGVER       custom package version
 
-unset PKG ROOT SRCVER VER
+unset PKG ROOT SRCVER VER PKG_NO_CHECKOUT
 
 function pkg-git-version {
-       TREEVER=`git describe --tags | sed 's/^v//;s/[a-f]$/&-0/'`
-       TREEHASH=`git rev-parse --verify HEAD`
+       if [ -z "$PKG_NO_CHECKOUT" ] ; then
+               TREEVER=`git describe --tags | sed 's/^v//;s/[a-f]$/&-0/'`
+               TREEHASH=`git rev-parse --verify HEAD`
+       else
+               TREEVER=?
+               TREEHASH=?
+       fi
        VER=${PKGVER:-$TREEVER}
        SRCVER=${PKGVER:-$VER}
        cat <<EOF
@@ -29,9 +34,11 @@ EOF
 
 function pkg-git-checkout {
        BUILDDIR=debian-tmp/$PKG-$SRCVER
-       rm -rf debian-tmp
-       mkdir -p $BUILDDIR
-       git checkout-index -a --prefix=$BUILDDIR/
+       if [ -z "$PKG_NO_CHECKOUT" ] ; then
+               rm -rf debian-tmp
+               mkdir -p $BUILDDIR
+               git checkout-index -a --prefix=$BUILDDIR/
+       fi
 }
 
 function pkg-fake-changelog {