##// END OF EJS Templates
packaging: make packaging scripts less reliant on pwd...
Gregory Szorc -
r38033:917f635b default
parent child Browse files
Show More
@@ -6,6 +6,8 b''
6
6
7 . $(dirname $0)/packagelib.sh
7 . $(dirname $0)/packagelib.sh
8
8
9 ROOTDIR=$(cd $(dirname $0)/../.. > /dev/null; pwd)
10
9 BUILD=1
11 BUILD=1
10 CLEANUP=1
12 CLEANUP=1
11 DISTID=`(lsb_release -is 2> /dev/null | tr '[:upper:]' '[:lower:]') || echo debian`
13 DISTID=`(lsb_release -is 2> /dev/null | tr '[:upper:]' '[:lower:]') || echo debian`
@@ -73,7 +75,7 b' if [ "$BUILD" ]; then'
73 exit 1
75 exit 1
74 fi
76 fi
75
77
76 cp -r "$PWD"/contrib/packaging/debian debian
78 cp -r "$ROOTDIR"/contrib/packaging/debian debian
77
79
78 sed -i.tmp "s/__VERSION__/$debver/" $changelog
80 sed -i.tmp "s/__VERSION__/$debver/" $changelog
79 sed -i.tmp "s/__DATE__/$(date --rfc-2822)/" $changelog
81 sed -i.tmp "s/__DATE__/$(date --rfc-2822)/" $changelog
@@ -82,7 +84,7 b' if [ "$BUILD" ]; then'
82
84
83 # remove the node from the version string
85 # remove the node from the version string
84 SRCFILE="mercurial_$(echo $debver | sed "s,-$node,,").orig.tar.gz"
86 SRCFILE="mercurial_$(echo $debver | sed "s,-$node,,").orig.tar.gz"
85 "$PWD/hg" archive $SRCFILE
87 "$ROOTDIR/hg" archive $SRCFILE
86 mv $SRCFILE ..
88 mv $SRCFILE ..
87 debuild -us -uc -i -I $DEBFLAGS
89 debuild -us -uc -i -I $DEBFLAGS
88 if [ $? != 0 ]; then
90 if [ $? != 0 ]; then
@@ -20,13 +20,13 b' initcontainer $PLATFORM'
20 # debuild only appears to be able to save built debs etc to .., so we
20 # debuild only appears to be able to save built debs etc to .., so we
21 # have to share the .. of the current directory with the docker
21 # have to share the .. of the current directory with the docker
22 # container and hope it's writable. Whee.
22 # container and hope it's writable. Whee.
23 dn=$(basename $PWD)
23 dn=$(basename $ROOTDIR)
24
24
25 if [ $(uname) = "Darwin" ] ; then
25 if [ $(uname) = "Darwin" ] ; then
26 $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
26 $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
27 sh -c "cd /mnt/$dn && make clean && make local"
27 sh -c "cd /mnt/$dn && make clean && make local"
28 fi
28 fi
29 $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
29 $DOCKER run -u $DBUILDUSER --rm -v $ROOTDIR/..:/mnt $CONTAINER \
30 sh -c "cd /mnt/$dn && DEB_BUILD_OPTIONS='${DEB_BUILD_OPTIONS:=}' contrib/packaging/builddeb --build --distid $DISTID --codename $CODENAME $@"
30 sh -c "cd /mnt/$dn && DEB_BUILD_OPTIONS='${DEB_BUILD_OPTIONS:=}' contrib/packaging/builddeb --build --distid $DISTID --codename $CODENAME $@"
31 contrib/packaging/builddeb --cleanup --distid $DISTID --codename $CODENAME
31 contrib/packaging/builddeb --cleanup --distid $DISTID --codename $CODENAME
32 if [ $(uname) = "Darwin" ] ; then
32 if [ $(uname) = "Darwin" ] ; then
@@ -13,7 +13,7 b' shift # extra params are passed to build'
13 initcontainer $PLATFORM
13 initcontainer $PLATFORM
14
14
15 RPMBUILDDIR=$ROOTDIR/packages/$PLATFORM
15 RPMBUILDDIR=$ROOTDIR/packages/$PLATFORM
16 contrib/packaging/buildrpm --rpmbuilddir $RPMBUILDDIR --prepare $*
16 $ROOTDIR/contrib/packaging/buildrpm --rpmbuilddir $RPMBUILDDIR --prepare $*
17
17
18 DSHARED=/mnt/shared
18 DSHARED=/mnt/shared
19 $DOCKER run -e http_proxy -e https_proxy -u $DBUILDUSER --rm -v $RPMBUILDDIR:$DSHARED $CONTAINER \
19 $DOCKER run -e http_proxy -e https_proxy -u $DBUILDUSER --rm -v $RPMBUILDDIR:$DSHARED $CONTAINER \
General Comments 0
You need to be logged in to leave comments. Login now