| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 4 |
|
| 5 |
SHELL := sh -e |
| 6 |
|
| 7 |
%: |
| 8 |
dh ${@} |
| 9 |
|
| 10 |
override_dh_auto_clean: |
| 11 |
rm -f config.h |
| 12 |
$(MAKE) clean |
| 13 |
|
| 14 |
override_dh_auto_install: |
| 15 |
$(MAKE) install DESTDIR=$(CURDIR)/debian/dwm PREFIX=/usr |
| 16 |
|
| 17 |
mv debian/dwm/usr/bin/dwm debian/dwm/usr/bin/dwm.default |
| 18 |
ln -s dwm.1.gz debian/dwm/usr/share/man/man1/dwm.default.1.gz |
| 19 |
|
| 20 |
# Building alternatives |
| 21 |
for ALTERNATIVE in debian/local/config.*.h; \ |
| 22 |
do \ |
| 23 |
$(MAKE) clean; \ |
| 24 |
cp $${ALTERNATIVE} config.h; \ |
| 25 |
CFLAGS="$(CFLAGS)" dh_auto_build -- PREFIX=/usr; \ |
| 26 |
install -m 0755 dwm debian/dwm/usr/bin/dwm.`basename $${ALTERNATIVE} | cut -d'.' -f 2`; \ |
| 27 |
ln -s dwm.1.gz debian/dwm/usr/share/man/man1/dwm.`basename $${ALTERNATIVE} | cut -d'.' -f 2`.1.gz; \ |
| 28 |
done |
| 29 |
|
| 30 |
# Configuring maintainer scripts |
| 31 |
sed -e "s|@ALTERNATIVES@|$(shell find debian/local/ -name 'config.*.h' | LC_ALL=C sort | cut -d'.' -f 2 | tr '\n' ' ')|" debian/dwm.postinst.in > debian/dwm.postinst |
| 32 |
sed -e "s|@ALTERNATIVES@|$(shell find debian/local/ -name 'config.*.h' | LC_ALL=C sort | cut -d'.' -f 2 | tr '\n' ' ')|" debian/dwm.prerm.in > debian/dwm.prerm |