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
|
#!/usr/bin/make -f
# Enable compiler hardening flags.
export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow,+pie
# Force linking with -lpthread, working around a bug in libtool that drops
# the linkage because it uses -nostdlib. See #468555. Add --as-needed to
# drop a few unnecessary dependencies.
export DEB_LDFLAGS_MAINT_APPEND = -lpthread -Wl,--as-needed
# Set the results of dpkg-buildflags as make variables. We don't use this
# to communicate to dh_auto_configure; it calls dpkg-buildflags itself.
# It's only used to strip those flags out of the pkgconfig file. If we
# can't import this, we don't care.
-include /usr/share/dpkg/buildflags.mk
DOCS = debian/libsaml2-doc/usr/share/doc/libsaml2-doc
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
DEBUG = --enable-debug
else
DEBUG =
endif
%:
dh $@ --with autoreconf
override_dh_auto_configure:
dh_auto_configure -- --disable-dependency-tracking $(DEBUG)
# Remove the upstream-installed documentation, and strip the build flags out
# of the Cflags and Libs pkgconfig configuration. LDFLAGS and CPPFLAGS are
# set by /usr/share/dpkg/buildflags.mk above.
override_dh_install:
rm -r debian/tmp/usr/share/doc/opensaml*
dh_install -a -i --fail-missing
perl -i -pe 's/^(Libs: .*)\Q$(LDFLAGS)\E/$$1/' \
debian/*/usr/lib/*/pkgconfig/opensaml.pc
perl -i -pe 's/^(Cflags: .*)\Q$(CPPFLAGS)\E/$$1/' \
debian/*/usr/lib/*/pkgconfig/opensaml.pc
override_dh_installdocs:
dh_installdocs -A doc/NOTICE.txt
set -e; if [ -d "$(DOCS)" ] ; then \
if [ -f "$(DOCS)/html/jquery.js" ] ; then \
rm $(DOCS)/html/jquery.js ; \
ln -s /usr/share/javascript/jquery/jquery.min.js \
$(DOCS)/html/jquery.js ; \
fi ; \
fi
override_dh_autoreconf:
dh_autoreconf --as-needed
override_dh_builddeb:
dh_builddeb -- -Zxz
# Don't attempt to build the buildflags.mk file if it doesn't exist.
/usr/share/dpkg/buildflags.mk:
|