File: rules

package info (click to toggle)
net-tools 1.60+git20161116.90da8a0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid, stretch
  • size: 2,596 kB
  • ctags: 1,512
  • sloc: ansic: 14,567; makefile: 392; sh: 105
file content (69 lines) | stat: -rwxr-xr-x 2,454 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
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

ifeq ($(origin CC),default)
    CC := $(DEB_HOST_GNU_TYPE)-gcc
endif
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
    PKG_CONFIG ?= $(DEB_HOST_GNU_TYPE)-pkg-config
    export PKG_CONFIG
endif

COPTS := -D_GNU_SOURCE -Wall $(shell dpkg-buildflags --get CFLAGS) \
    $(shell dpkg-buildflags --get CPPFLAGS)
LOPTS := $(shell dpkg-buildflags --get LDFLAGS)

PROGS    = ifconfig arp netstat route rarp slattach plipconfig \
    nameif iptunnel ipmaddr mii-tool
MANPAGES = arp.8 ethers.5 ifconfig.8 mii-tool.8 nameif.8 netstat.8 \
	   plipconfig.8 rarp.8 route.8 slattach.8

%:
	dh $@

override_dh_auto_configure:
	[ ! -f config.make ] || mv config.make debian/config.make.bk
	cp -f debian/config.make config.make
	[ ! -f config.h ] || mv config.h debian/config.h.bk
	cp -f debian/config.h config.h

override_dh_auto_build:
	$(MAKE) CC="$(CC)" COPTS="$(COPTS)" LOPTS="$(LOPTS)" PROGS="$(PROGS)"

override_dh_auto_clean:
	[ ! -f Makefile ] || $(MAKE) clobber
	[ ! -f debian/config.h.bk ] || \
		mv debian/config.h.bk config.h
	[ ! -f debian/config.make.bk ] || \
		mv debian/config.make.bk config.make
	dh_auto_clean

override_dh_auto_install:
	$(MAKE) -C po install BASEDIR=$(CURDIR)/debian/net-tools
	dh_installman --language=de \
		$(wildcard $(addprefix man/de_DE/,$(MANPAGES)))
	dh_installman --language=C \
		$(wildcard $(addprefix man/en_US/,$(MANPAGES)))
	dh_installman --language=fr \
		$(wildcard $(addprefix man/fr_FR/,$(MANPAGES)))
	dh_installman --language=pt_BR \
		$(wildcard $(addprefix man/pt_BR/,$(MANPAGES)))

DEBVERS    ?= $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')
VERSION    ?= $(shell echo '$(DEBVERS)' | sed 's/^[[:digit:]]*://; s/[-].*//')
DEBPKGNAME ?= $(shell dpkg-parsechangelog | sed -n -e 's/^Source: //p')
GITCOMMIT  ?= $(shell echo '$(VERSION)' | \
              sed -e 's/.*+git[[:digit:]]*\.\([[:xdigit:]]*\).*/\1/')

gen-orig-tgz:
	if [ ! -f ../$(DEBPKGNAME)_$(VERSION).orig.tar.gz ] ; then \
	    git archive --format=tar.gz --prefix=$(DEBPKGNAME)-$(VERSION)/ \
                $(GITCOMMIT) >../$(DEBPKGNAME)_$(VERSION).orig.tar.gz ; \
	fi