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
|
#!/usr/bin/make -f
# Build script for XML/Ada in Debian.
# Copyright (c) 2003-2009 Ludovic Brenta <lbrenta@debian.org>
# Copyright (c) 2013-2014 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.
include /usr/share/dpkg/default.mk
include /usr/share/ada/debian_packaging.mk
ADAFLAGS += -gnatafno -gnatVa
######################################################################
POLICY_TARGETS := binary binary-arch binary-indep build build-arch \
build-indep clean
.PHONY: $(POLICY_TARGETS)
$(POLICY_TARGETS):
dh $@ --with ada-library
AUTOCONF_AUXILIARY_FILES := \
config.guess \
config.sub \
configure \
install-sh
override_dh_auto_configure: configure-stamp
configure-stamp: $(addsuffix .backup,$(AUTOCONF_AUXILIARY_FILES))
dh_auto_configure
touch $@
# Up-to-date config.[guess|sub] are provided by autotools-dev.
config.guess.backup config.sub.backup: %.backup:
mv $* $@
ln -s /usr/share/misc/$*
# configure: generated by autoconf.
configure.backup: %.backup:
mv $* $@
autoconf
# install-sh: unused, but configure insists on seeing it.
install-sh.backup: %.backup:
mv $* $@
touch $*
override_dh_auto_build-arch:
gnatmake $(BUILDER_OPTIONS) -Pdebian/build_xmlada -Xkind=static \
$(foreach f,ADAFLAGS,"-X$(f)=$($(f))")
gnatmake $(BUILDER_OPTIONS) -Pdebian/build_xmlada -Xkind=dynamic \
$(foreach f,ADAFLAGS LDFLAGS,"-X$(f)=$($(f))")
override_dh_auto_build-indep:
$(MAKE) -C docs html latexpdf text SPHINXOPTS=-j$(BUILDER_JOBS)
override_dh_auto_test:
override_dh_auto_install:
# Configure, so that we can assume *.backup and Makefiles exist.
override_dh_auto_clean: configure-stamp
rm -f $(foreach d, lib obj, \
$(foreach k, dynamic static, \
debian/build_$(d)_$(k)/*))
dh_auto_clean
for f in $(AUTOCONF_AUXILIARY_FILES); do \
mv $$f.backup $$f; \
done
######################################################################
# Policy specifies that get-orig-source may be run outside the source
# tree, so we rely on a temporary directory and hard-code the version.
orig_version := 4.4.2014
orig_archive := libxmlada_$(orig_version).orig.tar.xz
orig_tmp_dir := /tmp/libxmlada_get_orig_source_tmp_dir
# Set this to your own database on the command line if you already
# have a local clone of the upstream branch.
# By default, a temporary database is populated.
orig_mtn_db := $(orig_tmp_dir)/tmpdb
orig_server := www.ada-france.org
orig_server_key := f8a11727e8983cf9083c08c6a2acaa27e439dd39
orig_branch := com.adacore.xmlada.debian
orig_revision := t:libxmlada-$(orig_version)
orig_directory := libxmlada-$(orig_version).orig
get-orig-source:
test ! -e $(orig_archive) # Stop if the archive exists.
mkdir $(orig_tmp_dir) # Stop if the temp dir exists.
@echo
@echo The server key below should be $(orig_server_key).
@echo
mtn clone --db=$(orig_mtn_db) mtn://$(orig_server)?$(orig_branch) \
--branch=$(orig_branch) --revision=$(orig_revision) \
$(orig_tmp_dir)/$(orig_directory)
tar -c -J -f $(orig_archive) -C $(orig_tmp_dir) $(orig_directory) \
--exclude=_MTN --exclude=.mtn-ignore
rm -f -r $(orig_tmp_dir)
@echo
@echo Created $(orig_archive) in the current directory.
######################################################################
override_dh_compress:
dh_compress --package=libxmlada-doc \
--exclude=.adb --exclude=.ads --exclude=.gpr \
--exclude=.xml --exclude=.xsd
dh_compress --remaining-packages
|