| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 4 |
export DEB_CFLAGS_MAINT_PREPEND = -Wall |
| 5 |
|
| 6 |
include /usr/share/dpkg/default.mk |
| 7 |
|
| 8 |
# Override default upstream setuid mode, as they rejected this change. |
| 9 |
SUIDMODE = "-m 4755" |
| 10 |
|
| 11 |
# Set proper Provides |
| 12 |
ifeq ($(DEB_HOST_ARCH_OS),linux) |
| 13 |
syslogd_provides = linux-kernel-log-daemon |
| 14 |
confflags += --with-path-procnet-dev=/proc/net/dev |
| 15 |
confflags += --enable-systemd |
| 16 |
endif |
| 17 |
ifeq ($(DEB_HOST_ARCH_OS),hurd) |
| 18 |
tools_provides = net-tools |
| 19 |
endif |
| 20 |
|
| 21 |
D = $(CURDIR)/debian/tmp |
| 22 |
M = $(CURDIR)/debian/local/man |
| 23 |
mandir = usr/share/man |
| 24 |
man1dir = $(mandir)/man1 |
| 25 |
man5dir = $(mandir)/man5 |
| 26 |
man8dir = $(mandir)/man8 |
| 27 |
|
| 28 |
%: |
| 29 |
dh $@ |
| 30 |
|
| 31 |
override_dh_auto_clean: |
| 32 |
[ ! -f Makefile ] || dh_auto_clean |
| 33 |
|
| 34 |
override_dh_autoreconf: |
| 35 |
dh_autoreconf ./bootstrap -- \ |
| 36 |
--gnulib-srcdir=/usr/share/gnulib \ |
| 37 |
--no-git \ |
| 38 |
--skip-po \ |
| 39 |
--copy \ |
| 40 |
--force \ |
| 41 |
# EOL |
| 42 |
|
| 43 |
override_dh_auto_configure: |
| 44 |
dh_auto_configure -- \ |
| 45 |
$(confflags) \ |
| 46 |
--disable-rpath \ |
| 47 |
--libexecdir=\$${prefix}/sbin \ |
| 48 |
--runstatedir=/run \ |
| 49 |
--disable-rcp \ |
| 50 |
--disable-rexec \ |
| 51 |
--disable-rexecd \ |
| 52 |
--disable-rlogin \ |
| 53 |
--disable-rlogind \ |
| 54 |
--disable-rsh \ |
| 55 |
--disable-rshd \ |
| 56 |
--disable-tftp \ |
| 57 |
--disable-tftpd \ |
| 58 |
--disable-uucpd \ |
| 59 |
--disable-whois \ |
| 60 |
--without-idn \ |
| 61 |
--with-path-login=/bin/login \ |
| 62 |
--with-krb5 \ |
| 63 |
--with-wrap \ |
| 64 |
--with-pam \ |
| 65 |
# EOL |
| 66 |
|
| 67 |
override_dh_auto_install: |
| 68 |
dh_auto_install -- SUIDMODE=$(SUIDMODE) |
| 69 |
|
| 70 |
# Create man page directories |
| 71 |
mkdir -p $(D)/$(man1dir) |
| 72 |
mkdir -p $(D)/$(man5dir) |
| 73 |
mkdir -p $(D)/$(man8dir) |
| 74 |
|
| 75 |
# Rename ifconfig to not break existing systems using net-tools |
| 76 |
mv $(D)/usr/bin/ifconfig $(D)/usr/bin/inetutils-ifconfig |
| 77 |
cp $(M)/ifconfig.1 $(D)/$(man1dir)/inetutils-ifconfig.1 |
| 78 |
|
| 79 |
# Rename tools not break with Essential:yes packages |
| 80 |
mv $(D)/usr/bin/dnsdomainname $(D)/usr/bin/inetutils-dnsdomainname |
| 81 |
mv $(D)/usr/bin/hostname $(D)/usr/bin/inetutils-hostname |
| 82 |
mv $(D)/usr/bin/logger $(D)/usr/bin/inetutils-logger |
| 83 |
cp $(M)/dnsdomainname.1 $(D)/$(man1dir)/inetutils-dnsdomainname.1 |
| 84 |
cp $(M)/hostname.1 $(D)/$(man1dir)/inetutils-hostname.1 |
| 85 |
cp $(M)/logger.1 $(D)/$(man1dir)/inetutils-logger.1 |
| 86 |
|
| 87 |
# Rename inetd to be able to coexist with not purged netkit-inetd |
| 88 |
mv $(D)/usr/sbin/inetd $(D)/usr/sbin/inetutils-inetd |
| 89 |
cp $(M)/inetd.8 $(D)/$(man8dir)/inetutils-inetd.8 |
| 90 |
|
| 91 |
# Needed to enable alternatives |
| 92 |
mv $(D)/usr/bin/telnet $(D)/usr/bin/inetutils-telnet |
| 93 |
cp $(M)/telnet.1 $(D)/$(man1dir)/inetutils-telnet.1 |
| 94 |
mv $(D)/usr/bin/ftp $(D)/usr/bin/inetutils-ftp |
| 95 |
cp $(M)/ftp.1 $(D)/$(man1dir)/inetutils-ftp.1 |
| 96 |
cp $(M)/netrc.5 $(D)/$(man5dir)/inetutils-netrc.5 |
| 97 |
mv $(D)/usr/bin/talk $(D)/usr/bin/inetutils-talk |
| 98 |
cp $(M)/talk.1 $(D)/$(man1dir)/inetutils-talk.1 |
| 99 |
mv $(D)/usr/bin/traceroute $(D)/usr/bin/inetutils-traceroute |
| 100 |
cp $(M)/traceroute.1 $(D)/$(man1dir)/inetutils-traceroute.1 |
| 101 |
|
| 102 |
override_dh_installchangelogs: |
| 103 |
dh_installchangelogs --no-trim |
| 104 |
|
| 105 |
override_dh_installdocs: |
| 106 |
dh_installdocs -A NEWS AUTHORS THANKS |
| 107 |
|
| 108 |
override_dh_installpam: |
| 109 |
dh_installpam -pinetutils-ftpd --name ftp |
| 110 |
|
| 111 |
override_dh_fixperms: |
| 112 |
# pings and traceroute are setuid |
| 113 |
dh_fixperms \ |
| 114 |
-Xusr/bin/ping \ |
| 115 |
-Xusr/bin/ping6 \ |
| 116 |
-Xusr/bin/inetutils-traceroute \ |
| 117 |
# EOL |
| 118 |
|
| 119 |
override_dh_gencontrol: |
| 120 |
dh_gencontrol -ptelnet -ptelnetd -- \ |
| 121 |
-v0.17+$(DEB_VERSION_UPSTREAM_REVISION) |
| 122 |
dh_gencontrol -pinetutils-syslogd -- \ |
| 123 |
-Vsyslogd:Provides="$(syslogd_provides)" |
| 124 |
dh_gencontrol -Ninetutils-syslogd -Ntelnet -Ntelnetd -- \ |
| 125 |
-Vtools:Provides="$(tools_provides)" |