blob: 08dd532b62de3a1ba82f57b2aca6942e56804001 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001DESCRIPTION = "netkit-telnet includes the telnet daemon and client."
Brad Bishopd7bf8c12018-02-25 22:55:05 -05002HOMEPAGE = "http://www.hcs.harvard.edu/~dholland/computers/netkit.html"
Patrick Williamsb48b7b42016-08-17 15:04:38 -05003SECTION = "net"
4DEPENDS = "ncurses"
Brad Bishop2d39a062019-10-28 08:33:36 -04005LICENSE = "BSD-4-Clause"
Patrick Williamsb48b7b42016-08-17 15:04:38 -05006LIC_FILES_CHKSUM = "file://telnet/telnet.cc;beginline=2;endline=3;md5=780868e7b566313e70cb701560ca95ef"
7
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08008SRC_URI = "http://ftp.linux.org.uk/pub/linux/Networking/netkit/${BP}.tar.gz \
Brad Bishop6e60e8b2018-02-01 10:27:11 -05009 file://To-aviod-buffer-overflow-in-telnet.patch \
10 file://Warning-fix-in-the-step-of-install.patch \
11 file://telnet-xinetd \
12 file://cross-compile.patch \
13 file://0001-telnet-telnetd-Fix-print-format-strings.patch \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080014 file://0001-telnet-telnetd-Fix-deadlock-on-cleanup.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050015 file://CVE-2020-10188.patch \
Andrew Geissler748a4832020-07-24 16:24:21 -050016 file://0001-telnetd-utility.c-Fix-buffer-overflow-in-netoprintf.patch \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050017 "
Patrick Williamsb48b7b42016-08-17 15:04:38 -050018
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080019UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/n/netkit-telnet/"
20UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.orig\.tar"
21
Patrick Williamsb48b7b42016-08-17 15:04:38 -050022EXTRA_OEMAKE = "INSTALLROOT=${D} SBINDIR=${sbindir} DAEMONMODE=755 \
23 MANMODE=644 MANDIR=${mandir}"
24
25do_configure () {
26 ./configure --prefix=${prefix}
27 sed -e 's#^CFLAGS=\(.*\)$#CFLAGS= -D_GNU_SOURCE \1#' \
28 -e 's#^CXXFLAGS=\(.*\)$#CXXFLAGS= -D_GNU_SOURCE \1#' \
29 -e 's#^LDFLAGS=.*$#LDFLAGS= ${LDFLAGS}#' \
30 -i MCONFIG
31}
32
33do_compile () {
34 oe_runmake 'CC=${CC}' 'LD=${LD}' 'LDFLAGS=${LDFLAGS}' SUB=telnet
35 oe_runmake 'CC=${CC}' 'LD=${LD}' 'LDFLAGS=${LDFLAGS}' LIBS=-lutil SUB=telnetd
36 oe_runmake 'CC=${CC}' 'LD=${LD}' 'LDFLAGS=${LDFLAGS}' SUB=telnetlogin
37}
38
39do_install () {
40 install -d ${D}${bindir}
41 install -m 0755 telnet/telnet ${D}${bindir}/telnet.${PN}
42 install -d ${D}${sbindir}
43 install -d ${D}${mandir}/man1
44 install -d ${D}${mandir}/man5
45 install -d ${D}${mandir}/man8
46 oe_runmake SUB=telnetd install
47 rm -rf ${D}${mandir}/man1
48 install -D -m 4750 ${B}/telnetlogin/telnetlogin ${D}/${libdir}/telnetlogin
49 # fix up hardcoded paths
50 sed -i -e 's,/usr/sbin/,${sbindir}/,' ${WORKDIR}/telnet-xinetd
51 install -d ${D}/etc/xinetd.d/
52 install -p -m644 ${WORKDIR}/telnet-xinetd ${D}/etc/xinetd.d/telnet
53}
54
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080055inherit update-alternatives
Patrick Williamsb48b7b42016-08-17 15:04:38 -050056
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080057ALTERNATIVE_PRIORITY = "100"
58ALTERNATIVE_${PN} = "telnet"
59ALTERNATIVE_LINK_NAME[telnet] = "${bindir}/telnet"
60ALTERNATIVE_TARGET[telnet] = "${bindir}/telnet.${PN}"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050061
Andrew Geissler82c905d2020-04-13 13:39:40 -050062ALTERNATIVE_${PN}-doc = "telnetd.8"
63ALTERNATIVE_LINK_NAME[telnetd.8] = "${mandir}/man8/telnetd.8"
64
Patrick Williamsb48b7b42016-08-17 15:04:38 -050065SRC_URI[md5sum] = "d6beabaaf53fe6e382c42ce3faa05a36"
66SRC_URI[sha256sum] = "9c80d5c7838361a328fb6b60016d503def9ce53ad3c589f3b08ff71a2bb88e00"
67FILES_${PN} += "${sbindir}/in.* ${libdir}/* ${sysconfdir}/xinetd.d/*"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080068
69# http://errors.yoctoproject.org/Errors/Details/186954/
Brad Bishop0f291cc2019-09-01 15:16:57 -040070COMPATIBLE_HOST_libc-musl = 'null'
Brad Bishop15ae2502019-06-18 21:44:24 -040071RCONFLICTS_${PN} = "inetutils-telnetd"