10 |
10 |
11 DEBPLATFORM="$1" |
11 DEBPLATFORM="$1" |
12 PLATFORM="debian-$1" |
12 PLATFORM="debian-$1" |
13 shift # extra params are passed to build process |
13 shift # extra params are passed to build process |
14 |
14 |
|
15 OUTPUTDIR=${OUTPUTDIR:=$ROOTDIR/packages/$PLATFORM} |
|
16 |
15 initcontainer $PLATFORM |
17 initcontainer $PLATFORM |
16 |
18 |
17 DEBBUILDDIR=${OUTPUTDIR:=$ROOTDIR/packages/$PLATFORM} |
19 # debuild only appears to be able to save built debs etc to .., so we |
18 OUTPUTDIR=$DEBBUILDDIR/staged contrib/builddeb --release $DEBPLATFORM --prepare |
20 # have to share the .. of the current directory with the docker |
|
21 # container and hope it's writable. Whee. |
|
22 dn=$(basename $PWD) |
19 |
23 |
20 DSHARED=/mnt/shared/ |
|
21 if [ $(uname) = "Darwin" ] ; then |
24 if [ $(uname) = "Darwin" ] ; then |
22 $DOCKER run -u $DBUILDUSER --rm -v $DEBBUILDDIR:$DSHARED -v $PWD:/mnt/hg $CONTAINER \ |
25 $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \ |
23 sh -c "cd /mnt/hg && make clean && make local" |
26 sh -c "cd /mnt/$dn && make clean && make local" |
24 fi |
27 fi |
25 $DOCKER run -u $DBUILDUSER --rm -v $DEBBUILDDIR:$DSHARED -v $PWD:/mnt/hg $CONTAINER \ |
28 $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \ |
26 sh -c "cd /mnt/hg && make PREFIX=$DSHARED/staged/usr install" |
29 sh -c "cd /mnt/$dn && DEB_BUILD_OPTIONS='${DEB_BUILD_OPTIONS:=}' contrib/builddeb --build --release $DEBPLATFORM" |
27 $DOCKER run -u $DBUILDUSER --rm -v $DEBBUILDDIR:$DSHARED $CONTAINER \ |
30 contrib/builddeb --cleanup --release $DEBPLATFORM |
28 dpkg-deb --build $DSHARED/staged |
|
29 if [ $(uname) = "Darwin" ] ; then |
31 if [ $(uname) = "Darwin" ] ; then |
30 $DOCKER run -u $DBUILDUSER --rm -v $DEBBUILDDIR:$DSHARED -v $PWD:/mnt/hg $CONTAINER \ |
32 $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \ |
31 sh -c "cd /mnt/hg && make clean" |
33 sh -c "cd /mnt/$dn && make clean" |
32 fi |
34 fi |
33 |
|
34 gethgversion |
|
35 |
|
36 rm -r $DEBBUILDDIR/staged |
|
37 mv $DEBBUILDDIR/staged.deb $DEBBUILDDIR/mercurial-$version-$release.deb |
|
38 |
|
39 echo |
|
40 echo "Build complete - results can be found in $DEBBUILDDIR" |
|