File: rules

package info (click to toggle)
inetutils 2%3A1.9.4-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 12,136 kB
  • ctags: 9,048
  • sloc: ansic: 100,666; sh: 9,011; yacc: 1,651; makefile: 655; perl: 47
file content (164 lines) | stat: -rwxr-xr-x 4,047 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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#!/usr/bin/make -f

DEB_BUILD_MAINT_OPTIONS = hardening=+all
DEB_CFLAGS_MAINT_PREPEND = -Wall

include /usr/share/dpkg/default.mk

ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
  conf_gnu_type += --build $(DEB_HOST_GNU_TYPE)
else
  conf_gnu_type += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif

# Override default upstream setuid mode, as they rejected this change.
SUIDMODE="-o root -m 4755"

# Set proper Provides
ifeq ($(DEB_HOST_ARCH_OS),linux)
  syslogd_provides = linux-kernel-log-daemon
endif
ifeq ($(DEB_HOST_ARCH_OS),hurd)
  tools_provides = net-tools
endif

D = $(CURDIR)/debian/tmp
M = $(CURDIR)/debian/local/man
mandir = usr/share/man
man1dir = $(mandir)/man1
man5dir = $(mandir)/man5
man8dir = $(mandir)/man8

configure: configure.ac
	dh_testdir
	
	autoreconf -i -Im4 -Iam

config.status: configure
	dh_testdir
	dh_autotools-dev_updateconfig
	
	./configure \
	  CPPFLAGS="$(CPPFLAGS)" \
	  CFLAGS="$(CFLAGS)" \
	  LDFLAGS="$(LDFLAGS)" \
	  $(conf_gnu_type) \
	  --disable-silent-rules \
	  --prefix=/usr \
	  --sysconfdir=/etc \
	  --localstatedir=/var \
	  --libexecdir=\$${prefix}/sbin \
	  --mandir=\$${prefix}/share/man \
	  --infodir=\$${prefix}/share/info \
	  --with-shishi \
	  --with-wrap \
	  --with-pam

build-indep:

build-arch: build-arch-stamp
build-arch-stamp: config.status
	dh_testdir
	
ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	$(MAKE)
else
	$(MAKE) VERBOSE=1 check
endif
	touch $@

build: build-indep build-arch

clean:
	dh_testdir
	dh_testroot
	
	[ ! -f Makefile ] || $(MAKE) distclean
	
	# Cleanup the mess after having run autoreconf ...
	find -name Makefile.in | xargs rm -f
	rm -f aclocal.m4 config.hin configure
	
	rm -f build-arch-stamp
	
	dh_autotools-dev_restoreconfig
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs -a
	
	$(MAKE) install DESTDIR=$(D) SUIDMODE=$(SUIDMODE)
	
	# Create man page directories
	mkdir -p $(D)/$(man1dir)
	mkdir -p $(D)/$(man5dir)
	mkdir -p $(D)/$(man8dir)
	
	# Move ping to /bin
	mkdir -p $(D)/bin
	mv $(D)/usr/bin/ping $(D)/bin/
	
	# Rename ifconfig to not break existing systems using net-tools
	mv $(D)/usr/bin/ifconfig $(D)/usr/bin/inetutils-ifconfig
	cp $(M)/ifconfig.1 $(D)/usr/share/man/man1/inetutils-ifconfig.1
	
	# Rename inetd to be able to coexist with not purged netkit-inetd
	mv $(D)/usr/sbin/inetd $(D)/usr/sbin/inetutils-inetd
	cp $(M)/inetd.8 $(D)/$(man8dir)/inetutils-inetd.8
	
	# Needed to enable alternatives
	mv $(D)/usr/bin/telnet $(D)/usr/bin/inetutils-telnet
	cp $(M)/telnet.1 $(D)/$(man1dir)/inetutils-telnet.1
	mv $(D)/usr/bin/ftp $(D)/usr/bin/inetutils-ftp
	cp $(M)/ftp.1 $(D)/$(man1dir)/inetutils-ftp.1
	cp $(M)/netrc.5 $(D)/$(man5dir)/inetutils-netrc.5
	mv $(D)/usr/bin/talk $(D)/usr/bin/inetutils-talk
	cp $(M)/talk.1 $(D)/$(man1dir)/inetutils-talk.1
	mv $(D)/usr/bin/traceroute $(D)/usr/bin/inetutils-traceroute
	cp $(M)/traceroute.1 $(D)/$(man1dir)/inetutils-traceroute.1

binary-indep:
# Nothing to do.

binary-arch: install
	dh_testdir
	dh_testroot
	
	dh_install -a --sourcedir=$(D)
	# Install ping6 only if built
	if [ -x $(D)/usr/bin/ping6 ]; then \
	  cp -a $(D)/usr/bin/ping6 \
	        $(CURDIR)/debian/inetutils-ping/bin/; \
	fi
	dh_installdebconf -a
	dh_installdocs -a -A NEWS AUTHORS THANKS
	dh_installexamples -a
	dh_installinit -pinetutils-syslogd -- defaults 10 90
	dh_installinit -a -Ninetutils-syslogd
	dh_installpam -pinetutils-ftpd --name ftp
	dh_installlogrotate -a
	dh_installman -a
	dh_installinfo -a
	dh_installchangelogs -a ChangeLog
	dh_lintian
	dh_link -a
	dh_strip -a
	dh_compress -a
	# pings and traceroute are setuid
	dh_fixperms -a -Xbin/ping -Xbin/ping6 -Xusr/bin/inetutils-traceroute
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a -pinetutils-syslogd -- \
	  -Vsyslogd:Provides="$(syslogd_provides)"
	dh_gencontrol -a -Ninetutils-syslogd -- \
	  -Vtools:Provides="$(tools_provides)"
	dh_md5sums -a
	dh_builddeb -a

binary: binary-indep binary-arch

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