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
|
#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND = -I$(shell pg_config --includedir) -Wall \
-pedantic
%:
dh $@
override_dh_auto_build:
# Makefile uses files instead of environment variable for...
# ..compiler command and flags
test -e conf-cc.orig || cp conf-cc conf-cc.orig
echo '$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)' > conf-cc
# ..linker command and flags
test -e conf-ld.orig || cp conf-ld conf-ld.orig
echo '$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)' > conf-ld
# ...prefix install path
test -e conf-bin.orig || cp conf-bin conf-bin.orig
echo '/usr/bin' > conf-bin
test -e conf-include.orig || cp conf-include conf-include.orig
echo '/usr/include' > conf-include
test -e conf-lib.orig || cp conf-lib conf-lib.orig
echo '/usr/lib' > conf-lib
# Finally, make target all, mysql and pgsql
dh_auto_build
dh_auto_build -- mysql
dh_auto_build -- pgsql
override_dh_auto_test:
sh ./tests.sh
# bg-installer is ignoring DESTDIR, using program-specific install_prefix
override_dh_auto_install:
dh_auto_install -- install_prefix=$(CURDIR)/debian/tmp
# Cleanup conf files
override_dh_auto_clean:
dh_auto_clean
# Revert Makefile configuration
for file in conf-cc conf-bin conf-include conf-lib; do \
test ! -r $$file.orig || mv -f $$file.orig $$file || exit 1; \
done
# Cleanup leftovers
rm -rf .libs
|