2015-05-06 20:15:39 +03:00
|
|
|
#!/bin/bash -eu
|
|
|
|
|
|
|
|
. $(dirname $0)/dockerlib.sh
|
|
|
|
. $(dirname $0)/packagelib.sh
|
|
|
|
|
|
|
|
BUILDDIR=$(dirname $0)
|
2016-04-17 20:36:40 +03:00
|
|
|
export ROOTDIR=$(cd $BUILDDIR/.. > /dev/null; pwd)
|
2015-05-06 20:15:39 +03:00
|
|
|
|
|
|
|
checkdocker
|
|
|
|
|
2015-11-25 10:15:03 +03:00
|
|
|
DISTID="$1"
|
|
|
|
CODENAME="$2"
|
|
|
|
PLATFORM="$1-$2"
|
2016-04-23 22:47:39 +03:00
|
|
|
shift; shift # extra params are passed to build process
|
2015-05-06 20:15:39 +03:00
|
|
|
|
2015-08-26 17:59:09 +03:00
|
|
|
OUTPUTDIR=${OUTPUTDIR:=$ROOTDIR/packages/$PLATFORM}
|
|
|
|
|
2015-05-06 20:15:39 +03:00
|
|
|
initcontainer $PLATFORM
|
|
|
|
|
2015-08-26 17:59:09 +03:00
|
|
|
# debuild only appears to be able to save built debs etc to .., so we
|
|
|
|
# have to share the .. of the current directory with the docker
|
|
|
|
# container and hope it's writable. Whee.
|
|
|
|
dn=$(basename $PWD)
|
2015-05-06 20:15:39 +03:00
|
|
|
|
|
|
|
if [ $(uname) = "Darwin" ] ; then
|
2015-08-26 17:59:09 +03:00
|
|
|
$DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
|
|
|
|
sh -c "cd /mnt/$dn && make clean && make local"
|
2015-05-06 20:15:39 +03:00
|
|
|
fi
|
2015-08-26 17:59:09 +03:00
|
|
|
$DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
|
2016-04-23 22:47:57 +03:00
|
|
|
sh -c "cd /mnt/$dn && DEB_BUILD_OPTIONS='${DEB_BUILD_OPTIONS:=}' contrib/builddeb --build --distid $DISTID --codename $CODENAME $@"
|
2015-11-25 10:15:03 +03:00
|
|
|
contrib/builddeb --cleanup --distid $DISTID --codename $CODENAME
|
2015-05-06 20:15:39 +03:00
|
|
|
if [ $(uname) = "Darwin" ] ; then
|
2015-08-26 17:59:09 +03:00
|
|
|
$DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
|
|
|
|
sh -c "cd /mnt/$dn && make clean"
|
2015-05-06 20:15:39 +03:00
|
|
|
fi
|