Remove unused “INSTALL” constant.
[debian_xkcdpass.git] / debian / rules
blob697626532f512fd59340c5b283d7fa011f2ef12e
1 #! /usr/bin/make -f
3 # debian/rules
4 # Part of Debian ‘xkcdpass’ package.
6 # Copyright © 2010–2015 Ben Finney <ben+debian@benfinney.id.au>
7 # This is free software; you may copy, modify and/or distribute this work
8 # under the terms of the BSD 3-clause license.
9 # No warranty expressed or implied.
10 # See the file ‘xkcdpass/xkcd_password.py’ for details.
12 DOCUMENTATION_DIR = debian
13 MANPAGE_SUFFIX = .1
14 TEMPFILE_SUFFIX = .tmp
15 manpage_names = xkcdpass
16 .INTERMEDIATE: ${DOCUMENTATION_DIR}/*${MANPAGE_SUFFIX}${TEMPFILE_SUFFIX}
18 manpage_paths = $(addprefix ${DOCUMENTATION_DIR}/,${manpage_names})
19 manpages = $(addsuffix ${MANPAGE_SUFFIX},${manpage_paths})
20 GENERATED_FILES += ${DOCUMENTATION_DIR}/*${MANPAGE_SUFFIX}
22 # Send HTTP traffic to the “discard” service during packaging actions.
23 export http_proxy = http://127.0.1.1:9/
24 export https_proxy = ${http_proxy}
26 RST_SUFFIX = .txt
28 RST2MAN = rst2man
31 .PHONY: build
32 build: build-arch build-indep
33 build: ${manpages}
34 dh $@ --with python3 --buildsystem=pybuild
36 .PHONY: build-arch
37 build-arch:
38 dh $@ --with python3 --buildsystem=pybuild
40 .PHONY: build-indep
41 build-indep:
42 dh $@ --with python3 --buildsystem=pybuild
45 %.1: %.1${RST_SUFFIX}
46 $(RST2MAN) $< > $@${TEMPFILE_SUFFIX}
47 cat debian/manpage_encoding_declaration.UTF-8 $@${TEMPFILE_SUFFIX} > $@
50 .PHONY: clean
51 clean:
52 dh $@ --with python3 --buildsystem=pybuild
54 .PHONY: override_dh_auto_clean
55 override_dh_auto_clean:
56 dh_auto_clean
57 $(RM) -r ${GENERATED_FILES}
60 .PHONY: get-packaged-orig-source
61 get-packaged-orig-source:
62 $(uscan-download-source) --download-current-version
64 # Policy §4.9 strongly recommends the ‘get-orig-source’ target:
65 # “This target is optional, but providing it if possible is a good idea.”
67 # This target is an anomaly: per Policy §4.9, it fetches the *latest*
68 # upstream source, regardless of this package's version. To fetch the
69 # upstream source corresponding to this package's *declared* version
70 # in ‘debian/changelog’, use ‘get-packaged-orig-source’ instead.
71 .PHONY: get-orig-source
72 get-orig-source:
73 $(uscan-download-source)
75 get-orig-source get-packaged-orig-source: http_proxy =
76 get-orig-source get-packaged-orig-source: makefile_dir = $(abspath $(dir $(firstword ${MAKEFILE_LIST})))
77 get-orig-source get-packaged-orig-source: package_dir = $(abspath $(dir ${makefile_dir}))
79 define uscan-download-source
80 uscan --noconf --verbose \
81 --force-download \
82 --rename \
83 --destdir=$(CURDIR) \
84 --check-dirname-level=0 ${package_dir}
85 endef # uscan-download-source
88 .PHONY: install
89 install: build
90 dh $@ --with python3 --buildsystem=pybuild
93 .PHONY: binary-indep
94 binary-indep: build install
95 dh $@ --with python3 --buildsystem=pybuild
97 .PHONY: binary-arch
98 binary-arch: build install
100 .PHONY: binary
101 binary: build binary-indep binary-arch
104 # Local variables:
105 # mode: makefile
106 # coding: utf-8
107 # End:
108 # vim: filetype=make fileencoding=utf-8 :