File: rules

package info (click to toggle)
ifupdown-ng 0.12.1-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 964 kB
  • sloc: ansic: 3,572; sh: 980; makefile: 233
file content (76 lines) | stat: -rwxr-xr-x 2,493 bytes parent folder | download
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
74
75
76
#!/usr/bin/make -f

include /usr/share/dpkg/buildtools.mk
include /usr/share/dpkg/pkg-info.mk
SHELL := /bin/bash

%:
	dh $@

ifeq (,$(filter bookworm%,$(DEB_DISTRIBUTION)))
SBINDIR=usr/sbin
else
SBINDIR=sbin
endif

MAKE_VARS := \
		LIBBSD_CFLAGS="$(shell $(PKG_CONFIG) --cflags libbsd-overlay)" \
		LIBBSD_LIBS="$(shell $(PKG_CONFIG) --cflags --libs libbsd-overlay)" \
		SBINDIR=/$(SBINDIR)


override_dh_auto_build:
	# Compatiblity glue for libbsd (strlcpy 'n friends)
	dh_auto_build -- all docs $(MAKE_VARS)

override_dh_auto_install:
	dh_auto_install -- install install_docs $(MAKE_VARS)

	# Move config file in place and let conffile handling care about updates
	mv debian/tmp/etc/network/ifupdown-ng.conf.example debian/tmp/etc/network/ifupdown-ng.conf

	# Everything goes into ifupdown-ng by default except where
	# overridden below
	rm -rf debian/ifupdown-ng
	mv debian/tmp debian/ifupdown-ng

	# Make co-installable with traditional ifupdown and link compat
	# names into ifupdown-ng-compat.
	mkdir -p \
	    debian/ifupdown-ng-compat/$(SBINDIR) \
	    debian/ifupdown-ng-compat/usr/share/man/man8/
	mv debian/ifupdown-ng/$(SBINDIR)/ifupdown debian/ifupdown-ng/$(SBINDIR)/ifupdown-ng
	( cd debian/ifupdown-ng/usr/share/man/; \
	  mv man5/interfaces.5 man5/interfaces-ng.5 \
	)
	for f in if{up,down,query}; do \
	    ln -sf ifupdown-ng debian/ifupdown-ng-compat/$(SBINDIR)/$$f && \
	    rm debian/ifupdown-ng/$(SBINDIR)/$$f && \
	    ln -sf ifupdown-ng debian/ifupdown-ng/$(SBINDIR)/$$f-ng && \
	    mv debian/ifupdown-ng/usr/share/man/man8/$$f.8 debian/ifupdown-ng/usr/share/man/man8/$$f-ng.8 && \
	    ln -sf $$f-ng.8.gz debian/ifupdown-ng-compat/usr/share/man/man8/$$f.8.gz; \
	done
	for f in if{parse,ctrstat}; do \
	    ln -sf ifupdown-ng debian/ifupdown-ng/$(SBINDIR)/$$f; \
	done

execute_after_dh_install:
	install -m 755 -D \
	    -t debian/ifupdown-ng-compat/usr/share/ifupdown-ng/sbin/ \
	    dist/debian/networking
	chmod +x debian/ifupdown-ng-compat/usr/share/ifupdown-ng/sbin/networking

execute_after_dh_compress:
	mkdir debian/ifupdown-ng-compat/usr/share/man/man5
	f=$$(cd debian/ifupdown-ng/usr/share/man/man5/; echo interfaces-ng.5*);\
	gz=$${f#*.5}; \
	ln -sf $$f \
	    debian/ifupdown-ng-compat/usr/share/man/man5/interfaces.5$${gz}

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	HOME=/tmp dh_auto_test
endif

override_dh_installsystemd:
	dh_installsystemd --no-restart-after-upgrade --no-stop-on-upgrade --no-start --name networking