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
|
#!/usr/bin/make -f
$(foreach line,$(shell sed -n '\
s/^ gnat, gnat-\([0-9.]\+\),$$/ \
GNAT_VERSION:=\1 \
/p;\
s/^Package: lib[a-z-]\+\([0-9.]\+\)$$/ \
SOVERSION:=\1 \
/p;\
' debian/control),$(eval $(line)))
DEB_BUILD_MAINT_OPTIONS := hardening=+all
include /usr/share/dpkg/default.mk
include /usr/share/ada/debian_packaging-$(GNAT_VERSION).mk
%:
dh $@ --with ada-library
.PHONY: override_dh_autoreconf
override_dh_autoreconf:
# No -f option for autoconf-dickey, force update by deleting configure.
rm -f configure
dh_autoreconf autoconf-dickey
.PHONY: $(addprefix override_dh_auto_, \
configure-arch configure-indep build-arch build-indep install clean)
override_dh_auto_configure-arch:
# tests: samples/* will be installed into the -doc package, and used
# by autopkgtest, but there is no point in compiling them now.
# Debhelper compatibility level 10 does not set --runstatedir,
# see https://bugs.debian.org/887390.
DH_COMPAT=10 \
dh_auto_configure -a -- \
$(foreach v,ADAFLAGS CC CFLAGS CPPFLAGS LDFLAGS,"$(v)=$($(v))") \
--without-tests \
--with-shared --with-ada-sharedlib=libncursesada.so.$(SOVERSION)
# with-ada-compiler="gprbuild $(BUILDER_OPTIONS)" actually has no effect.
build_dirs := \
debian/build-lib-dynamic \
debian/build-obj-dynamic \
debian/build-lib-static \
debian/build-obj-static
$(build_dirs):
mkdir $@
override_dh_auto_clean:
rm -fr $(build_dirs)
dh_auto_clean
NCURSES_MODULES := form menu panel ncurses
NCURSES_CFLAGS := `pkg-config --cflags $(NCURSES_MODULES)`
LDLIBS := `pkg-config --libs $(NCURSES_MODULES)`
PROJECT := debian/ncursesada.gpr
GPR_VARS := ADAFLAGS CFLAGS CPPFLAGS LDFLAGS NCURSES_CFLAGS LDLIBS SOVERSION
override_dh_auto_build-arch: | $(build_dirs)
dh_auto_build -a -- -C include ncurses_def.h
dh_auto_build -a -- -C gen
# The src/ build system ignores CFLAGS when building two versions of
# the library. We only call it to generate a needed file.
# TODO: the NEWS changelog seems to tell that this has been fixed.
# Is it possible to pass ADAFLAGS?
dh_auto_build -a -- -C src terminal_interface-curses-trace.adb
gprbuild $(PROJECT) $(BUILDER_OPTIONS) -XKIND=static \
$(foreach v,$(GPR_VARS),"-X$(v)=$($(v))")
gprbuild $(PROJECT) $(BUILDER_OPTIONS) -XKIND=dynamic \
$(foreach v,$(GPR_VARS),"-X$(v)=$($(v))")
######################################################################
.PHONY: override_dh_ada_library-arch override_dh_ada_library-indep
override_dh_ada_library-arch:
dh_ada_library KIND=dynamic \
$(foreach v,$(GPR_VARS),"$(v)=$($(v))") $(PROJECT)
# doc/ provides a -config script giving build flags for
# reverse dependencies. We ignore it as per Debian Ada Policy
# we prefer project files. It also contains HTML pages
# generated from the sources (make -C gen html). We do not
# regenerate them either because we do not want to install
# arch-dependant files into the -doc package. The
# arch-specific parts are identified in the comments anyway.
######################################################################
.PHONY: override_dh_installchangelogs
override_dh_installchangelogs:
dh_installchangelogs --all NEWS
# samples/explain.txt is read by samples/sample-explanation.adb.
.PHONY: override_dh_compress
override_dh_compress:
dh_compress --all \
--exclude=.ads \
--exclude=.adb \
--exclude=explain.txt
|