##// END OF EJS Templates
packaging: upgrade Debian packaging to build with Python 3...
Denis Laxalde -
r44000:7574ccd8 stable
parent child Browse files
Show More
@@ -1,54 +1,53 b''
1 Source: mercurial
1 Source: mercurial
2 Section: vcs
2 Section: vcs
3 Priority: optional
3 Priority: optional
4 Maintainer: Mercurial Developers <mercurial-devel@mercurial-scm.org>
4 Maintainer: Mercurial Developers <mercurial-devel@mercurial-scm.org>
5 Build-Depends:
5 Build-Depends:
6 debhelper (>= 9),
6 debhelper (>= 9),
7 dh-python,
7 dh-python,
8 less,
8 less,
9 netbase,
9 netbase,
10 python-all,
10 python3-all,
11 python-all-dev,
11 python3-all-dev,
12 python-docutils,
12 python3-docutils,
13 unzip,
13 unzip,
14 zip
14 zip
15 Standards-Version: 3.9.4
15 Standards-Version: 3.9.4
16 X-Python-Version: >= 2.7
16 X-Python3-Version: >= 3.5
17
17
18 Package: mercurial
18 Package: mercurial
19 Depends:
19 Depends:
20 python,
21 ${shlibs:Depends},
20 ${shlibs:Depends},
22 ${misc:Depends},
21 ${misc:Depends},
23 ${python:Depends},
22 ${python3:Depends},
24 mercurial-common (= ${source:Version})
23 mercurial-common (= ${source:Version})
25 Architecture: any
24 Architecture: any
26 Description: fast, easy to use, distributed revision control tool.
25 Description: fast, easy to use, distributed revision control tool.
27 Mercurial is a fast, lightweight Source Control Management system designed
26 Mercurial is a fast, lightweight Source Control Management system designed
28 for efficient handling of very large distributed projects.
27 for efficient handling of very large distributed projects.
29 .
28 .
30 Its features include:
29 Its features include:
31 * O(1) delta-compressed file storage and retrieval scheme
30 * O(1) delta-compressed file storage and retrieval scheme
32 * Complete cross-indexing of files and changesets for efficient exploration
31 * Complete cross-indexing of files and changesets for efficient exploration
33 of project history
32 of project history
34 * Robust SHA1-based integrity checking and append-only storage model
33 * Robust SHA1-based integrity checking and append-only storage model
35 * Decentralized development model with arbitrary merging between trees
34 * Decentralized development model with arbitrary merging between trees
36 * Easy-to-use command-line interface
35 * Easy-to-use command-line interface
37 * Integrated stand-alone web interface
36 * Integrated stand-alone web interface
38 * Small Python codebase
37 * Small Python codebase
39
38
40 Package: mercurial-common
39 Package: mercurial-common
41 Architecture: all
40 Architecture: all
42 Depends:
41 Depends:
43 ${misc:Depends},
42 ${misc:Depends},
44 ${python:Depends},
43 ${python3:Depends},
45 Recommends: mercurial (= ${source:Version}), ca-certificates
44 Recommends: mercurial (= ${source:Version}), ca-certificates
46 Suggests: wish
45 Suggests: wish
47 Breaks: mercurial (<< ${source:Version})
46 Breaks: mercurial (<< ${source:Version})
48 Replaces: mercurial (<< 2.6.3)
47 Replaces: mercurial (<< 2.6.3)
49 Description: easy-to-use, scalable distributed version control system (common files)
48 Description: easy-to-use, scalable distributed version control system (common files)
50 Mercurial is a fast, lightweight Source Control Management system designed
49 Mercurial is a fast, lightweight Source Control Management system designed
51 for efficient handling of very large distributed projects.
50 for efficient handling of very large distributed projects.
52 .
51 .
53 This package contains the architecture independent components of Mercurial,
52 This package contains the architecture independent components of Mercurial,
54 and is generally useless without the mercurial package.
53 and is generally useless without the mercurial package.
@@ -1,44 +1,47 b''
1 #!/usr/bin/make -f
1 #!/usr/bin/make -f
2 # Uncomment this to turn on verbose mode.
2 # Uncomment this to turn on verbose mode.
3 # export DH_VERBOSE=1
3 # export DH_VERBOSE=1
4
4
5 CPUS=$(shell cat /proc/cpuinfo | grep -E ^processor | wc -l)
5 CPUS=$(shell cat /proc/cpuinfo | grep -E ^processor | wc -l)
6
6
7 export HGPYTHON3=1
8 export PYTHON=python3
9
7 %:
10 %:
8 dh $@ --with python2
11 dh $@ --with python3
9
12
10 override_dh_auto_test:
13 override_dh_auto_test:
11 http_proxy='' dh_auto_test -- TESTFLAGS="-j$(CPUS)"
14 http_proxy='' dh_auto_test -- TESTFLAGS="-j$(CPUS)"
12
15
13 override_dh_python2:
16 override_dh_python3:
14 dh_python2
17 dh_python3
15 find debian/mercurial/usr/share -type d -empty -delete
18 find debian/mercurial/usr/share -type d -empty -delete
16
19
17 override_dh_install:
20 override_dh_install:
18 python$(PYVERS) setup.py install --root "$(CURDIR)"/debian/mercurial --install-layout=deb
21 python3 setup.py install --root "$(CURDIR)"/debian/mercurial --install-layout=deb
19 # chg
22 # chg
20 make -C contrib/chg \
23 make -C contrib/chg \
21 DESTDIR="$(CURDIR)"/debian/mercurial \
24 DESTDIR="$(CURDIR)"/debian/mercurial \
22 PREFIX=/usr \
25 PREFIX=/usr \
23 clean install
26 clean install
24 # remove arch-independent python stuff
27 # remove arch-independent python stuff
25 find "$(CURDIR)"/debian/mercurial/usr/lib \
28 find "$(CURDIR)"/debian/mercurial/usr/lib \
26 ! -name '*.so' ! -type d -delete , \
29 ! -name '*.so' ! -type d -delete , \
27 -type d -empty -delete
30 -type d -empty -delete
28 python$(PYVERS) setup.py install --root "$(CURDIR)/debian/mercurial-common" --install-layout=deb
31 python3 setup.py install --root "$(CURDIR)/debian/mercurial-common" --install-layout=deb
29 make install-doc PREFIX="$(CURDIR)"/debian/mercurial-common/usr
32 make install-doc PREFIX="$(CURDIR)"/debian/mercurial-common/usr
30 # remove arch-dependent python stuff
33 # remove arch-dependent python stuff
31 find "$(CURDIR)"/debian/mercurial-common/usr/lib \
34 find "$(CURDIR)"/debian/mercurial-common/usr/lib \
32 -name '*.so' ! -type d -delete , \
35 -name '*.so' ! -type d -delete , \
33 -type d -empty -delete
36 -type d -empty -delete
34 cp contrib/hg-ssh "$(CURDIR)"/debian/mercurial-common/usr/bin
37 cp contrib/hg-ssh "$(CURDIR)"/debian/mercurial-common/usr/bin
35 mkdir -p "$(CURDIR)"/debian/mercurial-common/usr/share/mercurial
38 mkdir -p "$(CURDIR)"/debian/mercurial-common/usr/share/mercurial
36 cp contrib/hgk "$(CURDIR)"/debian/mercurial-common/usr/share/mercurial
39 cp contrib/hgk "$(CURDIR)"/debian/mercurial-common/usr/share/mercurial
37 mkdir -p "$(CURDIR)"/debian/mercurial-common/etc/mercurial/hgrc.d/
40 mkdir -p "$(CURDIR)"/debian/mercurial-common/etc/mercurial/hgrc.d/
38 cp contrib/packaging/debian/*.rc "$(CURDIR)"/debian/mercurial-common/etc/mercurial/hgrc.d/
41 cp contrib/packaging/debian/*.rc "$(CURDIR)"/debian/mercurial-common/etc/mercurial/hgrc.d/
39 # completions
42 # completions
40 mkdir -p "$(CURDIR)"/debian/mercurial-common/usr/share/bash-completion/completions
43 mkdir -p "$(CURDIR)"/debian/mercurial-common/usr/share/bash-completion/completions
41 cp contrib/bash_completion "$(CURDIR)"/debian/mercurial-common/usr/share/bash-completion/completions/hg
44 cp contrib/bash_completion "$(CURDIR)"/debian/mercurial-common/usr/share/bash-completion/completions/hg
42 mkdir -p "$(CURDIR)"/debian/mercurial-common/usr/share/zsh/vendor-completions
45 mkdir -p "$(CURDIR)"/debian/mercurial-common/usr/share/zsh/vendor-completions
43 cp contrib/zsh_completion "$(CURDIR)"/debian/mercurial-common/usr/share/zsh/vendor-completions/_hg
46 cp contrib/zsh_completion "$(CURDIR)"/debian/mercurial-common/usr/share/zsh/vendor-completions/_hg
44 rm "$(CURDIR)"/debian/mercurial-common/usr/bin/hg
47 rm "$(CURDIR)"/debian/mercurial-common/usr/bin/hg
@@ -1,32 +1,32 b''
1 #require test-repo slow debhelper debdeps
1 #require test-repo slow debhelper debdeps
2
2
3 $ . "$TESTDIR/helpers-testrepo.sh"
3 $ . "$TESTDIR/helpers-testrepo.sh"
4 $ testrepohgenv
4 $ testrepohgenv
5
5
6 Ensure debuild doesn't run the testsuite, as that could get silly.
6 Ensure debuild doesn't run the testsuite, as that could get silly.
7 $ DEB_BUILD_OPTIONS=nocheck
7 $ DEB_BUILD_OPTIONS=nocheck
8 $ export DEB_BUILD_OPTIONS
8 $ export DEB_BUILD_OPTIONS
9 $ OUTPUTDIR=`pwd`
9 $ OUTPUTDIR=`pwd`
10 $ export OUTPUTDIR
10 $ export OUTPUTDIR
11
11
12 $ cd "$TESTDIR"/..
12 $ cd "$TESTDIR"/..
13 $ make deb > $OUTPUTDIR/build.log 2>&1
13 $ make deb > $OUTPUTDIR/build.log 2>&1
14 $ cd $OUTPUTDIR
14 $ cd $OUTPUTDIR
15 $ ls *.deb | grep -v 'dbg'
15 $ ls *.deb | grep -v 'dbg'
16 mercurial-common_*.deb (glob)
16 mercurial-common_*.deb (glob)
17 mercurial_*.deb (glob)
17 mercurial_*.deb (glob)
18 main deb should have .so but no .py
18 main deb should have .so but no .py
19 $ dpkg --contents mercurial_*.deb | egrep '(localrepo|parsers)'
19 $ dpkg --contents mercurial_*.deb | egrep '(localrepo|parsers)'
20 * ./usr/lib/python2.7/dist-packages/mercurial/cext/parsers*.so (glob)
20 * ./usr/lib/python3/dist-packages/mercurial/cext/parsers*.so (glob)
21 mercurial-common should have py but no .so or pyc
21 mercurial-common should have py but no .so or pyc
22 $ dpkg --contents mercurial-common_*.deb | egrep '(localrepo|parsers.*so)'
22 $ dpkg --contents mercurial-common_*.deb | egrep '(localrepo|parsers.*so)'
23 * ./usr/lib/python2.7/dist-packages/mercurial/localrepo.py (glob)
23 * ./usr/lib/python3/dist-packages/mercurial/localrepo.py (glob)
24 zsh completions should be in the common package
24 zsh completions should be in the common package
25 $ dpkg --contents mercurial-common_*.deb | egrep 'zsh.*[^/]$'
25 $ dpkg --contents mercurial-common_*.deb | egrep 'zsh.*[^/]$'
26 * ./usr/share/zsh/vendor-completions/_hg (glob)
26 * ./usr/share/zsh/vendor-completions/_hg (glob)
27 chg should be installed alongside hg, in the 'mercurial' package
27 chg should be installed alongside hg, in the 'mercurial' package
28 $ dpkg --contents mercurial_*.deb | egrep 'chg$'
28 $ dpkg --contents mercurial_*.deb | egrep 'chg$'
29 * ./usr/bin/chg (glob)
29 * ./usr/bin/chg (glob)
30 chg should come with a man page
30 chg should come with a man page
31 $ dpkg --contents mercurial_*.deb | egrep 'man.*chg'
31 $ dpkg --contents mercurial_*.deb | egrep 'man.*chg'
32 * ./usr/share/man/man1/chg.1.gz (glob)
32 * ./usr/share/man/man1/chg.1.gz (glob)
General Comments 0
You need to be logged in to leave comments. Login now