blob: 6f203c5a84457ee664907310b53add9607f91a8b [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001DESCRIPTION = "netkit-rsh includes the rsh daemon and client."
2SECTION = "net"
3HOMEPAGE="ftp://ftp.uk.linux.org/pub/linux/Networking/netkit"
4LICENSE = "BSD-4-Clause"
5DEPENDS = "xinetd libgcrypt virtual/crypt"
6
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 \
18 file://fixup_wait3_api_change.patch \
19 file://CVE-2019-7282-and-CVE-2019-7283.patch \
20"
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 \
29 file://rlogin.pam \
30 file://rsh.pam \
31"
32SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)}"
33
34inherit pkgconfig
35
36CFLAGS += " -D_GNU_SOURCE -Wno-deprecated-declarations"
37LDFLAGS += " -L${STAGING_LIBDIR} -lutil -lcrypt"
38
39PACKAGECONFIG ??= ""
40PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
41PACKAGECONFIG[pam] = " , --without-pam, libpam, libpam"
42
43COMPATIBLE_HOST_libc-musl = 'null'
44
45do_configure () {
46 ./configure --prefix=${prefix} --exec-prefix=${exec_prefix}
47 echo "INSTALLROOT=${D}" > MCONFIG
48
49 if [ "${@bb.utils.filter('PACKAGECONFIG', 'pam', d)}" ]; then
50 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
71 if [ "${@bb.utils.filter('PACKAGECONFIG', 'pam', d)}" ]; then
72 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
76 install -m 0644 ${WORKDIR}/rsh.pam ${D}/${sysconfdir}/pam.d/rsh
77 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"
106
107# http://errors.yoctoproject.org/Errors/Details/186963/
108EXCLUDE_FROM_WORLD_libc-musl = "1"