| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
include /usr/share/dpkg/architecture.mk |
| 4 |
include /usr/share/dpkg/buildflags.mk |
| 5 |
include /usr/share/dpkg/buildtools.mk |
| 6 |
|
| 7 |
# output every command that modifies files on the build system. |
| 8 |
#export DH_VERBOSE = 1 |
| 9 |
|
| 10 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 11 |
|
| 12 |
# Upstream uses and tests with BSD Make, so prefer it over GNU |
| 13 |
export MAKE = /usr/bin/bmake |
| 14 |
|
| 15 |
# Use libbsd for a system copy of the BSD functions, instead of upstream's |
| 16 |
# embedded compats.c coming from the oconfigure project. |
| 17 |
# Also see https://github.com/kristapsdz/oconfigure/issues/19 |
| 18 |
CFLAGS += $(shell $(PKG_CONFIG) --cflags libmd libbsd-overlay) |
| 19 |
LDFLAGS += $(shell $(PKG_CONFIG) --libs libmd libbsd-overlay) |
| 20 |
|
| 21 |
%: |
| 22 |
dh $@ --buildsystem=makefile |
| 23 |
|
| 24 |
override_dh_auto_configure: |
| 25 |
AR="$(AR)" \ |
| 26 |
CC="$(CC)" \ |
| 27 |
CFLAGS="${CFLAGS}" \ |
| 28 |
./configure \ |
| 29 |
PREFIX=/usr \ |
| 30 |
MANDIR="/usr/share/man" \ |
| 31 |
LIBDIR=/usr/lib/${DEB_HOST_MULTIARCH} \ |
| 32 |
CPPFLAGS="${CPPFLAGS}" \ |
| 33 |
LDFLAGS="${LDFLAGS}" |
| 34 |
|
| 35 |
override_dh_auto_install: |
| 36 |
# make install only installs the main binary, not the library |
| 37 |
$(MAKE) install DESTDIR=debian/tmp |
| 38 |
$(MAKE) install_static DESTDIR=debian/tmp |
| 39 |
$(MAKE) install_shared DESTDIR=debian/tmp |
| 40 |
|
| 41 |
override_dh_auto_test: |
| 42 |
$(MAKE) regress |
| 43 |
|
| 44 |
override_dh_auto_clean: |
| 45 |
echo > Makefile.configure |
| 46 |
# an .if makes "make distclean" fail here, even though |
| 47 |
# LINKER_SOSUFFIX isn't actually used by it |
| 48 |
echo "LINKER_SOSUFFIX = so" >> Makefile.configure |
| 49 |
dh_auto_clean |