| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
include /usr/share/dpkg/buildtools.mk |
| 4 |
include /usr/share/dpkg/pkg-info.mk |
| 5 |
SHELL := /bin/bash |
| 6 |
|
| 7 |
%: |
| 8 |
dh $@ |
| 9 |
|
| 10 |
ifeq (,$(filter bookworm%,$(DEB_DISTRIBUTION))) |
| 11 |
SBINDIR=usr/sbin |
| 12 |
else |
| 13 |
SBINDIR=sbin |
| 14 |
endif |
| 15 |
|
| 16 |
MAKE_VARS := \ |
| 17 |
LIBBSD_CFLAGS="$(shell $(PKG_CONFIG) --cflags libbsd-overlay)" \ |
| 18 |
LIBBSD_LIBS="$(shell $(PKG_CONFIG) --cflags --libs libbsd-overlay)" \ |
| 19 |
SBINDIR=/$(SBINDIR) |
| 20 |
|
| 21 |
|
| 22 |
override_dh_auto_build: |
| 23 |
# Compatiblity glue for libbsd (strlcpy 'n friends) |
| 24 |
dh_auto_build -- all docs $(MAKE_VARS) |
| 25 |
|
| 26 |
override_dh_auto_install: |
| 27 |
dh_auto_install -- install install_docs $(MAKE_VARS) |
| 28 |
|
| 29 |
# Move config file in place and let conffile handling care about updates |
| 30 |
mv debian/tmp/etc/network/ifupdown-ng.conf.example debian/tmp/etc/network/ifupdown-ng.conf |
| 31 |
|
| 32 |
# Everything goes into ifupdown-ng by default except where |
| 33 |
# overridden below |
| 34 |
rm -rf debian/ifupdown-ng |
| 35 |
mv debian/tmp debian/ifupdown-ng |
| 36 |
|
| 37 |
# Make co-installable with traditional ifupdown and link compat |
| 38 |
# names into ifupdown-ng-compat. |
| 39 |
mkdir -p \ |
| 40 |
debian/ifupdown-ng-compat/$(SBINDIR) \ |
| 41 |
debian/ifupdown-ng-compat/usr/share/man/man8/ |
| 42 |
mv debian/ifupdown-ng/$(SBINDIR)/ifupdown debian/ifupdown-ng/$(SBINDIR)/ifupdown-ng |
| 43 |
( cd debian/ifupdown-ng/usr/share/man/; \ |
| 44 |
mv man5/interfaces.5 man5/interfaces-ng.5 \ |
| 45 |
) |
| 46 |
for f in if{up,down,query}; do \ |
| 47 |
ln -sf ifupdown-ng debian/ifupdown-ng-compat/$(SBINDIR)/$$f && \ |
| 48 |
rm debian/ifupdown-ng/$(SBINDIR)/$$f && \ |
| 49 |
ln -sf ifupdown-ng debian/ifupdown-ng/$(SBINDIR)/$$f-ng && \ |
| 50 |
mv debian/ifupdown-ng/usr/share/man/man8/$$f.8 debian/ifupdown-ng/usr/share/man/man8/$$f-ng.8 && \ |
| 51 |
ln -sf $$f-ng.8.gz debian/ifupdown-ng-compat/usr/share/man/man8/$$f.8.gz; \ |
| 52 |
done |
| 53 |
for f in if{parse,ctrstat}; do \ |
| 54 |
ln -sf ifupdown-ng debian/ifupdown-ng/$(SBINDIR)/$$f; \ |
| 55 |
done |
| 56 |
|
| 57 |
execute_after_dh_install: |
| 58 |
install -m 755 -D \ |
| 59 |
-t debian/ifupdown-ng-compat/usr/share/ifupdown-ng/sbin/ \ |
| 60 |
dist/debian/networking |
| 61 |
chmod +x debian/ifupdown-ng-compat/usr/share/ifupdown-ng/sbin/networking |
| 62 |
|
| 63 |
execute_after_dh_compress: |
| 64 |
mkdir debian/ifupdown-ng-compat/usr/share/man/man5 |
| 65 |
f=$$(cd debian/ifupdown-ng/usr/share/man/man5/; echo interfaces-ng.5*);\ |
| 66 |
gz=$${f#*.5}; \ |
| 67 |
ln -sf $$f \ |
| 68 |
debian/ifupdown-ng-compat/usr/share/man/man5/interfaces.5$${gz} |
| 69 |
|
| 70 |
override_dh_auto_test: |
| 71 |
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) |
| 72 |
HOME=/tmp dh_auto_test |
| 73 |
endif |
| 74 |
|
| 75 |
override_dh_installsystemd: |
| 76 |
dh_installsystemd --no-restart-after-upgrade --no-stop-on-upgrade --no-start --name networking |