Make distinct rules for getting upstream source.
[debian_lojban-common.git] / debian / rules
blobcdfcb64d942286b89d68cea74a631f8eb2f3ff2d
1 #! /usr/bin/make -f
3 # debian/rules
4 # Part of Debian ‘lojban-common’ package.
6 # Copyright © 2005–2016 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 GNU General Public License, version 3 or later.
9 # No warranty expressed or implied.
10 # See the file ‘/usr/share/common-licenses/GPL-3’ for details.
12 # Packaging variables.
13 PACKAGE_NAME = lojban-common
14 SHA1SUMS_FILE = debian/upstream.sha1sums
17 .PHONY: build
18 build: build-arch build-indep
19 dh $@
21 .PHONY: build-arch
22 build-arch:
23 dh $@
25 .PHONY: build-indep
26 build-indep:
27 dh $@
30 .PHONY: get-packaged-orig-source
31 get-packaged-orig-source:
32 $(uscan-download-source) --download-current-version
34 # Policy §4.9 strongly recommends the ‘get-orig-source’ target:
35 # “This target is optional, but providing it if possible is a good idea.”
37 # This target is an anomaly: per Policy §4.9, it fetches the *latest*
38 # upstream source, regardless of this package's version. To fetch the
39 # upstream source corresponding to this package's *declared* version
40 # in ‘debian/changelog’, use ‘get-packaged-orig-source’ instead.
41 .PHONY: get-orig-source
42 get-orig-source:
43 $(uscan-download-source)
45 get-orig-source get-packaged-orig-source: http_proxy =
46 get-orig-source get-packaged-orig-source: makefile_dir = $(abspath $(dir $(firstword ${MAKEFILE_LIST})))
47 get-orig-source get-packaged-orig-source: package_dir = $(abspath $(dir ${makefile_dir}))
49 define uscan-download-source
50 uscan --noconf --verbose \
51 --force-download \
52 --rename \
53 --destdir=$(CURDIR) \
54 --check-dirname-level=0 ${package_dir}
55 endef # uscan-download-source
58 .PHONY: clean
59 clean:
60 dh $@
62 .PHONY: install
63 install: build
64 cut -d ' ' -f 3 ${SHA1SUMS_FILE} \
65 | sed -e 's_$$_\tusr/share/lojban_' \
66 > debian/${PACKAGE_NAME}.install
67 dh $@
69 .PHONY: binary-indep
70 binary-indep: build install
71 dh $@
73 .PHONY: binary-arch
74 binary-arch:
75 dh $@
77 .PHONY: binary
78 binary: binary-indep binary-arch
81 # Local variables:
82 # coding: utf-8
83 # mode: makefile
84 # End:
85 # vim: fileencoding=utf-8 filetype=make :