blob: 957f1feac6039018786527cddfcdf131f95be4a4 [file] [log] [blame]
Patrick Williams8e7b46e2023-05-01 14:19:06 -05001SUMMARY = "The GNU inetutils are a collection of common networking utilities and servers."
Andrew Geisslereff27472021-10-29 15:35:00 -05002DESCRIPTION = "The GNU inetutils are a collection of common \
3networking utilities and servers including ftp, ftpd, rcp, \
4rexec, rlogin, rlogind, rsh, rshd, syslog, syslogd, talk, \
5talkd, telnet, telnetd, tftp, tftpd, and uucpd."
6HOMEPAGE = "http://www.gnu.org/software/inetutils"
7SECTION = "net"
8DEPENDS = "ncurses netbase readline virtual/crypt"
9
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000010LICENSE = "GPL-3.0-only"
Andrew Geisslereff27472021-10-29 15:35:00 -050011
12LIC_FILES_CHKSUM = "file://COPYING;md5=0c7051aef9219dc7237f206c5c4179a7"
13
Patrick Williams7784c422022-11-17 07:29:11 -060014SRC_URI[sha256sum] = "1789d6b1b1a57dfe2a7ab7b533ee9f5dfd9cbf5b59bb1bb3c2612ed08d0f68b2"
Andrew Geisslereff27472021-10-29 15:35:00 -050015SRC_URI = "${GNU_MIRROR}/inetutils/inetutils-${PV}.tar.xz \
Andrew Geissler5082cc72023-09-11 08:41:39 -040016 file://rexec.xinetd.inetutils \
Andrew Geisslereff27472021-10-29 15:35:00 -050017 file://rlogin.xinetd.inetutils \
18 file://rsh.xinetd.inetutils \
19 file://telnet.xinetd.inetutils \
20 file://tftpd.xinetd.inetutils \
Andrew Geissler5082cc72023-09-11 08:41:39 -040021 file://0001-CVE-2023-40303-ftpd-rcp-rlogin-rsh-rshd-uucpd-fix-ch.patch \
22 file://0002-CVE-2023-40303-Indent-changes-in-previous-commit.patch \
23 "
Andrew Geisslereff27472021-10-29 15:35:00 -050024
25inherit autotools gettext update-alternatives texinfo
26
27acpaths = "-I ./m4"
28
Andrew Geisslereff27472021-10-29 15:35:00 -050029PACKAGECONFIG ??= "ftp uucpd \
30 ${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} \
31 ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6 ping6', '', d)} \
32 "
33PACKAGECONFIG[ftp] = "--enable-ftp,--disable-ftp,readline"
34PACKAGECONFIG[uucpd] = "--enable-uucpd,--disable-uucpd,readline"
35PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam"
36PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6 gl_cv_socket_ipv6=no,"
37PACKAGECONFIG[ping6] = "--enable-ping6,--disable-ping6,"
38
39EXTRA_OECONF = "--with-ncurses-include-dir=${STAGING_INCDIR} \
Andrew Geisslereff27472021-10-29 15:35:00 -050040 --with-libreadline-prefix=${STAGING_LIBDIR} \
41 --enable-rpath=no \
Andrew Geissler5082cc72023-09-11 08:41:39 -040042 --with-path-login=${base_bindir}/login \
43 --with-path-cp=${base_bindir}/cp \
44 --with-path-uucico=${libexecdir}/uuico \
45 --with-path-procnet-dev=/proc/net/dev \
46 "
47
48EXTRA_OECONF:append:libc-musl = " --with-path-utmpx=/dev/null/utmpx --with-path-wtmpx=/dev/null/wtmpx"
Andrew Geisslereff27472021-10-29 15:35:00 -050049
50# These are horrible for security, disable them
51EXTRA_OECONF:append = " --disable-rsh --disable-rshd --disable-rcp \
52 --disable-rlogin --disable-rlogind --disable-rexec --disable-rexecd"
53
Andrew Geissler5082cc72023-09-11 08:41:39 -040054# The configure script guesses many paths in cross builds, check for this happening
55do_configure_cross_check() {
56 if grep "may be incorrect because of cross-compilation" ${B}/config.log; then
57 bberror Default path values used, these must be set explicitly
58 fi
59}
60do_configure[postfuncs] += "do_configure_cross_check"
61
62# The --with-path options are not actually options, so this check needs to be silenced
63ERROR_QA:remove = "unknown-configure-option"
64
Andrew Geisslereff27472021-10-29 15:35:00 -050065do_configure:prepend () {
66 export HELP2MAN='true'
Andrew Geisslereff27472021-10-29 15:35:00 -050067}
68
69do_install:append () {
70 install -m 0755 -d ${D}${base_sbindir}
71 install -m 0755 -d ${D}${sbindir}
72 install -m 0755 -d ${D}${sysconfdir}/xinetd.d
73 if [ "${base_bindir}" != "${bindir}" ] ; then
74 install -m 0755 -d ${D}${base_bindir}
75 mv ${D}${bindir}/ping* ${D}${base_bindir}/
76 mv ${D}${bindir}/hostname ${D}${base_bindir}/
77 mv ${D}${bindir}/dnsdomainname ${D}${base_bindir}/
78 fi
79 mv ${D}${bindir}/ifconfig ${D}${base_sbindir}/
80 mv ${D}${libexecdir}/syslogd ${D}${base_sbindir}/
81 mv ${D}${libexecdir}/tftpd ${D}${sbindir}/in.tftpd
82 mv ${D}${libexecdir}/telnetd ${D}${sbindir}/in.telnetd
83 if [ -e ${D}${libexecdir}/rexecd ]; then
84 mv ${D}${libexecdir}/rexecd ${D}${sbindir}/in.rexecd
85 cp ${WORKDIR}/rexec.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/rexec
86 fi
87 if [ -e ${D}${libexecdir}/rlogind ]; then
88 mv ${D}${libexecdir}/rlogind ${D}${sbindir}/in.rlogind
89 cp ${WORKDIR}/rlogin.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/rlogin
90 fi
91 if [ -e ${D}${libexecdir}/rshd ]; then
92 mv ${D}${libexecdir}/rshd ${D}${sbindir}/in.rshd
93 cp ${WORKDIR}/rsh.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/rsh
94 fi
95 if [ -e ${D}${libexecdir}/talkd ]; then
96 mv ${D}${libexecdir}/talkd ${D}${sbindir}/in.talkd
97 fi
98 mv ${D}${libexecdir}/uucpd ${D}${sbindir}/in.uucpd
99 mv ${D}${libexecdir}/* ${D}${bindir}/
100 cp ${WORKDIR}/telnet.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/telnet
101 cp ${WORKDIR}/tftpd.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/tftpd
102
103 sed -e 's,@SBINDIR@,${sbindir},g' -i ${D}/${sysconfdir}/xinetd.d/*
104 if [ -e ${D}${libdir}/charset.alias ]; then
105 rm -rf ${D}${libdir}/charset.alias
106 fi
107 rm -rf ${D}${libexecdir}/
108 # remove usr/lib if empty
109 rmdir ${D}${libdir} || true
110}
111
112PACKAGES =+ "${PN}-ping ${PN}-ping6 ${PN}-hostname ${PN}-ifconfig \
113${PN}-tftp ${PN}-logger ${PN}-traceroute ${PN}-syslogd \
114${PN}-ftp ${PN}-ftpd ${PN}-tftpd ${PN}-telnet ${PN}-telnetd ${PN}-inetd \
115${PN}-rsh ${PN}-rshd"
116
117# The packages tftpd, telnetd and rshd conflict with the ones
118# provided by netkit, so add the corresponding -dbg packages
119# for them to avoid the confliction between the dbg package
120# of inetutils and netkit.
121PACKAGES =+ "${PN}-tftpd-dbg ${PN}-telnetd-dbg ${PN}-rshd-dbg"
122NOAUTOPACKAGEDEBUG = "1"
123
124ALTERNATIVE_PRIORITY = "79"
125ALTERNATIVE:${PN} = "whois dnsdomainname"
126ALTERNATIVE_LINK_NAME[uucpd] = "${sbindir}/in.uucpd"
127ALTERNATIVE_LINK_NAME[dnsdomainname] = "${base_bindir}/dnsdomainname"
128
129ALTERNATIVE_PRIORITY_${PN}-logger = "60"
130ALTERNATIVE:${PN}-logger = "logger"
131ALTERNATIVE:${PN}-syslogd = "syslogd"
132ALTERNATIVE_LINK_NAME[syslogd] = "${base_sbindir}/syslogd"
133
134ALTERNATIVE:${PN}-ftp = "ftp"
135ALTERNATIVE:${PN}-ftpd = "ftpd"
136ALTERNATIVE:${PN}-tftp = "tftp"
137ALTERNATIVE:${PN}-tftpd = "tftpd"
138ALTERNATIVE_LINK_NAME[tftpd] = "${sbindir}/tftpd"
139ALTERNATIVE_TARGET[tftpd] = "${sbindir}/in.tftpd"
140
141ALTERNATIVE:${PN}-telnet = "telnet"
142ALTERNATIVE:${PN}-telnetd = "telnetd"
143ALTERNATIVE_LINK_NAME[telnetd] = "${sbindir}/telnetd"
144ALTERNATIVE_TARGET[telnetd] = "${sbindir}/in.telnetd"
145
146ALTERNATIVE:${PN}-inetd= "inetd"
147ALTERNATIVE:${PN}-traceroute = "traceroute"
148
149ALTERNATIVE:${PN}-hostname = "hostname"
150ALTERNATIVE_LINK_NAME[hostname] = "${base_bindir}/hostname"
151
152ALTERNATIVE:${PN}-doc = "hostname.1 dnsdomainname.1 logger.1 syslogd.8 \
153 tftpd.8 tftp.1 telnetd.8"
154ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1"
155ALTERNATIVE_LINK_NAME[dnsdomainname.1] = "${mandir}/man1/dnsdomainname.1"
156ALTERNATIVE_LINK_NAME[logger.1] = "${mandir}/man1/logger.1"
157ALTERNATIVE_LINK_NAME[syslogd.8] = "${mandir}/man8/syslogd.8"
158ALTERNATIVE_LINK_NAME[telnetd.8] = "${mandir}/man8/telnetd.8"
159ALTERNATIVE_LINK_NAME[tftpd.8] = "${mandir}/man8/tftpd.8"
160ALTERNATIVE_LINK_NAME[tftp.1] = "${mandir}/man1/tftp.1"
161
162ALTERNATIVE:${PN}-ifconfig = "ifconfig"
163ALTERNATIVE_LINK_NAME[ifconfig] = "${base_sbindir}/ifconfig"
164
165ALTERNATIVE:${PN}-ping = "ping"
166ALTERNATIVE_LINK_NAME[ping] = "${base_bindir}/ping"
167
168ALTERNATIVE:${PN}-ping6 = "${@bb.utils.filter('PACKAGECONFIG', 'ping6', d)}"
169ALTERNATIVE_LINK_NAME[ping6] = "${base_bindir}/ping6"
170
171
172FILES:${PN}-dbg += "${base_bindir}/.debug ${base_sbindir}/.debug ${bindir}/.debug ${sbindir}/.debug"
173FILES:${PN}-ping = "${base_bindir}/ping.${BPN}"
174FILES:${PN}-ping6 = "${base_bindir}/ping6.${BPN}"
175FILES:${PN}-hostname = "${base_bindir}/hostname.${BPN}"
176FILES:${PN}-ifconfig = "${base_sbindir}/ifconfig.${BPN}"
177FILES:${PN}-traceroute = "${bindir}/traceroute.${BPN}"
178FILES:${PN}-logger = "${bindir}/logger.${BPN}"
179
180FILES:${PN}-syslogd = "${base_sbindir}/syslogd.${BPN}"
181RCONFLICTS:${PN}-syslogd = "rsyslog busybox-syslog sysklogd syslog-ng"
182
183FILES:${PN}-ftp = "${bindir}/ftp.${BPN}"
184
185FILES:${PN}-tftp = "${bindir}/tftp.${BPN}"
186FILES:${PN}-telnet = "${bindir}/telnet.${BPN}"
187
188# We make us of RCONFLICTS / RPROVIDES here rather than using the normal
189# alternatives method as this leads to packaging QA issues when using
190# musl as that library does not provide what these applications need to
191# build.
192FILES:${PN}-rsh = "${bindir}/rsh ${bindir}/rlogin ${bindir}/rexec ${bindir}/rcp"
193RCONFLICTS:${PN}-rsh += "netkit-rsh-client"
194RPROVIDES:${PN}-rsh = "rsh"
195
196FILES:${PN}-rshd = "${sbindir}/in.rshd ${sbindir}/in.rlogind ${sbindir}/in.rexecd \
197 ${sysconfdir}/xinetd.d/rsh ${sysconfdir}/xinetd.d/rlogin ${sysconfdir}/xinetd.d/rexec"
198FILES:${PN}-rshd-dbg = "${sbindir}/.debug/in.rshd ${sbindir}/.debug/in.rlogind ${sbindir}/.debug/in.rexecd"
199RDEPENDS:${PN}-rshd += "xinetd tcp-wrappers"
200RCONFLICTS:${PN}-rshd += "netkit-rshd-server"
201RPROVIDES:${PN}-rshd = "rshd"
202
203FILES:${PN}-ftpd = "${bindir}/ftpd.${BPN}"
204FILES:${PN}-ftpd-dbg = "${bindir}/.debug/ftpd.${BPN}"
205RDEPENDS:${PN}-ftpd += "xinetd"
206
207FILES:${PN}-tftpd = "${sbindir}/in.tftpd ${sysconfdir}/xinetd.d/tftpd"
208FILES:${PN}-tftpd-dbg = "${sbindir}/.debug/in.tftpd"
209RCONFLICTS:${PN}-tftpd += "netkit-tftpd"
210RDEPENDS:${PN}-tftpd += "xinetd"
211
212FILES:${PN}-telnetd = "${sbindir}/in.telnetd ${sysconfdir}/xinetd.d/telnet"
213FILES:${PN}-telnetd-dbg = "${sbindir}/.debug/in.telnetd"
214RCONFLICTS:${PN}-telnetd += "netkit-telnet"
215RPROVIDES:${PN}-telnetd = "telnetd"
216RDEPENDS:${PN}-telnetd += "xinetd"
217
218FILES:${PN}-inetd = "${bindir}/inetd.${BPN}"
219
220RDEPENDS:${PN} = "xinetd"