##// END OF EJS Templates
packaging: always execute builddeb from source root...
Gregory Szorc -
r38804:824636b0 stable
parent child Browse files
Show More
@@ -1,40 +1,40
1 #!/bin/bash -eu
1 #!/bin/bash -eu
2
2
3 . $(dirname $0)/packagelib.sh
3 . $(dirname $0)/packagelib.sh
4
4
5 BUILDDIR=$(dirname $0)
5 BUILDDIR=$(dirname $0)
6 export ROOTDIR=$(cd $BUILDDIR/../.. > /dev/null; pwd)
6 export ROOTDIR=$(cd $BUILDDIR/../.. > /dev/null; pwd)
7
7
8 DISTID="$1"
8 DISTID="$1"
9 CODENAME="$2"
9 CODENAME="$2"
10 PLATFORM="$1-$2"
10 PLATFORM="$1-$2"
11 shift; shift # extra params are passed to build process
11 shift; shift # extra params are passed to build process
12
12
13 OUTPUTDIR=${OUTPUTDIR:=$ROOTDIR/packages/$PLATFORM}
13 OUTPUTDIR=${OUTPUTDIR:=$ROOTDIR/packages/$PLATFORM}
14 CONTAINER=hg-docker-$PLATFORM
14 CONTAINER=hg-docker-$PLATFORM
15
15
16 DOCKER=$($BUILDDIR/hg-docker docker-path)
16 DOCKER=$($BUILDDIR/hg-docker docker-path)
17
17
18 $BUILDDIR/hg-docker build \
18 $BUILDDIR/hg-docker build \
19 --build-arg CODENAME=$CODENAME \
19 --build-arg CODENAME=$CODENAME \
20 $BUILDDIR/docker/$DISTID.template \
20 $BUILDDIR/docker/$DISTID.template \
21 $CONTAINER
21 $CONTAINER
22
22
23 # debuild only appears to be able to save built debs etc to .., so we
23 # debuild only appears to be able to save built debs etc to .., so we
24 # have to share the .. of the current directory with the docker
24 # have to share the .. of the current directory with the docker
25 # container and hope it's writable. Whee.
25 # container and hope it's writable. Whee.
26 dn=$(basename $ROOTDIR)
26 dn=$(basename $ROOTDIR)
27
27
28 DBUILDUSER=build
28 DBUILDUSER=build
29
29
30 if [ $(uname) = "Darwin" ] ; then
30 if [ $(uname) = "Darwin" ] ; then
31 $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
31 $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
32 sh -c "cd /mnt/$dn && make clean && make local"
32 sh -c "cd /mnt/$dn && make clean && make local"
33 fi
33 fi
34 $DOCKER run -u $DBUILDUSER --rm -v $ROOTDIR/..:/mnt $CONTAINER \
34 $DOCKER run -u $DBUILDUSER --rm -v $ROOTDIR/..:/mnt $CONTAINER \
35 sh -c "cd /mnt/$dn && DEB_BUILD_OPTIONS='${DEB_BUILD_OPTIONS:=}' contrib/packaging/builddeb --build --distid $DISTID --codename $CODENAME $@"
35 sh -c "cd /mnt/$dn && DEB_BUILD_OPTIONS='${DEB_BUILD_OPTIONS:=}' contrib/packaging/builddeb --build --distid $DISTID --codename $CODENAME $@"
36 contrib/packaging/builddeb --cleanup --distid $DISTID --codename $CODENAME
36 (cd $ROOTDIR && contrib/packaging/builddeb --cleanup --distid $DISTID --codename $CODENAME)
37 if [ $(uname) = "Darwin" ] ; then
37 if [ $(uname) = "Darwin" ] ; then
38 $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
38 $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
39 sh -c "cd /mnt/$dn && make clean"
39 sh -c "cd /mnt/$dn && make clean"
40 fi
40 fi
General Comments 0
You need to be logged in to leave comments. Login now