summaryrefslogtreecommitdiff
blob: f7e8097c0bcc148fc16e5946e373589f58a8a5e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit autotools toolchain-funcs

DESCRIPTION="Telnet and telnetd ported from OpenBSD with IPv6 support"
HOMEPAGE="ftp://ftp.suse.com/pub/people/kukuk/ipv6/"
SRC_URI="https://dev.gentoo.org/~mschiff/distfiles/${P}.tar.bz2"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
IUSE="nls xinetd"

RDEPEND="
	sys-libs/ncurses:=
	!net-misc/netkit-telnetd
"
RDEPEND="${DEPEND}
	xinetd? ( sys-apps/xinetd   )
	!net-misc/netkit-telnetd
"
BDEPEND="virtual/pkgconfig"

PATCHES=(
	"${FILESDIR}"/${P}-fbsd.patch
	"${FILESDIR}"/${PN}-1.2-format-security.patch
)

src_prepare() {
	default
	eautoreconf
}

src_configure() {
	# FreeBSD doesn't seem to support PIE neither does hppa
	if use kernel_FreeBSD; then
		export libc_cv_fpie="no"
	fi

	econf
}

src_compile() {
	emake LIBS="$("$(tc-getPKG_CONFIG)" --libs ncurses)"
}

src_install() {
	default

	if use xinetd ; then
		insinto /etc/xinetd.d
		newins "${FILESDIR}"/telnetd.xinetd telnetd
	fi
}