##// END OF EJS Templates
builddeb: actually run make when building the deb (issue4778)...
Augie Fackler -
r26090:e5f2a2a0 default
parent child Browse files
Show More
@@ -1,62 +1,63 b''
1 1 #!/bin/sh -e
2 2 #
3 3 # Build a Mercurial debian package from the current repo
4 4 #
5 5 # Tested on Jessie (stable as of original script authoring.)
6 6
7 7 . $(dirname $0)/packagelib.sh
8 8
9 9 BUILD=1
10 10 DEBBUILDDIR="$PWD/debbuild"
11 11 while [ "$1" ]; do
12 12 case "$1" in
13 13 --prepare )
14 14 shift
15 15 BUILD=
16 16 ;;
17 17 --debbuilddir )
18 18 shift
19 19 DEBBUILDDIR="$1"
20 20 shift
21 21 ;;
22 22 * )
23 23 echo "Invalid parameter $1!" 1>&2
24 24 exit 1
25 25 ;;
26 26 esac
27 27 done
28 28
29 29 set -u
30 30
31 31 rm -rf $DEBBUILDDIR
32 32 mkdir -p $DEBBUILDDIR
33 33
34 34 if [ ! -d .hg ]; then
35 35 echo 'You are not inside a Mercurial repository!' 1>&2
36 36 exit 1
37 37 fi
38 38
39 39 gethgversion
40 40
41 41 cp -r $PWD/contrib/debian $DEBBUILDDIR/DEBIAN
42 42 chmod -R 0755 $DEBBUILDDIR/DEBIAN
43 43
44 44 control=$DEBBUILDDIR/DEBIAN/control
45 45
46 46 # This looks like sed -i, but sed -i behaves just differently enough
47 47 # between BSD and GNU sed that I gave up and did the dumb thing.
48 48 sed "s/__VERSION__/$version/" < $control > $control.tmp
49 49 mv $control.tmp $control
50 50
51 51 if [ "$BUILD" ]; then
52 make PREFIX=$DEBBUILDDIR/usr install
52 53 dpkg-deb --build $DEBBUILDDIR
53 54 mv $DEBBUILDDIR.deb $DEBBUILDDIR/mercurial-$version-$release.deb
54 55 if [ $? = 0 ]; then
55 56 echo
56 57 echo "Built packages for $version-$release:"
57 58 find $DEBBUILDDIR/ -type f -newer $control
58 59 fi
59 60 else
60 61 echo "Prepared sources for $version-$release $control are in $DEBBUILDDIR - use like:"
61 62 echo "dpkg-deb --build $DEBBUILDDIR"
62 63 fi
General Comments 0
You need to be logged in to leave comments. Login now