##// END OF EJS Templates
debian: switch to using debhelper and dh_python2 to build debs...
Augie Fackler -
r26148:7f49efca default
parent child Browse files
Show More
@@ -0,0 +1,5 b''
1 mercurial (__VERSION__) unstable; urgency=medium
2
3 * Automated build performed by upstream.
4
5 -- Mercurial Devel <mercurial-devel@selenic.com> __DATE__
@@ -0,0 +1,1 b''
1 9
@@ -0,0 +1,27 b''
1 Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2 Upstream-Name: mercurial
3 Source: http://www.selenic.com/mercurial/
4
5 Files: *
6 Copyright: 2005-2015, Matt Mackall <mpm@selenic.com> and others.
7 License: GPL-2+
8 This program is free software; you can redistribute it
9 and/or modify it under the terms of the GNU General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later
12 version.
13 .
14 This program is distributed in the hope that it will be
15 useful, but WITHOUT ANY WARRANTY; without even the implied
16 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
17 PURPOSE. See the GNU General Public License for more
18 details.
19 .
20 You should have received a copy of the GNU General Public
21 License along with this package; if not, write to the Free
22 Software Foundation, Inc., 51 Franklin St, Fifth Floor,
23 Boston, MA 02110-1301 USA
24 .
25 On Debian systems, the full text of the GNU General Public
26 License version 2 can be found in the file
27 `/usr/share/common-licenses/GPL-2'.
@@ -0,0 +1,29 b''
1 #!/usr/bin/make -f
2 # Uncomment this to turn on verbose mode.
3 # export DH_VERBOSE=1
4
5 CPUS=$(shell cat /proc/cpuinfo | grep -E ^processor | wc -l)
6
7 %:
8 dh $@ --with python2
9
10 override_dh_auto_test:
11 http_proxy='' dh_auto_test -- TESTFLAGS="-j$(CPUS)"
12
13 override_dh_python2:
14 dh_python2
15 find debian/mercurial/usr/share -type d -empty -delete
16
17 override_dh_install:
18 python$(PYVERS) setup.py install --root $(CURDIR)/debian/mercurial --install-layout=deb
19 # remove arch-independent python stuff
20 find $(CURDIR)/debian/mercurial/usr/lib \
21 ! -name '*.so' ! -type d -delete , \
22 -type d -empty -delete
23 python$(PYVERS) setup.py install --root $(CURDIR)/debian/mercurial-common --install-layout=deb
24 make install-doc PREFIX=$(CURDIR)/debian/mercurial-common/usr
25 # remove arch-dependent python stuff
26 find $(CURDIR)/debian/mercurial-common/usr/lib \
27 -name '*.so' ! -type d -delete , \
28 -type d -empty -delete
29 rm $(CURDIR)/debian/mercurial-common/usr/bin/hg
@@ -7,6 +7,7 b''
7 . $(dirname $0)/packagelib.sh
7 . $(dirname $0)/packagelib.sh
8
8
9 BUILD=1
9 BUILD=1
10 CLEANUP=1
10 DEBVERSION=jessie
11 DEBVERSION=jessie
11 while [ "$1" ]; do
12 while [ "$1" ]; do
12 case "$1" in
13 case "$1" in
@@ -15,10 +16,14 b' while [ "$1" ]; do'
15 DEBVERSION="$1"
16 DEBVERSION="$1"
16 shift
17 shift
17 ;;
18 ;;
18 --prepare )
19 --cleanup )
19 shift
20 shift
20 BUILD=
21 BUILD=
21 ;;
22 ;;
23 --build )
24 shift
25 CLEANUP=
26 ;;
22 --debbuilddir )
27 --debbuilddir )
23 shift
28 shift
24 DEBBUILDDIR="$1"
29 DEBBUILDDIR="$1"
@@ -31,13 +36,10 b' while [ "$1" ]; do'
31 esac
36 esac
32 done
37 done
33
38
34 DEBBUILDDIR=${OUTPUTDIR:="$PWD/debbuild"}
39 trap "if [ '$CLEANUP' ] ; then rm -r '$PWD/debian' ; fi" EXIT
35
40
36 set -u
41 set -u
37
42
38 rm -rf $DEBBUILDDIR
39 mkdir -p $DEBBUILDDIR
40
41 if [ ! -d .hg ]; then
43 if [ ! -d .hg ]; then
42 echo 'You are not inside a Mercurial repository!' 1>&2
44 echo 'You are not inside a Mercurial repository!' 1>&2
43 exit 1
45 exit 1
@@ -45,26 +47,38 b' fi'
45
47
46 gethgversion
48 gethgversion
47
49
48 cp -r $PWD/contrib/debian $DEBBUILDDIR/DEBIAN
50 control=debian/control
49 chmod -R 0755 $DEBBUILDDIR/DEBIAN
51 changelog=debian/changelog
50
51 control=$DEBBUILDDIR/DEBIAN/control
52
53 # This looks like sed -i, but sed -i behaves just differently enough
54 # between BSD and GNU sed that I gave up and did the dumb thing.
55 sed "s/__VERSION__/$version/" < $control > $control.tmp
56 mv $control.tmp $control
57
52
58 if [ "$BUILD" ]; then
53 if [ "$BUILD" ]; then
59 make PREFIX=$DEBBUILDDIR/usr install
54 if [ -d debian ] ; then
60 dpkg-deb --build $DEBBUILDDIR
55 echo "Error! debian control directory already exists!"
61 mv $DEBBUILDDIR.deb $DEBBUILDDIR/mercurial-$version-$release.deb
56 exit 1
62 if [ $? = 0 ]; then
63 echo
64 echo "Built packages for $version-$release:"
65 find $DEBBUILDDIR/ -type f -newer $control
66 fi
57 fi
67 else
58
68 echo "Prepared sources for $version-$release $control are in $DEBBUILDDIR - use like:"
59 cp -r $PWD/contrib/debian debian
69 echo "dpkg-deb --build $DEBBUILDDIR"
60 chmod -R 0755 debian
61
62 # This looks like sed -i, but sed -i behaves just differently enough
63 # between BSD and GNU sed that I gave up and did the dumb thing.
64 sed "s/__VERSION__/$version/" < $changelog > $changelog.tmp
65 date=$(date --rfc-2822)
66 sed "s/__DATE__/$date/" < $changelog.tmp > $changelog
67 rm $changelog.tmp
68
69 debuild -us -uc -b
70 if [ $? != 0 ]; then
71 echo 'debuild failed!'
72 exit 1
73 fi
74
70 fi
75 fi
76 if [ "$CLEANUP" ] ; then
77 echo
78 OUTPUTDIR=${OUTPUTDIR:=packages/debian-$DEBVERSION}
79 find ../mercurial*.deb ../mercurial_*.build ../mercurial_*.changes \
80 -type f -newer $control -print0 | \
81 xargs -Inarf -0 mv narf "$OUTPUTDIR"
82 echo "Built packages for $version-$release:"
83 find "$OUTPUTDIR" -type f -newer $control -name '*.deb'
84 fi
@@ -1,9 +1,47 b''
1 Package: mercurial
1 Source: mercurial
2 Version: __VERSION__
3 Section: vcs
2 Section: vcs
4 Priority: optional
3 Priority: optional
4 Maintainer: Mercurial Developers <mercurial-devel@selenic.com>
5 Build-Depends:
6 debhelper (>= 7),
7 dh-python,
8 python-all
9 Standards-Version: 3.9.4
10 X-Python-Version: >= 2.6
11
12 Package: mercurial
13 Depends:
14 python,
15 ${shlibs:Depends},
16 ${misc:Depends},
17 ${python:Depends},
18 mercurial-common (= ${source:Version})
19 Architecture: any
20 Description: fast, easy to use, distributed revision control tool.
21 Mercurial is a fast, lightweight Source Control Management system designed
22 for efficient handling of very large distributed projects.
23 .
24 Its features include:
25 * O(1) delta-compressed file storage and retrieval scheme
26 * Complete cross-indexing of files and changesets for efficient exploration
27 of project history
28 * Robust SHA1-based integrity checking and append-only storage model
29 * Decentralized development model with arbitrary merging between trees
30 * Easy-to-use command-line interface
31 * Integrated stand-alone web interface
32 * Small Python codebase
33
34 Package: mercurial-common
5 Architecture: all
35 Architecture: all
6 Depends: python
36 Depends:
7 Conflicts: mercurial-common
37 ${misc:Depends},
8 Maintainer: Mercurial Developers <mercurial-devel@selenic.com>
38 ${python:Depends},
9 Description: Mercurial (probably nightly) package built by upstream.
39 Recommends: mercurial (= ${source:Version}), ca-certificates
40 Breaks: mercurial (<< ${source:Version})
41 Replaces: mercurial (<< 2.6.3)
42 Description: easy-to-use, scalable distributed version control system (common files)
43 Mercurial is a fast, lightweight Source Control Management system designed
44 for efficient handling of very large distributed projects.
45 .
46 This package contains the architecture independent components of Mercurial,
47 and is generally useless without the mercurial package.
@@ -12,29 +12,23 b' 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"
@@ -1,4 +1,8 b''
1 #require test-repo slow debhelper
1 #require test-repo slow debhelper
2
3 Ensure debuild doesn't run the testsuite, as that could get silly.
4 $ DEB_BUILD_OPTIONS=nocheck
5 $ export DEB_BUILD_OPTIONS
2 $ OUTPUTDIR=`pwd`
6 $ OUTPUTDIR=`pwd`
3 $ export OUTPUTDIR
7 $ export OUTPUTDIR
4
8
@@ -6,8 +10,11 b''
6 $ make deb > $OUTPUTDIR/build.log 2>&1
10 $ make deb > $OUTPUTDIR/build.log 2>&1
7 $ cd $OUTPUTDIR
11 $ cd $OUTPUTDIR
8 $ ls *.deb
12 $ ls *.deb
9 mercurial-*.deb (glob)
13 mercurial-common_*.deb (glob)
10 $ dpkg --contents mercurial*.deb | grep localrepo
14 mercurial_*.deb (glob)
11 * ./usr/lib/python2.7/site-packages/mercurial/localrepo.py (glob)
15 main deb should have .so but no .py
12 * ./usr/lib/python2.7/site-packages/mercurial/localrepo.pyc (glob)
16 $ dpkg --contents mercurial_*.deb | egrep '(localrepo|parsers)'
13 $ rm -f *.deb build.log
17 * ./usr/lib/python2.7/dist-packages/mercurial/parsers*.so (glob)
18 mercurial-common should have py but no .so or pyc
19 $ dpkg --contents mercurial-common_*.deb | egrep '(localrepo|parsers)'
20 * ./usr/lib/python2.7/dist-packages/mercurial/localrepo.py (glob)
@@ -1,5 +1,8 b''
1 #require test-repo slow docker
1 #require test-repo slow docker
2
2
3 Ensure debuild doesn't run the testsuite, as that could get silly.
4 $ DEB_BUILD_OPTIONS=nocheck
5 $ export DEB_BUILD_OPTIONS
3 $ OUTPUTDIR=`pwd`
6 $ OUTPUTDIR=`pwd`
4 $ export OUTPUTDIR
7 $ export OUTPUTDIR
5
8
@@ -7,13 +10,18 b''
7 $ make docker-debian-jessie > $OUTPUTDIR/build.log 2>&1
10 $ make docker-debian-jessie > $OUTPUTDIR/build.log 2>&1
8 $ cd $OUTPUTDIR
11 $ cd $OUTPUTDIR
9 $ ls *.deb
12 $ ls *.deb
10 mercurial-*.deb (glob)
13 mercurial-common_*.deb (glob)
14 mercurial_*.deb (glob)
11
15
12 We check debian package contents with portable tools so that when
16 We check debian package contents with portable tools so that when
13 we're on non-debian machines we can still test the packages that are
17 we're on non-debian machines we can still test the packages that are
14 built using docker.
18 built using docker.
15 $ ar x mercurial*.deb
19
16 $ tar tf data.tar* | grep localrepo | sort
20 main deb should have .so but no .py
17 ./usr/lib/python2.7/site-packages/mercurial/localrepo.py
21 $ ar x mercurial_*.deb
18 ./usr/lib/python2.7/site-packages/mercurial/localrepo.pyc
22 $ tar tf data.tar* | egrep '(localrepo|parsers)'
19 $ rm -f *.deb build.log
23 ./usr/lib/python2.7/dist-packages/mercurial/parsers*.so (glob)
24 mercurial-common should have .py but no .so or .pyc
25 $ ar x mercurial-common_*.deb
26 $ tar tf data.tar* | egrep '(localrepo|parsers)'
27 ./usr/lib/python2.7/dist-packages/mercurial/localrepo.py
General Comments 0
You need to be logged in to leave comments. Login now