ebtables: upgraded package to upstream

Upgraded net-firewall/ebtables to version 2.0.11-r3.

BUG=b:179521281
TEST=Compiled ebtables successfully.

Change-Id: I274b6fe66e0e5c1277a4dbc763fab42001302504
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/overlays/portage-stable/+/2717688
Commit-Queue: Shiva Sai Kothapalli <kshivasai@google.com>
Tested-by: Shiva Sai Kothapalli <kshivasai@google.com>
Reviewed-by: Raju Konduru <rkonduru@google.com>
Reviewed-by: Kishan Kunduru <kkunduru@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
(cherry picked from commit 48d6d15b33d6fdb352d8a0f7d62bc20f1c7b937c)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/overlays/portage-stable/+/2717571
Reviewed-by: SHAMANTHA KUMAR PERAMACHANAHALLI RAMARAO <shamanthakumar@google.com>
Tested-by: SHAMANTHA KUMAR PERAMACHANAHALLI RAMARAO <shamanthakumar@google.com>
Commit-Queue: Kishan Kunduru <kkunduru@chromium.org>
diff --git a/metadata/md5-cache/net-firewall/ebtables-2.0.11-r2 b/metadata/md5-cache/net-firewall/ebtables-2.0.11-r3
similarity index 82%
rename from metadata/md5-cache/net-firewall/ebtables-2.0.11-r2
rename to metadata/md5-cache/net-firewall/ebtables-2.0.11-r3
index fbda2f3..065fb39 100644
--- a/metadata/md5-cache/net-firewall/ebtables-2.0.11-r2
+++ b/metadata/md5-cache/net-firewall/ebtables-2.0.11-r3
@@ -3,12 +3,12 @@
 DEPEND=!<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4
 DESCRIPTION=Controls Ethernet frame filtering on a Linux bridge, MAC NAT and brouting
 EAPI=7
-HOMEPAGE=http://ebtables.sourceforge.net/
+HOMEPAGE=https://ebtables.netfilter.org/
 IUSE=+perl static
 KEYWORDS=*
 LICENSE=GPL-2
 RDEPEND=>=app-eselect/eselect-iptables-20200508 perl? ( dev-lang/perl ) net-misc/ethertypes
 SLOT=0
-SRC_URI=ftp://ftp.netfilter.org/pub/ebtables/ebtables-2.0.11.tar.gz
+SRC_URI=http://ftp.netfilter.org/pub/ebtables/ebtables-2.0.11.tar.gz
 _eclasses_=autotools	d0e5375d47f4c809f406eb892e531513	libtool	f143db5a74ccd9ca28c1234deffede96	multilib	2477ebe553d3e4d2c606191fe6c33602	toolchain-funcs	605c126bed8d87e4378d5ff1645330cb
-_md5_=da0a0e77269e7420e7ccd340a5c5ba83
+_md5_=c0c06bd214991bf05b2e09a690c63704
diff --git a/net-firewall/ebtables/ebtables-2.0.11-r2.ebuild b/net-firewall/ebtables/ebtables-2.0.11-r3.ebuild
similarity index 80%
rename from net-firewall/ebtables/ebtables-2.0.11-r2.ebuild
rename to net-firewall/ebtables/ebtables-2.0.11-r3.ebuild
index 97a7ab8..6f447b7 100644
--- a/net-firewall/ebtables/ebtables-2.0.11-r2.ebuild
+++ b/net-firewall/ebtables/ebtables-2.0.11-r3.ebuild
@@ -1,16 +1,16 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI="7"
 
-inherit toolchain-funcs autotools
+inherit autotools
 
 MY_PV="$(ver_rs 3 '-' )"
 MY_P="${PN}-${MY_PV}"
 
 DESCRIPTION="Controls Ethernet frame filtering on a Linux bridge, MAC NAT and brouting"
-HOMEPAGE="http://ebtables.sourceforge.net/"
-SRC_URI="ftp://ftp.netfilter.org/pub/${PN}/${MY_P}.tar.gz"
+HOMEPAGE="https://ebtables.netfilter.org/"
+SRC_URI="http://ftp.netfilter.org/pub/${PN}/${MY_P}.tar.gz"
 S="${WORKDIR}/${MY_P}"
 
 LICENSE="GPL-2"
@@ -44,11 +44,12 @@
 src_prepare() {
 	default
 
-	# don't install perl scripts if USE=perl is disabled
+	# Don't install perl scripts if USE=perl is disabled.
 	if ! use perl; then
-		sed -e '/sbin_SCRIPTS/ d' -i Makefile.am || die
+		sed -i -e '/^sbin_SCRIPTS/ d' Makefile.am || die
 	fi
 
+	# The bundled autotools are borked, so force a rebuild.
 	eautoreconf
 }
 
@@ -56,8 +57,7 @@
 	econf \
 		--bindir="/bin" \
 		--sbindir="/sbin" \
-		--libdir=/$(get_libdir)/${PN} \
-		--sysconfdir="/usr/share/doc/${PF}" \
+		--libdir="/$(get_libdir)/${PN}" \
 		$(use_enable static)
 }
 
@@ -70,21 +70,20 @@
 
 	if ! use static; then
 		emake DESTDIR="${D}" install
-		keepdir /var/lib/ebtables/
 		newinitd "${FILESDIR}"/ebtables.initd-r1 ebtables
 		newconfd "${FILESDIR}"/ebtables.confd-r1 ebtables
 
 		find "${D}" -name '*.la' -type f -delete || die
+
+		# The ethertypes package installs this for us.
+		rm "${ED}"/etc/ethertypes || die
 	else
 		into /
 		newsbin static ebtables
-		insinto /etc
-		doins ethertypes
 	fi
 
 	newman ebtables-legacy.8 ebtables.8
 	einstalldocs
-	docompress -x /usr/share/doc/${PF}/ethertypes #724138
 }
 
 pkg_postinst() {
diff --git a/net-firewall/ebtables/files/ebtables.confd-r1 b/net-firewall/ebtables/files/ebtables.confd-r1
index 645b26e..8e83c81 100644
--- a/net-firewall/ebtables/files/ebtables.confd-r1
+++ b/net-firewall/ebtables/files/ebtables.confd-r1
@@ -9,3 +9,11 @@
 
 # Save state on stopping ebtables
 SAVE_ON_STOP="yes"
+
+# If you need to log iptables messages as soon as iptables starts,
+# AND your logger does NOT depend on the network, then you may wish
+# to uncomment the next line.
+# If your logger depends on the network, and you uncomment this line
+# you will create an unresolvable circular dependency during startup.
+# After commenting or uncommenting this line, you must run 'rc-update -u'.
+#rc_use="logger"
diff --git a/net-firewall/ebtables/files/ebtables.initd-r1 b/net-firewall/ebtables/files/ebtables.initd-r1
index 6608760..bdc0987 100644
--- a/net-firewall/ebtables/files/ebtables.initd-r1
+++ b/net-firewall/ebtables/files/ebtables.initd-r1
@@ -1,5 +1,5 @@
 #!/sbin/openrc-run
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 extra_commands="save panic"
@@ -10,10 +10,10 @@
 
 depend() {
 	before net
-	use logger
 }
 
 ebtables_tables() {
+	local table
 	for table in filter nat broute; do
 		if ${ebtables_bin} -t ${table} -L > /dev/null 2>&1; then
 			printf '%s' "${table} "
@@ -80,8 +80,8 @@
 
 save() {
 	ebegin "Saving ebtables state"
-	touch "${ebtables_save}"
-	chmod 0600 "${ebtables_save}"
+	checkpath -d -m 0755 "${ebtables_save%/*}"
+	checkpath -f -m 0600 "${ebtables_save}"
 	${ebtables_bin}-save $(ebtables_tables) ${SAVE_RESTORE_OPTIONS} > "${ebtables_save}"
 	eend $?
 }