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
|
#!/usr/bin/make -f
# Build script for Templates_Parser in Debian.
# Copyright (c) 2003-2008 Ludovic Brenta <lbrenta@debian.org>
# Copyright (c) 2013-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, see <http://www.gnu.org/licenses/>.
# 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
# gnat-4.9 provides /usr/share/ada/debian_packaging.mk
# gnat-5 provides /usr/share/ada/debian_packaging-5.mk
include /usr/share/ada/debian_packaging*.mk
SOVERSION := $(shell sed --quiet -r 's/^Package: $(DEB_SOURCE)([0-9.]+)$$/\1/p' debian/control)
# Some of these options are stored into makefile.setup, but not all.
MAKE_OPTS := \
VERSION=$(SOVERSION) \
HOST=$(DEB_HOST_GNU_TYPE) \
TARGET=$(DEB_TARGET_GNU_TYPE) \
prefix=/usr \
DEFAULT_LIBRARY_TYPE=relocatable \
ENABLE_SHARED=true \
TP_XMLADA=Installed \
GPRBUILD="gprbuild $(BUILDER_OPTIONS) $(foreach v,ADAFLAGS LDFLAGS,'-X$(v)=$($(v))')" \
DOC_FORMATS="html info latexpdf text"
######################################################################
POLICY_TARGETS := binary binary-arch binary-indep build build-arch \
build-indep clean
.PHONY: $(POLICY_TARGETS)
$(POLICY_TARGETS):
dh $@ --with ada-library
# Avoid DebHelper default calls to usual Make targets.
.PHONY: $(addprefix override_dh_auto_, \
configure build-arch build-indep test install clean)
override_dh_auto_build-arch:
$(MAKE) $(MAKE_OPTS)
override_dh_auto_build-indep:
$(MAKE) build-doc $(MAKE_OPTS) SPHINXOPTS=-j$(BUILDER_JOBS)
override_dh_auto_clean::
# Avoid complaining about non existing dirs.
mkdir -p .build/bin .build/lib .build/obj .build/tobj
$(MAKE) setup clean $(MAKE_OPTS)
######################################################################
.PHONY: override_dh_ada_library-indep
.PHONY: override_dh_ada_library-arch
override_dh_ada_library-arch:
# There is no --subdirs option for dh_ada_library.
mv .build/lib/*/release/relocatable/* .build/lib
mv .build/obj/*/release/relocatable/* .build/obj
# NOTE:
# xmlada_*.gpr are not imported directly by upstream build project, so
# - ada:Depends for the -dev package will not contain libxmlada*-dev.
# - the generated project will not contain with "xmlada_*.gpr".
# This is OK as long as XMLAda is only used in bodies and not in specs.
dh_ada_library \
PRJ_BUILD=Release TP_XMLADA=Installed LIBRARY_TYPE=relocatable \
templates_parser.gpr
# 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=libtemplates-parser-doc --exclude=examples/templates.tads
dh_compress --remaining-packages
|