blob: e28eeae491ec357e1d15082e060826593cf289ec [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
Andrew Geissler32b11992021-03-31 13:37:05 -05008SRC_URI = "${DEBIAN_MIRROR}/main/n/netkit-telnet/netkit-telnet_${PV}.orig.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 \
Andrew Geissler87f5cff2022-09-30 13:13:31 -050017 file://0001-utility-Include-time.h-form-time-and-strftime-protot.patch \
Andrew Geisslerc5535c92023-01-27 16:10:19 -060018 file://0001-Drop-using-register-keyword.patch \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050019 "
Patrick Williamsb48b7b42016-08-17 15:04:38 -050020
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080021UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/n/netkit-telnet/"
22UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.orig\.tar"
23
Patrick Williamsb48b7b42016-08-17 15:04:38 -050024EXTRA_OEMAKE = "INSTALLROOT=${D} SBINDIR=${sbindir} DAEMONMODE=755 \
25 MANMODE=644 MANDIR=${mandir}"
26
27do_configure () {
28 ./configure --prefix=${prefix}
29 sed -e 's#^CFLAGS=\(.*\)$#CFLAGS= -D_GNU_SOURCE \1#' \
30 -e 's#^CXXFLAGS=\(.*\)$#CXXFLAGS= -D_GNU_SOURCE \1#' \
31 -e 's#^LDFLAGS=.*$#LDFLAGS= ${LDFLAGS}#' \
32 -i MCONFIG
33}
34
35do_compile () {
36 oe_runmake 'CC=${CC}' 'LD=${LD}' 'LDFLAGS=${LDFLAGS}' SUB=telnet
37 oe_runmake 'CC=${CC}' 'LD=${LD}' 'LDFLAGS=${LDFLAGS}' LIBS=-lutil SUB=telnetd
38 oe_runmake 'CC=${CC}' 'LD=${LD}' 'LDFLAGS=${LDFLAGS}' SUB=telnetlogin
39}
40
41do_install () {
42 install -d ${D}${bindir}
43 install -m 0755 telnet/telnet ${D}${bindir}/telnet.${PN}
44 install -d ${D}${sbindir}
45 install -d ${D}${mandir}/man1
46 install -d ${D}${mandir}/man5
47 install -d ${D}${mandir}/man8
48 oe_runmake SUB=telnetd install
49 rm -rf ${D}${mandir}/man1
50 install -D -m 4750 ${B}/telnetlogin/telnetlogin ${D}/${libdir}/telnetlogin
51 # fix up hardcoded paths
52 sed -i -e 's,/usr/sbin/,${sbindir}/,' ${WORKDIR}/telnet-xinetd
53 install -d ${D}/etc/xinetd.d/
54 install -p -m644 ${WORKDIR}/telnet-xinetd ${D}/etc/xinetd.d/telnet
55}
56
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080057inherit update-alternatives
Patrick Williamsb48b7b42016-08-17 15:04:38 -050058
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080059ALTERNATIVE_PRIORITY = "100"
Patrick Williams213cb262021-08-07 19:21:33 -050060ALTERNATIVE:${PN} = "telnet"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080061ALTERNATIVE_LINK_NAME[telnet] = "${bindir}/telnet"
62ALTERNATIVE_TARGET[telnet] = "${bindir}/telnet.${PN}"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050063
Patrick Williams213cb262021-08-07 19:21:33 -050064ALTERNATIVE:${PN}-doc = "telnetd.8"
Andrew Geissler82c905d2020-04-13 13:39:40 -050065ALTERNATIVE_LINK_NAME[telnetd.8] = "${mandir}/man8/telnetd.8"
66
Patrick Williamsb48b7b42016-08-17 15:04:38 -050067SRC_URI[md5sum] = "d6beabaaf53fe6e382c42ce3faa05a36"
68SRC_URI[sha256sum] = "9c80d5c7838361a328fb6b60016d503def9ce53ad3c589f3b08ff71a2bb88e00"
Patrick Williams213cb262021-08-07 19:21:33 -050069FILES:${PN} += "${sbindir}/in.* ${libdir}/* ${sysconfdir}/xinetd.d/*"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080070
71# http://errors.yoctoproject.org/Errors/Details/186954/
Patrick Williams213cb262021-08-07 19:21:33 -050072COMPATIBLE_HOST:libc-musl = 'null'
73RCONFLICTS:${PN} = "inetutils-telnetd"