# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 inherit toolchain-funcs DESCRIPTION="Port of the OpenBSD TFTP server" HOMEPAGE="https://www.kernel.org/pub/software/network/tftp/" SRC_URI="https://www.kernel.org/pub/software/network/tftp/${PN}/${P}.tar.xz" LICENSE="BSD-4" SLOT="0" KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" IUSE="ipv6 readline selinux tcpd +client +server" DEPEND=" readline? ( sys-libs/readline:0= ) tcpd? ( sys-apps/tcp-wrappers ) " RDEPEND="${DEPEND} selinux? ( sec-policy/selinux-tftp ) !net-ftp/atftp client? ( !net-misc/inetutils[tftp(+)] ) server? ( !net-misc/inetutils[tftpd(+)] !net-misc/iputils[tftpd(-)] !net-ftp/uftpd ) " PATCHES=( ) src_configure() { local myconf=( ac_cv_search_bsd_signal=no $(use_enable ipv6) $(use_enable tcpd tcpwrappers) $(use_enable readline) ) econf "${myconf[@]}" } src_compile() { emake version.h emake -C lib emake -C common if use client; then emake -C tftp fi if use server; then emake -C tftpd fi } src_install() { dodoc README* CHANGES tftpd/sample.rules if use client; then emake INSTALLROOT="${D}" -C tftp install fi if use server; then emake INSTALLROOT="${D}" -C tftpd install newconfd "${FILESDIR}"/in.tftpd.confd-0.44 in.tftpd newinitd "${FILESDIR}"/in.tftpd.rc6 in.tftpd insinto /etc/xinetd.d newins "${FILESDIR}"/tftp.xinetd tftp fi }