commit:     fe9f358f88c12896b1dd4203aeb14f280282c014
Author:     Oz N Tiram <oz.tiram <AT> gmail <DOT> com>
AuthorDate: Wed Aug  5 20:45:38 2020 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Wed Aug 26 17:49:54 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe9f358f

net-ftp/tftp-hpa: bump EAPI and split the package

Now a user can install either the tftp client or the tftp server
or both. This is controlled by use flags. By default both are installed,
so this keeps backwards compatibility.

Closes: https://github.com/gentoo/gentoo/pull/17023
Package-Manager: Portage-2.3.103, Repoman-2.3.23
Signed-off-by: Oz Tiram <oz.tiram <AT> gmail.com>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 net-ftp/tftp-hpa/metadata.xml           |  4 ++
 net-ftp/tftp-hpa/tftp-hpa-5.2-r2.ebuild | 78 +++++++++++++++++++++++++++++++++
 2 files changed, 82 insertions(+)

diff --git a/net-ftp/tftp-hpa/metadata.xml b/net-ftp/tftp-hpa/metadata.xml
index 56c12441305..e56bfe22863 100644
--- a/net-ftp/tftp-hpa/metadata.xml
+++ b/net-ftp/tftp-hpa/metadata.xml
@@ -5,4 +5,8 @@
        <email>base-sys...@gentoo.org</email>
        <name>Gentoo Base System</name>
 </maintainer>
+<use>
+       <flag name="client">Compile and install the tftp client</flag>
+       <flag name="server">Compile and install the tftp server</flag>
+</use>
 </pkgmetadata>

diff --git a/net-ftp/tftp-hpa/tftp-hpa-5.2-r2.ebuild 
b/net-ftp/tftp-hpa/tftp-hpa-5.2-r2.ebuild
new file mode 100644
index 00000000000..239a1184ef6
--- /dev/null
+++ b/net-ftp/tftp-hpa/tftp-hpa-5.2-r2.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+inherit systemd 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 ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc 
~x86 ~ppc-macos"
+IUSE="ipv6 readline selinux tcpd +client +server"
+
+CDEPEND="
+       readline? ( sys-libs/readline:0= )
+       tcpd? ( sys-apps/tcp-wrappers )
+       "
+
+DEPEND="${CDEPEND}
+       app-arch/xz-utils
+       !net-ftp/atftp
+       !net-ftp/uftpd"
+
+RDEPEND="${CDEPEND}
+       selinux? ( sec-policy/selinux-tftp )"
+
+PATCHES=(
+       "${FILESDIR}"/tftp-hpa-5.2-gcc-10.patch
+)
+
+src_prepare() {
+       eapply_user
+       sed -i "/^AR/s:ar:$(tc-getAR):" MCONFIG.in || die
+}
+
+src_configure() {
+       econf \
+               $(use_with ipv6) \
+               $(use_with tcpd tcpwrappers) \
+               $(use_with readline)
+}
+
+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
+
+               rm "${ED}"/usr/share/man/man8/tftpd.8 || die
+
+               newconfd "${FILESDIR}"/in.tftpd.confd-0.44 in.tftpd
+               newinitd "${FILESDIR}"/in.tftpd.rc6 in.tftpd
+
+               systemd_dounit "${FILESDIR}"/tftp.service
+               systemd_dounit "${FILESDIR}"/tftp.socket
+
+               insinto /etc/xinetd.d
+               newins "${FILESDIR}"/tftp.xinetd tftp
+       fi
+}

Reply via email to