Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 1 | DESCRIPTION = "The GNU inetutils are a collection of common \ |
| 2 | networking utilities and servers including ftp, ftpd, rcp, \ |
| 3 | rexec, rlogin, rlogind, rsh, rshd, syslog, syslogd, talk, \ |
| 4 | talkd, telnet, telnetd, tftp, tftpd, and uucpd." |
| 5 | HOMEPAGE = "http://www.gnu.org/software/inetutils" |
| 6 | SECTION = "net" |
| 7 | DEPENDS = "ncurses netbase readline virtual/crypt" |
| 8 | |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 9 | LICENSE = "GPL-3.0-only" |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 10 | |
| 11 | LIC_FILES_CHKSUM = "file://COPYING;md5=0c7051aef9219dc7237f206c5c4179a7" |
| 12 | |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 13 | SRC_URI[sha256sum] = "0b01bb08e29623c4e3b940f233c961451d9af8c5066301add76a52a95d51772c" |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 14 | SRC_URI = "${GNU_MIRROR}/inetutils/inetutils-${PV}.tar.xz \ |
| 15 | file://inetutils-1.8-0001-printf-parse-pull-in-features.h-for-__GLIBC__.patch \ |
| 16 | file://inetutils-1.8-0003-wchar.patch \ |
| 17 | file://rexec.xinetd.inetutils \ |
| 18 | file://rlogin.xinetd.inetutils \ |
| 19 | file://rsh.xinetd.inetutils \ |
| 20 | file://telnet.xinetd.inetutils \ |
| 21 | file://tftpd.xinetd.inetutils \ |
| 22 | file://inetutils-1.9-PATH_PROCNET_DEV.patch \ |
| 23 | file://inetutils-only-check-pam_appl.h-when-pam-enabled.patch \ |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 24 | file://CVE-2022-39028.patch \ |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 25 | " |
| 26 | |
| 27 | inherit autotools gettext update-alternatives texinfo |
| 28 | |
| 29 | acpaths = "-I ./m4" |
| 30 | |
| 31 | SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', '', 'file://fix-disable-ipv6.patch', d)}" |
| 32 | |
| 33 | PACKAGECONFIG ??= "ftp uucpd \ |
| 34 | ${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} \ |
| 35 | ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6 ping6', '', d)} \ |
| 36 | " |
| 37 | PACKAGECONFIG[ftp] = "--enable-ftp,--disable-ftp,readline" |
| 38 | PACKAGECONFIG[uucpd] = "--enable-uucpd,--disable-uucpd,readline" |
| 39 | PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam" |
| 40 | PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6 gl_cv_socket_ipv6=no," |
| 41 | PACKAGECONFIG[ping6] = "--enable-ping6,--disable-ping6," |
| 42 | |
| 43 | EXTRA_OECONF = "--with-ncurses-include-dir=${STAGING_INCDIR} \ |
| 44 | inetutils_cv_path_login=${base_bindir}/login \ |
| 45 | --with-libreadline-prefix=${STAGING_LIBDIR} \ |
| 46 | --enable-rpath=no \ |
| 47 | " |
| 48 | |
| 49 | # These are horrible for security, disable them |
| 50 | EXTRA_OECONF:append = " --disable-rsh --disable-rshd --disable-rcp \ |
| 51 | --disable-rlogin --disable-rlogind --disable-rexec --disable-rexecd" |
| 52 | |
| 53 | do_configure:prepend () { |
| 54 | export HELP2MAN='true' |
| 55 | cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${S}/build-aux/config.rpath |
| 56 | install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S} |
| 57 | install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S} |
| 58 | rm -f ${S}/glob/configure* |
| 59 | } |
| 60 | |
| 61 | do_install:append () { |
| 62 | install -m 0755 -d ${D}${base_sbindir} |
| 63 | install -m 0755 -d ${D}${sbindir} |
| 64 | install -m 0755 -d ${D}${sysconfdir}/xinetd.d |
| 65 | if [ "${base_bindir}" != "${bindir}" ] ; then |
| 66 | install -m 0755 -d ${D}${base_bindir} |
| 67 | mv ${D}${bindir}/ping* ${D}${base_bindir}/ |
| 68 | mv ${D}${bindir}/hostname ${D}${base_bindir}/ |
| 69 | mv ${D}${bindir}/dnsdomainname ${D}${base_bindir}/ |
| 70 | fi |
| 71 | mv ${D}${bindir}/ifconfig ${D}${base_sbindir}/ |
| 72 | mv ${D}${libexecdir}/syslogd ${D}${base_sbindir}/ |
| 73 | mv ${D}${libexecdir}/tftpd ${D}${sbindir}/in.tftpd |
| 74 | mv ${D}${libexecdir}/telnetd ${D}${sbindir}/in.telnetd |
| 75 | if [ -e ${D}${libexecdir}/rexecd ]; then |
| 76 | mv ${D}${libexecdir}/rexecd ${D}${sbindir}/in.rexecd |
| 77 | cp ${WORKDIR}/rexec.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/rexec |
| 78 | fi |
| 79 | if [ -e ${D}${libexecdir}/rlogind ]; then |
| 80 | mv ${D}${libexecdir}/rlogind ${D}${sbindir}/in.rlogind |
| 81 | cp ${WORKDIR}/rlogin.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/rlogin |
| 82 | fi |
| 83 | if [ -e ${D}${libexecdir}/rshd ]; then |
| 84 | mv ${D}${libexecdir}/rshd ${D}${sbindir}/in.rshd |
| 85 | cp ${WORKDIR}/rsh.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/rsh |
| 86 | fi |
| 87 | if [ -e ${D}${libexecdir}/talkd ]; then |
| 88 | mv ${D}${libexecdir}/talkd ${D}${sbindir}/in.talkd |
| 89 | fi |
| 90 | mv ${D}${libexecdir}/uucpd ${D}${sbindir}/in.uucpd |
| 91 | mv ${D}${libexecdir}/* ${D}${bindir}/ |
| 92 | cp ${WORKDIR}/telnet.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/telnet |
| 93 | cp ${WORKDIR}/tftpd.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/tftpd |
| 94 | |
| 95 | sed -e 's,@SBINDIR@,${sbindir},g' -i ${D}/${sysconfdir}/xinetd.d/* |
| 96 | if [ -e ${D}${libdir}/charset.alias ]; then |
| 97 | rm -rf ${D}${libdir}/charset.alias |
| 98 | fi |
| 99 | rm -rf ${D}${libexecdir}/ |
| 100 | # remove usr/lib if empty |
| 101 | rmdir ${D}${libdir} || true |
| 102 | } |
| 103 | |
| 104 | PACKAGES =+ "${PN}-ping ${PN}-ping6 ${PN}-hostname ${PN}-ifconfig \ |
| 105 | ${PN}-tftp ${PN}-logger ${PN}-traceroute ${PN}-syslogd \ |
| 106 | ${PN}-ftp ${PN}-ftpd ${PN}-tftpd ${PN}-telnet ${PN}-telnetd ${PN}-inetd \ |
| 107 | ${PN}-rsh ${PN}-rshd" |
| 108 | |
| 109 | # The packages tftpd, telnetd and rshd conflict with the ones |
| 110 | # provided by netkit, so add the corresponding -dbg packages |
| 111 | # for them to avoid the confliction between the dbg package |
| 112 | # of inetutils and netkit. |
| 113 | PACKAGES =+ "${PN}-tftpd-dbg ${PN}-telnetd-dbg ${PN}-rshd-dbg" |
| 114 | NOAUTOPACKAGEDEBUG = "1" |
| 115 | |
| 116 | ALTERNATIVE_PRIORITY = "79" |
| 117 | ALTERNATIVE:${PN} = "whois dnsdomainname" |
| 118 | ALTERNATIVE_LINK_NAME[uucpd] = "${sbindir}/in.uucpd" |
| 119 | ALTERNATIVE_LINK_NAME[dnsdomainname] = "${base_bindir}/dnsdomainname" |
| 120 | |
| 121 | ALTERNATIVE_PRIORITY_${PN}-logger = "60" |
| 122 | ALTERNATIVE:${PN}-logger = "logger" |
| 123 | ALTERNATIVE:${PN}-syslogd = "syslogd" |
| 124 | ALTERNATIVE_LINK_NAME[syslogd] = "${base_sbindir}/syslogd" |
| 125 | |
| 126 | ALTERNATIVE:${PN}-ftp = "ftp" |
| 127 | ALTERNATIVE:${PN}-ftpd = "ftpd" |
| 128 | ALTERNATIVE:${PN}-tftp = "tftp" |
| 129 | ALTERNATIVE:${PN}-tftpd = "tftpd" |
| 130 | ALTERNATIVE_LINK_NAME[tftpd] = "${sbindir}/tftpd" |
| 131 | ALTERNATIVE_TARGET[tftpd] = "${sbindir}/in.tftpd" |
| 132 | |
| 133 | ALTERNATIVE:${PN}-telnet = "telnet" |
| 134 | ALTERNATIVE:${PN}-telnetd = "telnetd" |
| 135 | ALTERNATIVE_LINK_NAME[telnetd] = "${sbindir}/telnetd" |
| 136 | ALTERNATIVE_TARGET[telnetd] = "${sbindir}/in.telnetd" |
| 137 | |
| 138 | ALTERNATIVE:${PN}-inetd= "inetd" |
| 139 | ALTERNATIVE:${PN}-traceroute = "traceroute" |
| 140 | |
| 141 | ALTERNATIVE:${PN}-hostname = "hostname" |
| 142 | ALTERNATIVE_LINK_NAME[hostname] = "${base_bindir}/hostname" |
| 143 | |
| 144 | ALTERNATIVE:${PN}-doc = "hostname.1 dnsdomainname.1 logger.1 syslogd.8 \ |
| 145 | tftpd.8 tftp.1 telnetd.8" |
| 146 | ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1" |
| 147 | ALTERNATIVE_LINK_NAME[dnsdomainname.1] = "${mandir}/man1/dnsdomainname.1" |
| 148 | ALTERNATIVE_LINK_NAME[logger.1] = "${mandir}/man1/logger.1" |
| 149 | ALTERNATIVE_LINK_NAME[syslogd.8] = "${mandir}/man8/syslogd.8" |
| 150 | ALTERNATIVE_LINK_NAME[telnetd.8] = "${mandir}/man8/telnetd.8" |
| 151 | ALTERNATIVE_LINK_NAME[tftpd.8] = "${mandir}/man8/tftpd.8" |
| 152 | ALTERNATIVE_LINK_NAME[tftp.1] = "${mandir}/man1/tftp.1" |
| 153 | |
| 154 | ALTERNATIVE:${PN}-ifconfig = "ifconfig" |
| 155 | ALTERNATIVE_LINK_NAME[ifconfig] = "${base_sbindir}/ifconfig" |
| 156 | |
| 157 | ALTERNATIVE:${PN}-ping = "ping" |
| 158 | ALTERNATIVE_LINK_NAME[ping] = "${base_bindir}/ping" |
| 159 | |
| 160 | ALTERNATIVE:${PN}-ping6 = "${@bb.utils.filter('PACKAGECONFIG', 'ping6', d)}" |
| 161 | ALTERNATIVE_LINK_NAME[ping6] = "${base_bindir}/ping6" |
| 162 | |
| 163 | |
| 164 | FILES:${PN}-dbg += "${base_bindir}/.debug ${base_sbindir}/.debug ${bindir}/.debug ${sbindir}/.debug" |
| 165 | FILES:${PN}-ping = "${base_bindir}/ping.${BPN}" |
| 166 | FILES:${PN}-ping6 = "${base_bindir}/ping6.${BPN}" |
| 167 | FILES:${PN}-hostname = "${base_bindir}/hostname.${BPN}" |
| 168 | FILES:${PN}-ifconfig = "${base_sbindir}/ifconfig.${BPN}" |
| 169 | FILES:${PN}-traceroute = "${bindir}/traceroute.${BPN}" |
| 170 | FILES:${PN}-logger = "${bindir}/logger.${BPN}" |
| 171 | |
| 172 | FILES:${PN}-syslogd = "${base_sbindir}/syslogd.${BPN}" |
| 173 | RCONFLICTS:${PN}-syslogd = "rsyslog busybox-syslog sysklogd syslog-ng" |
| 174 | |
| 175 | FILES:${PN}-ftp = "${bindir}/ftp.${BPN}" |
| 176 | |
| 177 | FILES:${PN}-tftp = "${bindir}/tftp.${BPN}" |
| 178 | FILES:${PN}-telnet = "${bindir}/telnet.${BPN}" |
| 179 | |
| 180 | # We make us of RCONFLICTS / RPROVIDES here rather than using the normal |
| 181 | # alternatives method as this leads to packaging QA issues when using |
| 182 | # musl as that library does not provide what these applications need to |
| 183 | # build. |
| 184 | FILES:${PN}-rsh = "${bindir}/rsh ${bindir}/rlogin ${bindir}/rexec ${bindir}/rcp" |
| 185 | RCONFLICTS:${PN}-rsh += "netkit-rsh-client" |
| 186 | RPROVIDES:${PN}-rsh = "rsh" |
| 187 | |
| 188 | FILES:${PN}-rshd = "${sbindir}/in.rshd ${sbindir}/in.rlogind ${sbindir}/in.rexecd \ |
| 189 | ${sysconfdir}/xinetd.d/rsh ${sysconfdir}/xinetd.d/rlogin ${sysconfdir}/xinetd.d/rexec" |
| 190 | FILES:${PN}-rshd-dbg = "${sbindir}/.debug/in.rshd ${sbindir}/.debug/in.rlogind ${sbindir}/.debug/in.rexecd" |
| 191 | RDEPENDS:${PN}-rshd += "xinetd tcp-wrappers" |
| 192 | RCONFLICTS:${PN}-rshd += "netkit-rshd-server" |
| 193 | RPROVIDES:${PN}-rshd = "rshd" |
| 194 | |
| 195 | FILES:${PN}-ftpd = "${bindir}/ftpd.${BPN}" |
| 196 | FILES:${PN}-ftpd-dbg = "${bindir}/.debug/ftpd.${BPN}" |
| 197 | RDEPENDS:${PN}-ftpd += "xinetd" |
| 198 | |
| 199 | FILES:${PN}-tftpd = "${sbindir}/in.tftpd ${sysconfdir}/xinetd.d/tftpd" |
| 200 | FILES:${PN}-tftpd-dbg = "${sbindir}/.debug/in.tftpd" |
| 201 | RCONFLICTS:${PN}-tftpd += "netkit-tftpd" |
| 202 | RDEPENDS:${PN}-tftpd += "xinetd" |
| 203 | |
| 204 | FILES:${PN}-telnetd = "${sbindir}/in.telnetd ${sysconfdir}/xinetd.d/telnet" |
| 205 | FILES:${PN}-telnetd-dbg = "${sbindir}/.debug/in.telnetd" |
| 206 | RCONFLICTS:${PN}-telnetd += "netkit-telnet" |
| 207 | RPROVIDES:${PN}-telnetd = "telnetd" |
| 208 | RDEPENDS:${PN}-telnetd += "xinetd" |
| 209 | |
| 210 | FILES:${PN}-inetd = "${bindir}/inetd.${BPN}" |
| 211 | |
| 212 | RDEPENDS:${PN} = "xinetd" |