Debian Codegraph @

debian/rules

raw
1 #! /usr/bin/make -f
2 #
3 # makefile rules for the Debian package lacheck
4 #
5 # Copyright (C) 1997-2017 Davide G. M. Salvetti.
6 #
7 # This program is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by the Free
9 # Software Foundation; either version 3 of the License, or (at your option)
10 # any later version.
11 #
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 # for more details.
16 #
17 # You should have received a copy of the GNU General Public License along
18 # with this program. If not, see <http://www.gnu.org/licenses/>.
19 #
20 # On Debian GNU/Linux System you can find a copy of the GNU General Public
21 # License in "/usr/share/common-licenses/GPL".
22
23 SHELL := /bin/bash
24 SBUILD := sbuild --verbose
25
26 EPERL_SRC := $(wildcard debian/*.eperl)
27 EPERL_OBJ := $(EPERL_SRC:%.eperl=%)
28
29 debian/clean: $(EPERL_OBJ)
30 echo $(filter-out debian/copyright debian/rules, $(EPERL_OBJ)) \
31 debian/clean > debian/clean
32
33 %:: %.eperl
34 eperl -P -o $@ $<
35
36 .PHONY: build
37 build: debian/clean
38 dh $@ --exclude .eperl
39
40 %:
41 dh $@ --exclude .eperl
42
43 .PHONY: override_dh_auto_build
44 override_dh_auto_build:
45 $(MAKE) $(shell dpkg-buildflags --export=cmdline) prefix=/usr \
46 lacheck lacheck.1
47
48 .PHONY: override_dh_auto_install
49 override_dh_auto_install:
50 dh_auto_install -- prefix=/usr mandir=/usr/share/man/man1
51
52 .PHONY: snapshot
53 snapshot: OBJ := --arch-any
54 snapshot: DIST := unstable
55 snapshot: BRANCH := $(shell git branch | perl -ne 'print if s/^\* //')
56 snapshot: clean
57 gbp dch --debian-branch=$(BRANCH) --snapshot --auto --commit
58 gbp buildpackage --keyid='' \
59 --git-builder='$(SBUILD) $(OBJ) --dist=$(DIST)' \
60 --git-debian-branch=$(BRANCH)
61
62 .PHONY: release
63 release: OBJ := --arch-all --arch-any --source --source-only-changes
64 release: DIST := unstable
65 release: clean
66 git checkout master
67 gbp pq rebase
68 gbp pq export
69 gbp dch --release --commit
70 gbp buildpackage \
71 --git-builder='$(SBUILD) $(OBJ) --dist=$(DIST)' \
72 --git-tag
73
74 .PHONY: upload
75 upload: V := $(shell dpkg-parsechangelog --show-field Version)
76 upload:
77 dput ../lacheck_$(V)_source.changes