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
|
#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
# Because upstream does not support CFLAGS easily, use CPPFLAGS
export DEB_CPPFLAGS_MAINT_APPEND = $(shell dpkg-buildflags --get CFLAGS)
export DEB_CPPFLAGS_MAINT_APPEND += -Wall -pedantic -fPIC
# Due to autoreconf
KEEP_FILES = \
INSTALL \
Makefile.am \
Makefile.in \
aclocal.m4 \
config.guess \
config.h.in \
config.sub \
configure \
configure.in \
depcomp \
install-sh \
intl/plural.c \
ltmain.sh \
missing \
mkinstalldirs \
src/Makefile.in
override_dh_auto_configure:
# Save original files
for f in $(KEEP_FILES); do [ -f $$f.orig ] || cp -va $$f $$f.orig ; done
autoreconf -vfi
dh_auto_configure
override_dh_auto_clean:
# Don't run: would cause running autoconf again
# [ ! -f Makefile ] || $(MAKE) distclean
# Instead, clean manually. Skip .git DVCS directory.
find -type d \
\( -name .git \) -prune \
-a ! -name .git \
-o -type f \
-name "*.o" \
-o -name "*.Po" \
-o -name "*.gmo" \
-o -name "*~" \
-o -name "stamp*" \
-o -name "POTFILES" \
-o -name "Makefile" \
| xargs --no-run-if-empty rm
# Directories
rm -rf src/.deps m4/
# Configs
rm -f config.log config.h config.status po/Makefile.in
# binaries
rm -f libtool src/gsetroot
override_dh_auto_install:
$(MAKE) install DESTDIR=$(CURDIR)/debian/gsetroot
# Restore original files
for f in $(KEEP_FILES); do [ ! -f $$f.orig ] || mv -v $$f.orig $$f; done
override_dh_installchangelogs:
dh_installchangelogs ChangeLog
%:
dh $@
# End of file
|