*/*: Discontinue Gentoo SuperH port
[gentoo.git] / net-misc / netkit-rsh / netkit-rsh-0.17-r10.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="4"
5
6 inherit eutils pam toolchain-funcs fcaps
7
8 PATCHVER="3"
9 DESCRIPTION="Netkit's Remote Shell Suite: rexec{,d} rlogin{,d} rsh{,d}"
10 HOMEPAGE="ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/"
11 SRC_URI="ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/${P}.tar.gz
12         mirror://gentoo/rexec-1.5.tar.gz
13         mirror://gentoo/${P}-patches-${PATCHVER}.tar.lzma"
14
15 LICENSE="BSD"
16 SLOT="0"
17 KEYWORDS="~alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux"
18 IUSE="pam"
19
20 RDEPEND=">=sys-libs/ncurses-5.2
21         pam? ( >=sys-auth/pambase-20080219.1 )"
22 DEPEND="${RDEPEND}
23         app-arch/xz-utils"
24
25 FILECAPS=(
26         cap_net_bind_service usr/bin/r{cp,login,sh}
27 )
28
29 src_unpack() {
30         default
31
32         cd "${S}"
33         rm -rf rexec
34         mv ../rexec rexec
35 }
36
37 src_prepare() {
38         [[ -n ${PATCHVER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
39
40         if tc-is-cross-compiler ; then
41                 # Can't do runtime tests when cross-compiling
42                 sed -i -e "s|./__conftest|: ./__conftest|" configure
43         fi
44 }
45
46 src_configure() {
47         tc-export CC
48         ${CONFIG_SHELL:-/bin/sh} ./configure $(usex pam '' '--without-pam') || die
49
50         sed -i \
51                 -e "s:-pipe -O2:${CFLAGS}:" \
52                 -e "/^LDFLAGS=$/d" \
53                 -e "s:-Wpointer-arith::" \
54                 MCONFIG || die
55 }
56
57 src_install() {
58         local b exe
59         insinto /etc/xinetd.d
60         for b in rcp rexec{,d} rlogin{,d} rsh{,d} ; do
61                 if [[ ${b} == *d ]] ; then
62                         dosbin ${b}/${b}
63                         dosym ${b} /usr/sbin/in.${b}
64                         doman ${b}/${b}.8
65                 else
66                         dobin ${b}/${b}
67                         doman ${b}/${b}.1
68                         if [[ ${b} != "rcp" ]]; then
69                                 newins "${FILESDIR}"/${b}.xinetd ${b}
70                                 newpamd "${FILESDIR}/${b}.pamd-pambase" ${b}
71                         fi
72                 fi
73         done
74         dodoc README ChangeLog BUGS
75         newdoc rexec/README README.rexec
76 }