File: rules

package info (click to toggle)
netdiag 1.2-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 3,268 kB
  • sloc: ansic: 23,895; sh: 5,544; makefile: 328; awk: 130
file content (112 lines) | stat: -rwxr-xr-x 3,249 bytes parent folder | download | duplicates (3)
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/usr/bin/make -f
# -*- makefile -*-

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

-include /usr/share/dpkg/buildtools.mk
include /usr/share/quilt/quilt.make

export DEB_BUILD_MAINT_OPTIONS=hardening=+all
CFLAGS =`dpkg-buildflags --get CPPFLAGS`
CFLAGS +=`dpkg-buildflags --get CFLAGS`
LDFLAGS = `dpkg-buildflags --get LDFLAGS`

configure: configure-stamp
configure-stamp:
	dh_testdir
	dh_update_autotools_config
	# Add here commands to configure the package.
	CFLAGS="$(CFLAGS) $(LDFLAGS)" dh_auto_configure --sourcedirectory trafshow*
	cd netwatch* && CC="$(CC)" CFLAGS="$(CFLAGS) $(LDFLAGS)" ./configure --prefix=debian/netdiag/usr --mandir=debian/netdiag/usr/share/man/man1
	cd tcpblast* && CC="$(CC)" no_libnsl=yes ./configure

	touch configure-stamp


build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: patch configure-stamp
	dh_testdir

	# Add here commands to compile the package.
	CFLAGS="$(CFLAGS) $(LDFLAGS)" dh_auto_build --sourcedirectory tcpspray*
	CFLAGS="$(CFLAGS) $(LDFLAGS)" dh_auto_build --sourcedirectory statnet*
	(cd trafshow*; make)
	(cd netwatch*; make)
	(cd tcpblast*; CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" make)
	CFLAGS="$(CFLAGS) $(LDFLAGS)" dh_auto_build --sourcedirectory netload*

	touch $@

clean: unpatch
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp

	# Add here commands to clean up after the build process.
	(cd tcpspray; make clean)
	(cd statnet*; make clean; rm -f statnet.1 statnet.lsm)
	(cd trafshow*; [ ! -f Makefile ] || make distclean; rm -f config.log)
	(cd netwatch*; make clean; rm -f Makefile Make.common)
	(cd tcpblast*; [ ! -f Makefile ] || make distclean; rm -f confdefs.h)
	(cd netload*; make clean)

	debconf-updatepo

	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_installdirs

	# Add here commands to install the package into debian/netdiag.
	(cd statnet*; \
		make install INSTALLDIR=$(CURDIR)/debian/netdiag/usr/sbin; \
		mv $(CURDIR)/debian/netdiag/usr/sbin/statnet $(CURDIR)/debian/netdiag/usr/bin)
	(cd tcpspray; \
		make install BINDIR=$(CURDIR)/debian/netdiag/usr/bin)
	(cd netwatch*; \
		make install INSTALLDIR=$(CURDIR)/debian/netdiag/usr)
	(cd trafshow*; \
		make install prefix=$(CURDIR)/debian/netdiag/usr \
			MANDEST=$(CURDIR)/debian/netdiag/usr/share/man \
			BINDEST=$(CURDIR)/debian/netdiag/usr/sbin)
	(cd tcpblast*; \
		make install prefix=$(CURDIR)/debian/netdiag/usr \
			mandir=$(CURDIR)/debian/netdiag/usr/share/man)
	(cd netload*; \
		make install TARGET=$(CURDIR)/debian/netdiag/usr/bin \
			MANTARGET=$(CURDIR)/debian/netdiag/usr/share/man/man1)

# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs
	dh_installexamples netwatch*/netwatch.conf.eg
	dh_install
	dh_installmenu
	dh_installsystemd
	dh_installdebconf	
	dh_installinit
	dh_installman statnet*/statnet.1 tcpspray/tcpspray.1
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure