Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-ftp/tftp-hpa/
Date: Wed, 26 Aug 2020 17:50:17
Message-Id: 1598464194.fe9f358f88c12896b1dd4203aeb14f280282c014.floppym@gentoo
1 commit: fe9f358f88c12896b1dd4203aeb14f280282c014
2 Author: Oz N Tiram <oz.tiram <AT> gmail <DOT> com>
3 AuthorDate: Wed Aug 5 20:45:38 2020 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 26 17:49:54 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe9f358f
7
8 net-ftp/tftp-hpa: bump EAPI and split the package
9
10 Now a user can install either the tftp client or the tftp server
11 or both. This is controlled by use flags. By default both are installed,
12 so this keeps backwards compatibility.
13
14 Closes: https://github.com/gentoo/gentoo/pull/17023
15 Package-Manager: Portage-2.3.103, Repoman-2.3.23
16 Signed-off-by: Oz Tiram <oz.tiram <AT> gmail.com>
17 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
18
19 net-ftp/tftp-hpa/metadata.xml | 4 ++
20 net-ftp/tftp-hpa/tftp-hpa-5.2-r2.ebuild | 78 +++++++++++++++++++++++++++++++++
21 2 files changed, 82 insertions(+)
22
23 diff --git a/net-ftp/tftp-hpa/metadata.xml b/net-ftp/tftp-hpa/metadata.xml
24 index 56c12441305..e56bfe22863 100644
25 --- a/net-ftp/tftp-hpa/metadata.xml
26 +++ b/net-ftp/tftp-hpa/metadata.xml
27 @@ -5,4 +5,8 @@
28 <email>base-system@g.o</email>
29 <name>Gentoo Base System</name>
30 </maintainer>
31 +<use>
32 + <flag name="client">Compile and install the tftp client</flag>
33 + <flag name="server">Compile and install the tftp server</flag>
34 +</use>
35 </pkgmetadata>
36
37 diff --git a/net-ftp/tftp-hpa/tftp-hpa-5.2-r2.ebuild b/net-ftp/tftp-hpa/tftp-hpa-5.2-r2.ebuild
38 new file mode 100644
39 index 00000000000..239a1184ef6
40 --- /dev/null
41 +++ b/net-ftp/tftp-hpa/tftp-hpa-5.2-r2.ebuild
42 @@ -0,0 +1,78 @@
43 +# Copyright 1999-2020 Gentoo Authors
44 +# Distributed under the terms of the GNU General Public License v2
45 +
46 +EAPI="7"
47 +
48 +inherit systemd toolchain-funcs
49 +
50 +DESCRIPTION="port of the OpenBSD TFTP server"
51 +HOMEPAGE="https://www.kernel.org/pub/software/network/tftp/"
52 +SRC_URI="https://www.kernel.org/pub/software/network/tftp/${PN}/${P}.tar.xz"
53 +
54 +LICENSE="BSD-4"
55 +SLOT="0"
56 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-macos"
57 +IUSE="ipv6 readline selinux tcpd +client +server"
58 +
59 +CDEPEND="
60 + readline? ( sys-libs/readline:0= )
61 + tcpd? ( sys-apps/tcp-wrappers )
62 + "
63 +
64 +DEPEND="${CDEPEND}
65 + app-arch/xz-utils
66 + !net-ftp/atftp
67 + !net-ftp/uftpd"
68 +
69 +RDEPEND="${CDEPEND}
70 + selinux? ( sec-policy/selinux-tftp )"
71 +
72 +PATCHES=(
73 + "${FILESDIR}"/tftp-hpa-5.2-gcc-10.patch
74 +)
75 +
76 +src_prepare() {
77 + eapply_user
78 + sed -i "/^AR/s:ar:$(tc-getAR):" MCONFIG.in || die
79 +}
80 +
81 +src_configure() {
82 + econf \
83 + $(use_with ipv6) \
84 + $(use_with tcpd tcpwrappers) \
85 + $(use_with readline)
86 +}
87 +
88 +src_compile() {
89 + emake version.h
90 + emake -C lib
91 + emake -C common
92 + if use client; then
93 + emake -C tftp
94 + fi
95 + if use server; then
96 + emake -C tftpd
97 + fi
98 +}
99 +
100 +src_install() {
101 + dodoc README* CHANGES tftpd/sample.rules
102 +
103 + if use client; then
104 + emake INSTALLROOT="${D}" -C tftp install
105 + fi
106 + if use server; then
107 + emake INSTALLROOT="${D}" -C tftpd install
108 +
109 + rm "${ED}"/usr/share/man/man8/tftpd.8 || die
110 +
111 + newconfd "${FILESDIR}"/in.tftpd.confd-0.44 in.tftpd
112 + newinitd "${FILESDIR}"/in.tftpd.rc6 in.tftpd
113 +
114 + systemd_dounit "${FILESDIR}"/tftp.service
115 + systemd_dounit "${FILESDIR}"/tftp.socket
116 +
117 + insinto /etc/xinetd.d
118 + newins "${FILESDIR}"/tftp.xinetd tftp
119 + fi
120 +}