blob: 70fb4cf5fa1bce792d4ac6a7375f6d27ae3d5918 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001DESCRIPTION = "netkit-rsh includes the rsh daemon and client."
2SECTION = "net"
3HOMEPAGE="ftp://ftp.uk.linux.org/pub/linux/Networking/netkit"
4LICENSE = "BSD-4-Clause"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08005DEPENDS = "xinetd libgcrypt virtual/crypt"
Patrick Williamsb48b7b42016-08-17 15:04:38 -05006
7LIC_FILES_CHKSUM = "file://rsh/rsh.c;endline=32;md5=487b3c637bdc181d32b2a8543d41b606"
8
9SRC_URI = "${DEBIAN_MIRROR}/main/n/netkit-rsh/netkit-rsh_${PV}.orig.tar.gz;name=archive \
10 ${DEBIAN_MIRROR}/main/n/netkit-rsh/netkit-rsh_${PV}-15.diff.gz;name=patch15 \
11 file://rsh-redone_link_order_file.patch \
12 file://no_pam_build_fix.patch \
13 file://rexec.xinetd.netkit \
14 file://rlogin.xinetd.netkit \
15 file://rsh.xinetd.netkit \
16 file://netkit-rsh-0.17-rexec-ipv6.patch \
17 file://fix-host-variable.patch \
Patrick Williamsddad1a12017-02-23 20:36:32 -060018 file://fixup_wait3_api_change.patch \
Brad Bishopc342db32019-05-15 21:57:59 -040019 file://CVE-2019-7282-and-CVE-2019-7283.patch \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050020"
21
22SRC_URI[archive.md5sum] = "65f5f28e2fe22d9ad8b17bb9a10df096"
23SRC_URI[archive.sha256sum] = "edcac7fa18015f0bc04e573f3f54ae3b638d71335df1ad7dae692779914ad669"
24SRC_URI[patch15.md5sum] = "655efc0d541b03ca5de0ae506c805ea3"
25SRC_URI[patch15.sha256sum] = "2bc071c438e8b0ed42a0bd2db2d8b681b27a1e9b1798694d9874733293bc2aa9"
26
27# Other support files
28PAM_SRC_URI = "file://rexec.pam \
Patrick Williamsddad1a12017-02-23 20:36:32 -060029 file://rlogin.pam \
30 file://rsh.pam \
31"
32SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)}"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050033
Andrew Geisslera2681d92020-10-16 10:17:07 -050034inherit pkgconfig update-alternatives
Patrick Williamsb48b7b42016-08-17 15:04:38 -050035
36CFLAGS += " -D_GNU_SOURCE -Wno-deprecated-declarations"
37LDFLAGS += " -L${STAGING_LIBDIR} -lutil -lcrypt"
38
39PACKAGECONFIG ??= ""
Andrew Geissler89770b02020-06-13 10:40:47 -050040PACKAGECONFIG_append = " ${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050041PACKAGECONFIG[pam] = " , --without-pam, libpam, libpam"
42
Brad Bishop19323692019-04-05 15:28:33 -040043COMPATIBLE_HOST_libc-musl = 'null'
44
Patrick Williamsb48b7b42016-08-17 15:04:38 -050045do_configure () {
46 ./configure --prefix=${prefix} --exec-prefix=${exec_prefix}
47 echo "INSTALLROOT=${D}" > MCONFIG
48
Brad Bishop6e60e8b2018-02-01 10:27:11 -050049 if [ "${@bb.utils.filter('PACKAGECONFIG', 'pam', d)}" ]; then
Patrick Williamsb48b7b42016-08-17 15:04:38 -050050 echo "USE_PAM=1" >> MCONFIG
51 fi
52
53 # didn't want to patch these next changes
54 sed -i 's/netkit-//' ${S}/rsh/pathnames.h
55 sed -i 's/netkit-//' ${S}/rcp/pathnames.h
56}
57
58do_install () {
59 install -d ${D}${bindir}
60 install -d ${D}${sbindir}
61 install -d ${D}${mandir}/man1
62 install -d ${D}${mandir}/man8
63 install -d ${D}${sysconfdir}/xinetd.d
64
65 oe_runmake 'INSTALLROOT=${D}' 'BINMODE=0755' \
66 'DAEMONMODE=0755' 'MANMODE=0644' \
67 'SUIDMODE=4755' \
68 'BINDIR=${bindir}' 'SBINDIR=${sbindir}' \
69 'MANDIR=${mandir}' install
70
Brad Bishop6e60e8b2018-02-01 10:27:11 -050071 if [ "${@bb.utils.filter('PACKAGECONFIG', 'pam', d)}" ]; then
Patrick Williamsb48b7b42016-08-17 15:04:38 -050072 install -d ${D}${sysconfdir}/pam.d
73 install -m 0644 debian/hosts.equiv ${D}/${sysconfdir}
74 install -m 0644 ${WORKDIR}/rexec.pam ${D}/${sysconfdir}/pam.d/rexec
75 install -m 0644 ${WORKDIR}/rlogin.pam ${D}/${sysconfdir}/pam.d/rlogin
Brad Bishopd7bf8c12018-02-25 22:55:05 -050076 install -m 0644 ${WORKDIR}/rsh.pam ${D}/${sysconfdir}/pam.d/rsh
Patrick Williamsb48b7b42016-08-17 15:04:38 -050077 fi
78 cp ${WORKDIR}/rexec.xinetd.netkit ${D}/${sysconfdir}/xinetd.d/rexec
79 cp ${WORKDIR}/rlogin.xinetd.netkit ${D}/${sysconfdir}/xinetd.d/rlogin
80 cp ${WORKDIR}/rsh.xinetd.netkit ${D}/${sysconfdir}/xinetd.d/rsh
81}
82
83PACKAGES = "${PN}-client ${PN}-server ${PN}-doc ${BPN}-dbg"
84
85FILES_${PN}-client = "${bindir}/*"
86FILES_${PN}-server = "${sbindir}/* ${sysconfdir}"
87FILES_${PN}-doc = "${mandir}"
88FILES_${PN}-dbg = "${prefix}/src/debug \
89 ${sbindir}/.debug ${bindir}/.debug"
90
91ALTERNATIVE_PRIORITY = "80"
92ALTERNATIVE_${PN}-client = "rcp rexec rlogin rsh"
93ALTERNATIVE_${PN}-server = "rshd rexecd rlogind"
94ALTERNATIVE_LINK_NAME[server] = "${bindir}/rshd"
95ALTERNATIVE_TARGET[rshd] = "${sbindir}/in.rshd"
96ALTERNATIVE_LINK_NAME[rexecd] = "${bindir}/rexecd"
97ALTERNATIVE_TARGET[rexecd] = "${sbindir}/in.rexecd"
98ALTERNATIVE_LINK_NAME[rlogind] = "${bindir}/rlogind"
99ALTERNATIVE_TARGET[rlogind] = "${sbindir}/in.rlogind"
100
101RCONFLICTS_${PN}-server += "inetutils-rshd"
102RPROVIDES_${PN}-server = "rshd"
103
104RDEPENDS_${PN}-server = "xinetd"
105RDEPENDS_${PN}-server += "tcp-wrappers"