File: rules

package info (click to toggle)
libgnatcoll 1.7gpl2015-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 17,280 kB
  • ctags: 1,124
  • sloc: ada: 134,072; python: 4,017; cpp: 1,397; ansic: 1,234; makefile: 368; sh: 152; xml: 31; sql: 6
file content (133 lines) | stat: -rwxr-xr-x 4,685 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/usr/bin/make -f
# Build script for GNATColl in Debian.
# Copyright (c) 2014-2016 Nicolas Boulenguez <nicolas@debian.org>

# This build script 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 3 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.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
# USA

# On Debian systems, the full text of the GPL is in the file
# /usr/share/common-licenses/GPL-3.

DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie
# PIE should only affect the static library.
include /usr/share/dpkg/default.mk
include /usr/share/ada/debian_packaging*.mk

DEB_DATE := $(shell dpkg-parsechangelog -S date)

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

configure-stamp: config.guess config.sub configure install-sh
# Build-Depends: autotools-dev
config.guess config.sub:
	ln -s /usr/share/misc/$@
# Build-Depends: autoconf
configure: configure.in.bak
	autoconf
# Unused, but configure insists on seeing it.
install-sh:
	touch install-sh
# Patch version number for documentation.
configure.in.bak:
	mv configure.in $@
	sed '2s/,[^,]*/,$(DEB_VERSION_UPSTREAM)/' $@ > configure.in
override_dh_auto_clean::
	rm -f config.guess config.sub configure install-sh
	if test -f configure.in.bak; then \
	  mv -f configure.in.bak configure.in; \
	fi

configure-stamp:
	dh_auto_configure -- --enable-gpl --enable-shared \
	  $(foreach v,ADAFLAGS CC CFLAGS CPPFLAGS LDFLAGS,"$(v)=$($(v))") \
	  --without-postgresql \
	  --with-sqlite=/usr/include/$(DEB_HOST_MULTIARCH)
	touch $@

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

override_dh_auto_configure: configure-stamp

override_dh_auto_configure: auto.cgpr
auto.cgpr:
	gprconfig --config=Ada --config=C,,,,gnatgcc
override_dh_auto_clean::
	rm -f auto.cgpr

# patches/inherit_library_versions.diff
# This sed script constructs a -X option for every library package.
BUILDER_OPTIONS += $(shell sed debian/control -ne ' \
  /^Package: lib\([a-z-]\+\)\([0-9.]\+\(gpl[0-9]\{4\}\)\?\)$$/ { \
    s//\U\1\E_VERSION=\2/; \
    y/-/_/; \
    s/^/-X/; \
    p}')
override_dh_auto_build-arch:
 # Ensure deterministic timestamps in ALI files.
	find . -depth \( -name "*.ad[bs]" -o -name "*.[hc]" \) \
	  -a -newermt '$(DEB_DATE)' -print0 | \
	  xargs -0r touch --no-dereference --date='$(DEB_DATE)'
	$(MAKE) 'GPRBUILD_OPTIONS=$(BUILDER_OPTIONS)' \
	  build_library_type/static \
	  build_library_type/relocatable \
	  build_tools/relocatable

# Upstream docs target does not generate text output.

# Freeze the clock for deterministic PDF timestamps. The faketime API
# does not allow an explicit time zone, introducing an implicit
# dependency on its local value.
DEB_DATE_FAKETIME := $(shell date "+%F %T" -d "$(DEB_DATE)")
override_dh_auto_build-indep:
# Freeze the clock for deterministic PDF timestamps.
	faketime -f "$(DEB_DATE_FAKETIME)" \
	$(MAKE) -C docs html latexpdf text SPHINXOPTS=-j$(BUILDER_JOBS)

# Default dh_auto_clean would test -f Makefile.
override_dh_auto_clean::
	if test -f Makefile.conf; then dh_auto_clean -- GPRCLEAN_OPTIONS=; fi

.PHONY: override_dh_clean
override_dh_clean:
	dh_clean --exclude=testsuite/xref/F516-004/default.gpr.orig

# Check dependencies across -dev packages (or generated projects)
# after any change in the structure of upstream projects.
.PHONY: override_dh_ada_library-arch override_dh_ada_library-indep
override_dh_ada_library-arch:
	dh_ada_library --arch $(shell sed debian/control -ne ' \
          /^Package: lib\([a-z-]\+\)[0-9.]\+\(gpl[0-9]\{4\}\)\?-dev$$/ { \
            s~~src/\1.gpr~; \
            y/-/_/; \
            p}')

# Mimic 'dh --with sphinxdoc', but without adding sphinx-common to
# Build-Depends for arch-only builds.
.PHONY: override_dh_installdocs-indep
override_dh_installdocs-indep:
	dh_installdocs -i
	dh_sphinxdoc

.PHONY: override_dh_compress
override_dh_compress:
	dh_compress --package=libgnatcoll-doc --exclude=.adb --exclude=.ads
	dh_compress --remaining-packages