Mercurial > hg
annotate contrib/packaging/debian/rules @ 43318:cdf6db1f4faf stable
packaging: distinguish clean and build steps from install in Debian
author | Denis Laxalde <denis.laxalde@logilab.fr> |
---|---|
date | Wed, 23 Oct 2019 16:35:27 +0200 |
parents | a882c088dc2e |
children | 11c85873e106 |
rev | line source |
---|---|
26148
7f49efcaa9b4
debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
1 #!/usr/bin/make -f |
7f49efcaa9b4
debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
2 # Uncomment this to turn on verbose mode. |
7f49efcaa9b4
debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
3 # export DH_VERBOSE=1 |
7f49efcaa9b4
debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
4 |
7f49efcaa9b4
debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
5 CPUS=$(shell cat /proc/cpuinfo | grep -E ^processor | wc -l) |
7f49efcaa9b4
debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
6 |
43310
7574ccd87200
packaging: upgrade Debian packaging to build with Python 3
Denis Laxalde <denis@laxalde.org>
parents:
38009
diff
changeset
|
7 export HGPYTHON3=1 |
7574ccd87200
packaging: upgrade Debian packaging to build with Python 3
Denis Laxalde <denis@laxalde.org>
parents:
38009
diff
changeset
|
8 export PYTHON=python3 |
7574ccd87200
packaging: upgrade Debian packaging to build with Python 3
Denis Laxalde <denis@laxalde.org>
parents:
38009
diff
changeset
|
9 |
26148
7f49efcaa9b4
debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
10 %: |
43310
7574ccd87200
packaging: upgrade Debian packaging to build with Python 3
Denis Laxalde <denis@laxalde.org>
parents:
38009
diff
changeset
|
11 dh $@ --with python3 |
26148
7f49efcaa9b4
debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
12 |
7f49efcaa9b4
debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
13 override_dh_auto_test: |
7f49efcaa9b4
debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
14 http_proxy='' dh_auto_test -- TESTFLAGS="-j$(CPUS)" |
7f49efcaa9b4
debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
15 |
43310
7574ccd87200
packaging: upgrade Debian packaging to build with Python 3
Denis Laxalde <denis@laxalde.org>
parents:
38009
diff
changeset
|
16 override_dh_python3: |
43313
a882c088dc2e
packaging: use /usr/bin/python3 shebang for scripts in Debian
Denis Laxalde <denis@laxalde.org>
parents:
43310
diff
changeset
|
17 dh_python3 --shebang=/usr/bin/python3 |
26148
7f49efcaa9b4
debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
18 find debian/mercurial/usr/share -type d -empty -delete |
7f49efcaa9b4
debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
19 |
43318
cdf6db1f4faf
packaging: distinguish clean and build steps from install in Debian
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
43313
diff
changeset
|
20 override_dh_auto_clean: |
cdf6db1f4faf
packaging: distinguish clean and build steps from install in Debian
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
43313
diff
changeset
|
21 $(MAKE) cleanbutpackages |
cdf6db1f4faf
packaging: distinguish clean and build steps from install in Debian
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
43313
diff
changeset
|
22 $(MAKE) -C contrib/chg clean |
cdf6db1f4faf
packaging: distinguish clean and build steps from install in Debian
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
43313
diff
changeset
|
23 |
cdf6db1f4faf
packaging: distinguish clean and build steps from install in Debian
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
43313
diff
changeset
|
24 override_dh_auto_build: |
cdf6db1f4faf
packaging: distinguish clean and build steps from install in Debian
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
43313
diff
changeset
|
25 $(MAKE) all |
cdf6db1f4faf
packaging: distinguish clean and build steps from install in Debian
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
43313
diff
changeset
|
26 $(MAKE) -C contrib/chg all |
cdf6db1f4faf
packaging: distinguish clean and build steps from install in Debian
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
43313
diff
changeset
|
27 |
26148
7f49efcaa9b4
debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
28 override_dh_install: |
43310
7574ccd87200
packaging: upgrade Debian packaging to build with Python 3
Denis Laxalde <denis@laxalde.org>
parents:
38009
diff
changeset
|
29 python3 setup.py install --root "$(CURDIR)"/debian/mercurial --install-layout=deb |
34406
0133ca39c688
deb: build and install chg
Kyle Lippincott <spectral@google.com>
parents:
34405
diff
changeset
|
30 # chg |
0133ca39c688
deb: build and install chg
Kyle Lippincott <spectral@google.com>
parents:
34405
diff
changeset
|
31 make -C contrib/chg \ |
34625
f1c2552c2de7
build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents:
34406
diff
changeset
|
32 DESTDIR="$(CURDIR)"/debian/mercurial \ |
34406
0133ca39c688
deb: build and install chg
Kyle Lippincott <spectral@google.com>
parents:
34405
diff
changeset
|
33 PREFIX=/usr \ |
43318
cdf6db1f4faf
packaging: distinguish clean and build steps from install in Debian
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
43313
diff
changeset
|
34 install |
26148
7f49efcaa9b4
debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
35 # remove arch-independent python stuff |
34625
f1c2552c2de7
build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents:
34406
diff
changeset
|
36 find "$(CURDIR)"/debian/mercurial/usr/lib \ |
26148
7f49efcaa9b4
debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
37 ! -name '*.so' ! -type d -delete , \ |
7f49efcaa9b4
debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
38 -type d -empty -delete |
43310
7574ccd87200
packaging: upgrade Debian packaging to build with Python 3
Denis Laxalde <denis@laxalde.org>
parents:
38009
diff
changeset
|
39 python3 setup.py install --root "$(CURDIR)/debian/mercurial-common" --install-layout=deb |
34625
f1c2552c2de7
build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents:
34406
diff
changeset
|
40 make install-doc PREFIX="$(CURDIR)"/debian/mercurial-common/usr |
26148
7f49efcaa9b4
debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
41 # remove arch-dependent python stuff |
34625
f1c2552c2de7
build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents:
34406
diff
changeset
|
42 find "$(CURDIR)"/debian/mercurial-common/usr/lib \ |
26148
7f49efcaa9b4
debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
43 -name '*.so' ! -type d -delete , \ |
7f49efcaa9b4
debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
44 -type d -empty -delete |
34625
f1c2552c2de7
build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents:
34406
diff
changeset
|
45 cp contrib/hg-ssh "$(CURDIR)"/debian/mercurial-common/usr/bin |
f1c2552c2de7
build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents:
34406
diff
changeset
|
46 mkdir -p "$(CURDIR)"/debian/mercurial-common/usr/share/mercurial |
f1c2552c2de7
build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents:
34406
diff
changeset
|
47 cp contrib/hgk "$(CURDIR)"/debian/mercurial-common/usr/share/mercurial |
f1c2552c2de7
build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents:
34406
diff
changeset
|
48 mkdir -p "$(CURDIR)"/debian/mercurial-common/etc/mercurial/hgrc.d/ |
38009
e51c91c14a07
packaging: move contrib/debian to contrib/packaging/
Gregory Szorc <gregory.szorc@gmail.com>
parents:
34625
diff
changeset
|
49 cp contrib/packaging/debian/*.rc "$(CURDIR)"/debian/mercurial-common/etc/mercurial/hgrc.d/ |
34406
0133ca39c688
deb: build and install chg
Kyle Lippincott <spectral@google.com>
parents:
34405
diff
changeset
|
50 # completions |
34625
f1c2552c2de7
build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents:
34406
diff
changeset
|
51 mkdir -p "$(CURDIR)"/debian/mercurial-common/usr/share/bash-completion/completions |
f1c2552c2de7
build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents:
34406
diff
changeset
|
52 cp contrib/bash_completion "$(CURDIR)"/debian/mercurial-common/usr/share/bash-completion/completions/hg |
f1c2552c2de7
build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents:
34406
diff
changeset
|
53 mkdir -p "$(CURDIR)"/debian/mercurial-common/usr/share/zsh/vendor-completions |
f1c2552c2de7
build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents:
34406
diff
changeset
|
54 cp contrib/zsh_completion "$(CURDIR)"/debian/mercurial-common/usr/share/zsh/vendor-completions/_hg |
f1c2552c2de7
build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents:
34406
diff
changeset
|
55 rm "$(CURDIR)"/debian/mercurial-common/usr/bin/hg |