1 |
commit: 48b6b55aefb25bfe50d9f09e04f2ae52c492ecba |
2 |
Author: Mike Frysinger <vapier <AT> chromium <DOT> org> |
3 |
AuthorDate: Tue Feb 9 15:37:30 2021 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Feb 9 15:58:03 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=48b6b55a |
7 |
|
8 |
net-firewall/ebtables: fix path to /etc/ethertypes #765679 |
9 |
|
10 |
The --sysconfdir setting controls where ebtables looks for ethertypes, |
11 |
so don't use /usr/share/doc/ which is not guaranteed to exist, and is |
12 |
not where the ethertypes package installs its config. Switch back to |
13 |
the standard /etc path instead. |
14 |
|
15 |
This path logic was prob a mistake as part of the upgrade from the old |
16 |
2.0.10.4 ebuild that had a similar named setting (SYSCONFIGDIR) but a |
17 |
different meaning which we wanted to install into /usr/share/doc/. |
18 |
|
19 |
Fixes: https://bugs.gentoo.org/765679 |
20 |
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org> |
21 |
|
22 |
net-firewall/ebtables/ebtables-2.0.11-r3.ebuild | 107 ++++++++++++++++++++++++ |
23 |
1 file changed, 107 insertions(+) |
24 |
|
25 |
diff --git a/net-firewall/ebtables/ebtables-2.0.11-r3.ebuild b/net-firewall/ebtables/ebtables-2.0.11-r3.ebuild |
26 |
new file mode 100644 |
27 |
index 00000000000..798135864de |
28 |
--- /dev/null |
29 |
+++ b/net-firewall/ebtables/ebtables-2.0.11-r3.ebuild |
30 |
@@ -0,0 +1,107 @@ |
31 |
+# Copyright 1999-2021 Gentoo Authors |
32 |
+# Distributed under the terms of the GNU General Public License v2 |
33 |
+ |
34 |
+EAPI="7" |
35 |
+ |
36 |
+inherit autotools |
37 |
+ |
38 |
+MY_PV="$(ver_rs 3 '-' )" |
39 |
+MY_P="${PN}-${MY_PV}" |
40 |
+ |
41 |
+DESCRIPTION="Controls Ethernet frame filtering on a Linux bridge, MAC NAT and brouting" |
42 |
+HOMEPAGE="https://ebtables.netfilter.org/" |
43 |
+SRC_URI="http://ftp.netfilter.org/pub/${PN}/${MY_P}.tar.gz" |
44 |
+S="${WORKDIR}/${MY_P}" |
45 |
+ |
46 |
+LICENSE="GPL-2" |
47 |
+SLOT="0" |
48 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86" |
49 |
+IUSE="+perl static" |
50 |
+ |
51 |
+BDEPEND=">=app-eselect/eselect-iptables-20200508" |
52 |
+# The ebtables-save script is written in perl. |
53 |
+RDEPEND="${BDEPEND} |
54 |
+ perl? ( dev-lang/perl ) |
55 |
+ net-misc/ethertypes" |
56 |
+ |
57 |
+PATCHES=( |
58 |
+ "${FILESDIR}/${PN}-2.0.11-makefile.patch" |
59 |
+ |
60 |
+ # Enhance ebtables-save to take table names as parameters bug #189315 |
61 |
+ "${FILESDIR}/${PN}-2.0.11-ebt-save.patch" |
62 |
+ |
63 |
+ # from upstream git |
64 |
+ "${FILESDIR}/ebtables-2.0.11-remove-stray-atsign.patch" |
65 |
+) |
66 |
+ |
67 |
+pkg_setup() { |
68 |
+ if use static; then |
69 |
+ ewarn "You've chosen static build which is useful for embedded devices." |
70 |
+ ewarn "It has no init script. Make sure that's really what you want." |
71 |
+ fi |
72 |
+} |
73 |
+ |
74 |
+src_prepare() { |
75 |
+ default |
76 |
+ |
77 |
+ # Don't install perl scripts if USE=perl is disabled. |
78 |
+ if ! use perl; then |
79 |
+ sed -i -e '/^sbin_SCRIPTS/ d' Makefile.am || die |
80 |
+ fi |
81 |
+ |
82 |
+ # The bundled autotools are borked, so force a rebuild. |
83 |
+ eautoreconf |
84 |
+} |
85 |
+ |
86 |
+src_configure() { |
87 |
+ econf \ |
88 |
+ --bindir="/bin" \ |
89 |
+ --sbindir="/sbin" \ |
90 |
+ --libdir="/$(get_libdir)/${PN}" \ |
91 |
+ $(use_enable static) |
92 |
+} |
93 |
+ |
94 |
+src_compile() { |
95 |
+ emake $(usex static 'static ebtables-legacy.8' '') |
96 |
+} |
97 |
+ |
98 |
+src_install() { |
99 |
+ local -a DOCS=( ChangeLog THANKS ) |
100 |
+ |
101 |
+ if ! use static; then |
102 |
+ emake DESTDIR="${D}" install |
103 |
+ keepdir /var/lib/ebtables/ |
104 |
+ newinitd "${FILESDIR}"/ebtables.initd-r1 ebtables |
105 |
+ newconfd "${FILESDIR}"/ebtables.confd-r1 ebtables |
106 |
+ |
107 |
+ find "${D}" -name '*.la' -type f -delete || die |
108 |
+ |
109 |
+ # The ethertypes package installs this for us. |
110 |
+ rm "${ED}"/etc/ethertypes || die |
111 |
+ else |
112 |
+ into / |
113 |
+ newsbin static ebtables |
114 |
+ fi |
115 |
+ |
116 |
+ newman ebtables-legacy.8 ebtables.8 |
117 |
+ einstalldocs |
118 |
+} |
119 |
+ |
120 |
+pkg_postinst() { |
121 |
+ if ! eselect ebtables show &>/dev/null; then |
122 |
+ elog "Current ebtables implementation is unset, setting to ebtables-legacy" |
123 |
+ eselect ebtables set ebtables-legacy |
124 |
+ fi |
125 |
+ |
126 |
+ eselect ebtables show |
127 |
+} |
128 |
+ |
129 |
+pkg_prerm() { |
130 |
+ if [[ -z ${REPLACED_BY_VERSION} ]] && has_version 'net-firewall/iptables[nftables]'; then |
131 |
+ elog "Resetting ebtables symlinks to xtables-nft-multi before removal" |
132 |
+ eselect ebtables set xtables-nft-multi |
133 |
+ else |
134 |
+ elog "Unsetting ebtables symlinks before removal" |
135 |
+ eselect ebtables unset |
136 |
+ fi |
137 |
+} |