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 70 71 72 73
|
#!/usr/bin/make -f
DEB_BUILD_MAINT_OPTIONS=hardening=+bindnow
DPKG_EXPORT_BUILDFLAGS=1
include /usr/share/dpkg/buildflags.mk
export PREFIX = /usr
export LIBDIR = /usr/lib/spectrwm
export SYSCONFDIR = /etc
export DESTDIR = $(CURDIR)/debian/tmp
%:
dh $@
# Build, install and clean.
#
# The Makefile we need to use is in the linux/ directory, so we need
# to override the usual dh_auto_* commands to prevent them from using
# the top-level Makefile, which only works on OpenBSD. We also pass a
# few extra variables to customize the installation paths.
override_dh_auto_build:
$(MAKE) -C linux/
override_dh_auto_install:
$(MAKE) -C linux/ install
# Rename the release notes so that dh_installdocs can pick them
# up with the expected name later
mv $(DESTDIR)/usr/share/doc/spectrwm/CHANGELOG.md \
$(DESTDIR)/usr/share/doc/spectrwm/NEWS
override_dh_auto_clean:
$(MAKE) -C linux/ clean
# Prevent CHANGELOG.md from being installed.
#
# Despite the name, we don't want it to end up being installed as
# changelog.gz, as doing so would go against Policy.
override_dh_installchangelogs:
dh_installchangelogs --exclude=CHANGELOG.md
# Don't try to run tests.
#
# spectrwm doesn't have a test suite, but the OpenBSD Makefile in the
# top-level directory confuses dh_auto_test's detection and tricks it
# into thinking one exists.
override_dh_auto_test:
# Don't create shlibs files.
#
# libswmhack.so is not a proper shared library, and it should not be
# treated as such.
override_dh_makeshlibs:
# Rebuild the patches series by looking at the contents of the
# debian/patches directory.
#
# Patches with names starting with D (Debian-specific) should be applied
# after those with names starting with U (to be forwarded upstream).
rebuild-patches-series:
@( \
SERIES=debian/patches/series; \
{ \
echo "# To rebuild this file, use \`debian/rules $@'"; \
for patch in debian/patches/U*.diff debian/patches/D*.diff; \
do \
test -f "$${patch}" || continue; \
patch=$$(basename "$${patch}"); \
echo "$${patch}"; \
done; \
} >"$${SERIES}"; \
)
.PHONY: rebuild-patches-series
|