File: rules

package info (click to toggle)
adacontrol 1.17r3.1-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 9,232 kB
  • sloc: ada: 56,049; python: 553; sh: 246; xml: 220; makefile: 108; sed: 30
file content (104 lines) | stat: -rwxr-xr-x 3,773 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/usr/bin/make -f
# debian/rules for adacontrol.
# Copyright (c) 2006, 2012 Ludovic Brenta <lbrenta@debian.org>
# Copyright (c) 2014-2016 Nicolas Boulenguez <nicolas@debian.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# The full text of the GNU General Public License is in the file
# /usr/share/common-licenses/GPL on Debian systems.

DEB_BUILD_MAINT_OPTIONS := hardening=+all
include /usr/share/dpkg/default.mk
include /usr/share/ada/debian_packaging*.mk

ADAFLAGS += -gnatwa

BINARIES := adactl pfni ptree

POLICY_TARGETS := binary binary-arch binary-indep build build-arch \
  build-indep clean
.PHONY: $(POLICY_TARGETS)
$(POLICY_TARGETS):
	dh $@

.PHONY: $(addprefix override_dh_auto_, \
  configure build-arch build-indep test-arch test-indep install clean)

override_dh_auto_build-arch:
	gprbuild $(BUILDER_OPTIONS) src/build.gpr \
	  $(foreach v,ADAFLAGS LDFLAGS,"-X$(v)=$($(v))")
override_dh_auto_clean::
	rm -f $(addprefix src/, *.ali *.o *.adt auto.cgpr \
                $(foreach b, $(BINARIES), \
                  b~$(b).ad[bs] b__$(b).ad[bs] $(b).bexch $(b)))

override_dh_auto_build-indep: $(foreach s, pm ug, \
                              $(foreach f, html info pdf txt, \
                              doc/obj/adacontrol_$(s).$(f)))
override_dh_auto_clean::
	rm -fr doc/obj

# Faketime allows reproducible builds, see
# https://wiki.debian.org/ReproducibleBuilds/TimestampsInPDFGeneratedByLaTeX
# In addition, this source uses @today so all formats should be tricked.
# Freeze clock so that timestamps do not depend on the time spent to
# generate previous documents.
DEB_DATE_RFC_2822 := $(shell dpkg-parsechangelog -S date)
DEB_DATE_RFC_3339 := $(shell date "+%F %T" -d "$(DEB_DATE_RFC_2822)")
TEXI2ANY          := faketime -f "$(DEB_DATE_RFC_3339)" texi2any

doc/obj/%.html: doc/%.texi | doc/obj
	$(TEXI2ANY) --html --no-split $< --output=$@
doc/obj/%.info: doc/%.texi | doc/obj
	$(TEXI2ANY) --info --no-split $< --output=$@
doc/obj/%.pdf : doc/%.texi | doc/obj
	cd doc/obj && \
	$(TEXI2ANY) --pdf --no-iftex --Xopt --quiet ../$*.texi --output=$*.pdf \
	  --Xopt --command=@afourpaper
doc/obj/%.txt : doc/%.texi | doc/obj
	$(TEXI2ANY) --plaintext $< --output=$@

doc/obj:
	mkdir $@

override_dh_auto_test-arch:
	cd test && sh -Cefu run.sh
override_dh_auto_clean::
	rm -fr test/res
	rm -f $(addprefix test/,*.ali *.adt)

GNAT_VERSION := $(shell gnat --version | head -n1)
override_dh_auto_test-arch: test/ref/tfw_help.txt~
test/ref/tfw_help.txt~:
	sed -i~ \
	  '/^ADACTL .* with ASIS .* for GNAT .*/s/GNAT .*/$(GNAT_VERSION)/' \
	  test/ref/tfw_help.txt
override_dh_auto_clean::
	if test -f test/ref/tfw_help.txt~; then \
	  mv test/ref/tfw_help.txt~ test/ref/tfw_help.txt; \
	fi

.PHONY: override_dh_install
override_dh_install:
	dh_install --package=adacontrol $(addprefix src/, $(BINARIES)) usr/bin
	dh_install --package=adacontrol GPS/adacontrol.xml usr/share/gprconfig
	dh_install --package=adacontrol \
	  $(filter-out GPS/adacontrol.xml,$(wildcard GPS/*)) usr/share/gps/plug-ins
	dh_install --remaining-packages

# Adactl cannot open compressed rules.
# PDF files are already internally compressed.
.PHONY: override_dh_compress
override_dh_compress:
	dh_compress --package=adacontrol --exclude=.aru
	dh_compress --package=adacontrol-doc --exclude=.pdf
	dh_compress --remaining-packages