Gentoo Archives: gentoo-commits

From: Patrick McLean <chutzpah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-firewall/ebtables/
Date: Sat, 09 May 2020 02:55:07
Message-Id: 1588992891.6958be66cd5dd6d8f6c26ba94ecc48ef40299e16.chutzpah@gentoo
1 commit: 6958be66cd5dd6d8f6c26ba94ecc48ef40299e16
2 Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com>
3 AuthorDate: Sat May 9 02:51:30 2020 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Sat May 9 02:54:51 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6958be66
7
8 net-firewall/ebtables-2.0.11-r1: Revbump, support eselect-arptables
9
10 Copyright: Sony Interactive Entertainment Inc.
11 Package-Manager: Portage-2.3.99, Repoman-2.3.22
12 Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
13
14 net-firewall/ebtables/ebtables-2.0.11-r1.ebuild | 106 ++++++++++++++++++++++++
15 1 file changed, 106 insertions(+)
16
17 diff --git a/net-firewall/ebtables/ebtables-2.0.11-r1.ebuild b/net-firewall/ebtables/ebtables-2.0.11-r1.ebuild
18 new file mode 100644
19 index 00000000000..4090f230c80
20 --- /dev/null
21 +++ b/net-firewall/ebtables/ebtables-2.0.11-r1.ebuild
22 @@ -0,0 +1,106 @@
23 +# Copyright 1999-2020 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=7
27 +
28 +inherit toolchain-funcs autotools
29 +
30 +MY_PV="$(ver_rs 3 '-' )"
31 +MY_P="${PN}-${MY_PV}"
32 +
33 +DESCRIPTION="Controls Ethernet frame filtering on a Linux bridge, MAC NAT and brouting"
34 +HOMEPAGE="http://ebtables.sourceforge.net/"
35 +SRC_URI="ftp://ftp.netfilter.org/pub/${PN}/${MY_P}.tar.gz"
36 +S="${WORKDIR}/${MY_P}"
37 +
38 +LICENSE="GPL-2"
39 +SLOT="0"
40 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
41 +IUSE="+perl static"
42 +
43 +BDEPEND=">=app-eselect/eselect-iptables-20200508"
44 +# The ebtables-save script is written in perl.
45 +RDEPEND="${BDEPEND}
46 + perl? ( dev-lang/perl )
47 + net-misc/ethertypes"
48 +
49 +PATCHES=(
50 + "${FILESDIR}/${PN}-2.0.11-makefile.patch"
51 +
52 + # Enhance ebtables-save to take table names as parameters bug #189315
53 + "${FILESDIR}/${PN}-2.0.11-ebt-save.patch"
54 +
55 + # from upstream git
56 + "${FILESDIR}/ebtables-2.0.11-remove-stray-atsign.patch"
57 +)
58 +
59 +pkg_setup() {
60 + if use static; then
61 + ewarn "You've chosen static build which is useful for embedded devices."
62 + ewarn "It has no init script. Make sure that's really what you want."
63 + fi
64 +}
65 +
66 +src_prepare() {
67 + default
68 +
69 + # don't install perl scripts if USE=perl is disabled
70 + if ! use perl; then
71 + sed -e '/sbin_SCRIPTS/ d' -i Makefile.am || die
72 + fi
73 +
74 + eautoreconf
75 +}
76 +
77 +src_configure() {
78 + econf \
79 + --bindir="/bin" \
80 + --sbindir="/sbin" \
81 + --libdir=/$(get_libdir)/${PN} \
82 + --sysconfdir="/usr/share/doc/${PF}" \
83 + $(use_enable static)
84 +}
85 +
86 +src_compile() {
87 + emake $(usex static 'static ebtables-legacy.8' '')
88 +}
89 +
90 +src_install() {
91 + local -a DOCS=( ChangeLog THANKS )
92 +
93 + if ! use static; then
94 + emake DESTDIR="${D}" install
95 + keepdir /var/lib/ebtables/
96 + newinitd "${FILESDIR}"/ebtables.initd-r1 ebtables
97 + newconfd "${FILESDIR}"/ebtables.confd-r1 ebtables
98 +
99 + find "${D}" -name '*.la' -type f -delete || die
100 + else
101 + into /
102 + newsbin static ebtables
103 + insinto /etc
104 + doins ethertypes
105 + fi
106 +
107 + newman ebtables-legacy.8 ebtables.8
108 + einstalldocs
109 +}
110 +
111 +pkg_postinst() {
112 + if ! eselect ebtables show &>/dev/null; then
113 + elog "Current ebtables implementation is unset, setting to ebtables-legacy"
114 + eselect ebtables set ebtables-legacy
115 + fi
116 +
117 + eselect ebtables show
118 +}
119 +
120 +pkg_prerm() {
121 + if has_version 'net-firewall/iptables[nftables]'; then
122 + elog "Resetting ebtables symlinks to xtables-nft-multi before removal"
123 + eselect ebtables set xtables-nft-multi
124 + else
125 + elog "Unsetting ebtables symlinks before removal"
126 + eselect ebtables unset
127 + fi
128 +}