| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 4 |
export DEB_CFLAGS_MAINT_APPEND = -I$(shell pg_config --includedir) -Wall \ |
| 5 |
-pedantic -std=gnu17 |
| 6 |
|
| 7 |
%: |
| 8 |
dh $@ |
| 9 |
|
| 10 |
override_dh_auto_build: |
| 11 |
# Makefile uses files instead of environment variable for... |
| 12 |
# ..compiler command and flags |
| 13 |
test -e conf-cc.orig || cp conf-cc conf-cc.orig |
| 14 |
echo '$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)' > conf-cc |
| 15 |
|
| 16 |
# ..linker command and flags |
| 17 |
test -e conf-ld.orig || cp conf-ld conf-ld.orig |
| 18 |
echo '$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)' > conf-ld |
| 19 |
|
| 20 |
# ...prefix install path |
| 21 |
test -e conf-bin.orig || cp conf-bin conf-bin.orig |
| 22 |
echo '/usr/bin' > conf-bin |
| 23 |
|
| 24 |
test -e conf-include.orig || cp conf-include conf-include.orig |
| 25 |
echo '/usr/include' > conf-include |
| 26 |
|
| 27 |
test -e conf-lib.orig || cp conf-lib conf-lib.orig |
| 28 |
echo '/usr/lib' > conf-lib |
| 29 |
|
| 30 |
# Finally, make target all, mysql and pgsql |
| 31 |
dh_auto_build |
| 32 |
dh_auto_build -- mysql |
| 33 |
dh_auto_build -- pgsql |
| 34 |
|
| 35 |
override_dh_auto_test: |
| 36 |
sh ./tests.sh |
| 37 |
|
| 38 |
# bg-installer is ignoring DESTDIR, using program-specific install_prefix |
| 39 |
override_dh_auto_install: |
| 40 |
dh_auto_install -- install_prefix=$(CURDIR)/debian/tmp |
| 41 |
|
| 42 |
# Cleanup conf files |
| 43 |
override_dh_auto_clean: |
| 44 |
dh_auto_clean |
| 45 |
|
| 46 |
# Revert Makefile configuration |
| 47 |
for file in conf-cc conf-bin conf-include conf-lib; do \ |
| 48 |
test ! -r $$file.orig || mv -f $$file.orig $$file || exit 1; \ |
| 49 |
done |
| 50 |
|
| 51 |
# Cleanup leftovers |
| 52 |
rm -rf .libs |