net-snmp: upgraded package to upstream

Upgraded net-analyzer/net-snmp to version 5.8.1_pre1-r1 on arm

BUG=chromium:1111336
TEST=CQ passes for lasilla-ground

Change-Id: I5c58267e1891c86e7203e16763094374f07c1a5f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/overlays/portage-stable/+/2341089
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Allen Webb <allenwebb@google.com>
diff --git a/metadata/md5-cache/net-analyzer/net-snmp-5.8-r4 b/metadata/md5-cache/net-analyzer/net-snmp-5.8-r4
deleted file mode 100644
index 552a62e..0000000
--- a/metadata/md5-cache/net-analyzer/net-snmp-5.8-r4
+++ /dev/null
@@ -1,15 +0,0 @@
-DEFINED_PHASES=compile configure install prepare setup test
-DEPEND=bzip2? ( app-arch/bzip2 ) elf? ( dev-libs/elfutils ) lm-sensors? ( sys-apps/lm-sensors ) mysql? ( dev-db/mysql-connector-c:0= ) netlink? ( dev-libs/libnl:3 ) pcap? ( net-libs/libpcap ) pci? ( sys-apps/pciutils ) perl? ( dev-lang/perl:= ) python? ( dev-python/setuptools[python_targets_python2_7(-)?,-python_single_target_pypy3(-),-python_single_target_python3_6(-),-python_single_target_python3_7(-),-python_single_target_python3_8(-),python_single_target_python2_7(+)?] python_single_target_python2_7? ( >=dev-lang/python-2.7.5-r2:2.7 ) >=dev-lang/python-exec-2:=[python_targets_python2_7(-)?,-python_single_target_pypy3(-),-python_single_target_python3_6(-),-python_single_target_python3_7(-),-python_single_target_python3_8(-),python_single_target_python2_7(+)?] ) rpm? ( app-arch/rpm dev-libs/popt ) ssl? ( !libressl? ( >=dev-libs/openssl-0.9.6d:0= ) libressl? ( dev-libs/libressl:= ) ) tcpd? ( >=sys-apps/tcp-wrappers-7.6 ) zlib? ( >=sys-libs/zlib-1.1.4 ) doc? ( app-doc/doxygen ) >=app-portage/elt-patches-20170815 !<sys-devel/gettext-0.18.1.1-r3 sys-devel/automake >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4 virtual/pkgconfig
-DESCRIPTION=Software for generating and retrieving SNMP data
-EAPI=6
-HOMEPAGE=http://www.net-snmp.org/
-IUSE=X bzip2 doc elf kmem ipv6 libressl lm-sensors mfd-rewrites minimal mysql netlink pcap pci perl python rpm selinux smux ssl tcpd ucd-compat zlib +python_targets_python2_7 +python_single_target_python2_7
-KEYWORDS=*
-LICENSE=HPND BSD GPL-2
-RDEPEND=bzip2? ( app-arch/bzip2 ) elf? ( dev-libs/elfutils ) lm-sensors? ( sys-apps/lm-sensors ) mysql? ( dev-db/mysql-connector-c:0= ) netlink? ( dev-libs/libnl:3 ) pcap? ( net-libs/libpcap ) pci? ( sys-apps/pciutils ) perl? ( dev-lang/perl:= ) python? ( dev-python/setuptools[python_targets_python2_7(-)?,-python_single_target_pypy3(-),-python_single_target_python3_6(-),-python_single_target_python3_7(-),-python_single_target_python3_8(-),python_single_target_python2_7(+)?] python_single_target_python2_7? ( >=dev-lang/python-2.7.5-r2:2.7 ) >=dev-lang/python-exec-2:=[python_targets_python2_7(-)?,-python_single_target_pypy3(-),-python_single_target_python3_6(-),-python_single_target_python3_7(-),-python_single_target_python3_8(-),python_single_target_python2_7(+)?] ) rpm? ( app-arch/rpm dev-libs/popt ) ssl? ( !libressl? ( >=dev-libs/openssl-0.9.6d:0= ) libressl? ( dev-libs/libressl:= ) ) tcpd? ( >=sys-apps/tcp-wrappers-7.6 ) zlib? ( >=sys-libs/zlib-1.1.4 ) perl? ( X? ( dev-perl/Tk ) !minimal? ( dev-perl/TermReadKey ) ) selinux? ( sec-policy/selinux-snmp )
-REQUIRED_USE=python? ( ^^ ( python_single_target_python2_7 ) python_single_target_python2_7? ( python_targets_python2_7 ) ) rpm? ( bzip2 zlib )
-RESTRICT=test
-SLOT=0/35
-SRC_URI=mirror://sourceforge/project/net-snmp/net-snmp/5.8/net-snmp-5.8.tar.gz https://dev.gentoo.org/~jer/net-snmp-5.7.3-patches-3.tar.xz
-_eclasses_=autotools	d0e5375d47f4c809f406eb892e531513	distutils-r1	198e3b9ddb55ae36b2a50b07ca2877ef	eutils	06133990e861be0fe60c2b428fd025d9	libtool	f143db5a74ccd9ca28c1234deffede96	multilib	2477ebe553d3e4d2c606191fe6c33602	multiprocessing	e32940a7b2a9992ad217eccddb84d548	perl-functions	6ec4c4d8fc8324200f1c14e8d158c59b	perl-module	97206c028d9bdc9f248e022ac5c9fc83	python-single-r1	75ce0f715133825e020f9777032d1376	python-utils-r1	931c328767d245c08a16a3f87be9ce9c	systemd	71fd8d2065d102753fb9e4d20eaf3e9f	toolchain-funcs	605c126bed8d87e4378d5ff1645330cb	xdg-utils	ff2ff954e6b17929574eee4efc5152ba
-_md5_=5c0c95a2e4d4c45b70f60c0197d61d5b
diff --git a/metadata/md5-cache/net-analyzer/net-snmp-5.8.1_pre1-r1 b/metadata/md5-cache/net-analyzer/net-snmp-5.8.1_pre1-r1
new file mode 100644
index 0000000..86ca7ad
--- /dev/null
+++ b/metadata/md5-cache/net-analyzer/net-snmp-5.8.1_pre1-r1
@@ -0,0 +1,16 @@
+BDEPEND=>=app-portage/elt-patches-20170815 virtual/pkgconfig
+DEFINED_PHASES=compile configure install prepare setup test
+DEPEND=bzip2? ( app-arch/bzip2 ) elf? ( dev-libs/elfutils ) lm-sensors? ( sys-apps/lm-sensors ) mysql? ( dev-db/mysql-connector-c:0= ) netlink? ( dev-libs/libnl:3 ) pcap? ( net-libs/libpcap ) pci? ( sys-apps/pciutils ) perl? ( dev-lang/perl:= ) python? ( python_single_target_python2_7? ( dev-python/setuptools[python_targets_python2_7(-)] ) python_single_target_python2_7? ( >=dev-lang/python-2.7.5-r2:2.7 >=dev-lang/python-exec-2:=[python_targets_python2_7] ) ) rpm? ( app-arch/rpm dev-libs/popt ) ssl? ( !libressl? ( >=dev-libs/openssl-0.9.6d:0= ) libressl? ( dev-libs/libressl:= ) ) tcpd? ( >=sys-apps/tcp-wrappers-7.6 ) zlib? ( >=sys-libs/zlib-1.1.4 ) doc? ( app-doc/doxygen ) !<sys-devel/gettext-0.18.1.1-r3 sys-devel/automake >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4
+DESCRIPTION=Software for generating and retrieving SNMP data
+EAPI=7
+HOMEPAGE=http://www.net-snmp.org/
+IUSE=X bzip2 doc elf kmem ipv6 libressl lm-sensors mfd-rewrites minimal mysql netlink pcap pci perl python rpm selinux smux ssl tcpd ucd-compat zlib +python_single_target_python2_7
+KEYWORDS=*
+LICENSE=HPND BSD GPL-2
+RDEPEND=bzip2? ( app-arch/bzip2 ) elf? ( dev-libs/elfutils ) lm-sensors? ( sys-apps/lm-sensors ) mysql? ( dev-db/mysql-connector-c:0= ) netlink? ( dev-libs/libnl:3 ) pcap? ( net-libs/libpcap ) pci? ( sys-apps/pciutils ) perl? ( dev-lang/perl:= ) python? ( python_single_target_python2_7? ( dev-python/setuptools[python_targets_python2_7(-)] ) python_single_target_python2_7? ( >=dev-lang/python-2.7.5-r2:2.7 >=dev-lang/python-exec-2:=[python_targets_python2_7] ) ) rpm? ( app-arch/rpm dev-libs/popt ) ssl? ( !libressl? ( >=dev-libs/openssl-0.9.6d:0= ) libressl? ( dev-libs/libressl:= ) ) tcpd? ( >=sys-apps/tcp-wrappers-7.6 ) zlib? ( >=sys-libs/zlib-1.1.4 ) perl? ( X? ( dev-perl/Tk ) !minimal? ( dev-perl/TermReadKey ) ) selinux? ( sec-policy/selinux-snmp )
+REQUIRED_USE=python? ( ^^ ( python_single_target_python2_7 ) ) rpm? ( bzip2 zlib )
+RESTRICT=test
+SLOT=0/35
+SRC_URI=mirror://sourceforge/project/net-snmp/net-snmp/5.8.1-pre-releases/net-snmp-5.8.1.pre1.tar.gz https://dev.gentoo.org/~jer/net-snmp-5.7.3-patches-3.tar.xz
+_eclasses_=autotools	d0e5375d47f4c809f406eb892e531513	distutils-r1	198e3b9ddb55ae36b2a50b07ca2877ef	libtool	f143db5a74ccd9ca28c1234deffede96	multilib	2477ebe553d3e4d2c606191fe6c33602	multiprocessing	e32940a7b2a9992ad217eccddb84d548	perl-functions	6ec4c4d8fc8324200f1c14e8d158c59b	perl-module	97206c028d9bdc9f248e022ac5c9fc83	python-single-r1	43034a822923b18d8f3ab710b753f775	python-utils-r1	157a6a7a3e99c7dbdf81acc9dd4f57cd	systemd	71fd8d2065d102753fb9e4d20eaf3e9f	toolchain-funcs	605c126bed8d87e4378d5ff1645330cb
+_md5_=044769b074dc9e3c9821d50ddda520ef
diff --git a/net-analyzer/net-snmp/Manifest b/net-analyzer/net-snmp/Manifest
index bf783d7..7670aec 100644
--- a/net-analyzer/net-snmp/Manifest
+++ b/net-analyzer/net-snmp/Manifest
@@ -1,2 +1,2 @@
 DIST net-snmp-5.7.3-patches-3.tar.xz 3176 BLAKE2B 1a71d6743afb841f664c6058e32c7c411af62b0f36acd3bb9251804893ed12f462a0c5bab828e309eeec7824def2dca8fa866350b90a62ec4f0df1141b51ecae SHA512 d8a91b9668320a1e19d062eb86dd4d16beb7c2d15ac7ebbb9d2a4bd298af39bbb0a2613504dbb0057cccdec731f08f2308c5a15395e1fbc29bb0611ed8aca636
-DIST net-snmp-5.8.tar.gz 6591680 BLAKE2B ac1bff4152310da57818a00d752a08a7fc61d697b02479d9952ca12d024d3d68dc8bfa674571e93d6f3597605b2fe91513fb6839057a80f2c3dd8d0cce0077f2 SHA512 27895a583b23f3e14c48562bc32f3ba83513d81aa848e878be9a3650f0458d45950635c937ef627135f80b757b663e71fab9a3bde4fd91889153998ae3468fe7
+DIST net-snmp-5.8.1.pre1.tar.gz 6630615 BLAKE2B 32ae7177fc08a773928da7f19cd06617feb1358c0dd21d39e08db460fa4267b6353f4afede1f5a500a628235a6a94d95700c84df6e85bda18b7a7a6e7bf3781f SHA512 e1ad421970abb67490a08fa735bbe9ff77a6fc5a19b8bf6942bef80f5b328f8038373cd5995970085177bcfe939dfa309019512b2abce0e8cf779e693f7d6dbd
diff --git a/net-analyzer/net-snmp/files/net-snmp-5.8.1-mysqlclient.patch b/net-analyzer/net-snmp/files/net-snmp-5.8.1-mysqlclient.patch
new file mode 100644
index 0000000..08735d1
--- /dev/null
+++ b/net-analyzer/net-snmp/files/net-snmp-5.8.1-mysqlclient.patch
@@ -0,0 +1,19 @@
+--- a/configure.d/config_os_libs2
++++ b/configure.d/config_os_libs2
+@@ -516,6 +516,8 @@
+ #   mysql
+ ##
+ if test "x$with_mysql" = "xyes" ; then
++  PKG_CHECK_MODULES([MYSQL],[mysqlclient],[MYSQL_INCLUDES="$MYSQL_CFLAGS"],)
++  if test -x "$MYSQL_LIBS"; then
+   AC_PATH_PROGS(MYSQLCONFIG,mysql_config)
+   test -x "$MYSQLCONFIG" \
+ 	|| AC_MSG_ERROR([Could not find mysql_config and was specifically asked to use MySQL support])
+@@ -523,6 +525,7 @@
+   MYSQL_INCLUDES=`$MYSQLCONFIG --include`
+   _libs="${LIBS}"
+   _cppflags="${CPPFLAGS}"
++  fi
+   LIBS="${LIBS} ${MYSQL_LIBS}"
+   CPPFLAGS="${CPPFLAGS} ${MYSQL_INCLUDES}"
+   AC_CHECK_HEADER(mysql.h,,
diff --git a/net-analyzer/net-snmp/files/net-snmp-5.8.1-net-snmp-config-libdir.patch b/net-analyzer/net-snmp/files/net-snmp-5.8.1-net-snmp-config-libdir.patch
new file mode 100644
index 0000000..73d4205
--- /dev/null
+++ b/net-analyzer/net-snmp/files/net-snmp-5.8.1-net-snmp-config-libdir.patch
@@ -0,0 +1,37 @@
+--- a/net-snmp-config.in
++++ b/net-snmp-config.in
+@@ -193,10 +193,10 @@
+     #################################################### client lib
+     --libs)
+       # use this one == --netsnmp-libs + --external-libs
+-      echo $NSC_LIBDIR $NSC_SNMPLIBS $NSC_LIBS
++      echo $NSC_SNMPLIBS $NSC_LIBS
+       ;;
+     --netsnmp-libs)
+-      echo $NSC_LIBDIR $NSC_BASE_SNMP_LIBS
++      echo $NSC_BASE_SNMP_LIBS
+       ;;
+     --external-libs)
+       echo $NSC_LNETSNMPLIBS $NSC_LIBS @PERLLDOPTS_FOR_APPS@
+@@ -210,10 +210,10 @@
+       ;;
+     --agent-libs)
+       # use this one == --netsnmp-agent-libs + --external-libs
+-      echo $NSC_LIBDIR $NSC_AGENTLIBS $NSC_LIBS
++      echo $NSC_AGENTLIBS $NSC_LIBS
+       ;;
+     --netsnmp-agent-libs)
+-      echo $NSC_LIBDIR $NSC_BASE_AGENT_LIBS
++      echo $NSC_BASE_AGENT_LIBS
+       ;;
+     --external-agent-libs)
+       echo $NSC_LMIBLIBS $NSC_LAGENTLIBS $NSC_LNETSNMPLIBS $NSC_LIBS
+@@ -660,7 +660,7 @@
+         echo "Ack.  Can't create $tmpfile."
+ 	exit 1
+       fi
+-      cmd="@CC@ $cflags @CFLAGS@ @DEVFLAGS@ -I. -I${NSC_INCLUDEDIR} -o $outname $tmpfile $cfiles $NSC_LDFLAGS $NSC_LIBDIR $NSC_BASE_AGENT_LIBS $NSC_AGENTLIBS $ldflags"
++      cmd="@CC@ $cflags @CFLAGS@ @DEVFLAGS@ -I. -I${NSC_INCLUDEDIR} -o $outname $tmpfile $cfiles $ldflags $NSC_LDFLAGS $NSC_BASE_AGENT_LIBS $NSC_AGENTLIBS"
+       echo "running: $cmd"
+       echo `$cmd`
+       result=$?
diff --git a/net-analyzer/net-snmp/files/net-snmp-5.8.1-pkg-config.patch b/net-analyzer/net-snmp/files/net-snmp-5.8.1-pkg-config.patch
new file mode 100644
index 0000000..acda136
--- /dev/null
+++ b/net-analyzer/net-snmp/files/net-snmp-5.8.1-pkg-config.patch
@@ -0,0 +1,20 @@
+--- a/netsnmp-agent.pc.in
++++ b/netsnmp-agent.pc.in
+@@ -8,5 +8,5 @@
+ URL: http://www.net-snmp.org
+ Version: @PACKAGE_VERSION@
+ Cflags: -I${includedir}
+-Libs: -L${libdir} -lnetsnmpmibs -lnetsnmpagent -lnetsnmp
+-Libs.private: @LDFLAGS@ @LMIBLIBS@ @LAGENTLIBS@ @PERLLDOPTS_FOR_APPS@ @LNETSNMPLIBS@ @LIBS@
++Libs: -lnetsnmpmibs -lnetsnmpagent -lnetsnmp
++Libs.private: @LMIBLIBS@ @LAGENTLIBS@ @PERLLDOPTS_FOR_APPS@ @LNETSNMPLIBS@ @LIBS@
+--- a/netsnmp.pc.in
++++ b/netsnmp.pc.in
+@@ -8,5 +8,5 @@
+ URL: http://www.net-snmp.org
+ Version: @PACKAGE_VERSION@
+ Cflags: -I${includedir}
+-Libs: -L${libdir} -lnetsnmp
+-Libs.private: @LDFLAGS@ @LNETSNMPLIBS@ @LIBS@ @PERLLDOPTS_FOR_APPS@
++Libs: -lnetsnmp
++Libs.private: @LNETSNMPLIBS@ @LIBS@ @PERLLDOPTS_FOR_APPS@
diff --git a/net-analyzer/net-snmp/files/net-snmp-99999999-tinfo.patch b/net-analyzer/net-snmp/files/net-snmp-99999999-tinfo.patch
new file mode 100644
index 0000000..2eb4ccc
--- /dev/null
+++ b/net-analyzer/net-snmp/files/net-snmp-99999999-tinfo.patch
@@ -0,0 +1,10 @@
+--- a/configure.d/config_os_libs2
++++ b/configure.d/config_os_libs2
+@@ -601,6 +601,7 @@
+   [HAVE_LIBCURSES=FALSE],,
+   [LIBCURSES])
+ AC_SUBST([HAVE_LIBCURSES])
++NETSNMP_SEARCH_LIBS([cbreak], [tinfo],[LIBCURSES="$LIBCURSES -ltinfo"],,,)
+ AC_SUBST([LIBCURSES])
+ 
+ #   libm for ceil
diff --git a/net-analyzer/net-snmp/net-snmp-5.8-r4.ebuild b/net-analyzer/net-snmp/net-snmp-5.8.1_pre1-r1.ebuild
similarity index 86%
rename from net-analyzer/net-snmp/net-snmp-5.8-r4.ebuild
rename to net-analyzer/net-snmp/net-snmp-5.8.1_pre1-r1.ebuild
index da4ca34..26756ce 100644
--- a/net-analyzer/net-snmp/net-snmp-5.8-r4.ebuild
+++ b/net-analyzer/net-snmp/net-snmp-5.8.1_pre1-r1.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=7
 PYTHON_COMPAT=( python2_7 )
 DISTUTILS_SINGLE_IMPL=yesplz
 DISTUTILS_OPTIONAL=yesplz
@@ -9,12 +9,12 @@
 PATCHSET=3
 GENTOO_DEPEND_ON_PERL=no
 
-inherit autotools distutils-r1 eutils perl-module systemd
+inherit autotools distutils-r1 perl-module systemd
 
 DESCRIPTION="Software for generating and retrieving SNMP data"
 HOMEPAGE="http://www.net-snmp.org/"
 SRC_URI="
-	mirror://sourceforge/project/${PN}/${PN}/${PV/_p*/}/${P/_p*/}.tar.gz
+	mirror://sourceforge/project/${PN}/${PN}/${PV/_p*/}-pre-releases/${P/_pre/.pre}.tar.gz
 	https://dev.gentoo.org/~jer/${PN}-5.7.3-patches-3.tar.xz
 "
 
@@ -28,6 +28,10 @@
 	X bzip2 doc elf kmem ipv6 libressl lm-sensors mfd-rewrites minimal mysql
 	netlink pcap pci perl python rpm selinux smux ssl tcpd ucd-compat zlib
 "
+REQUIRED_USE="
+	python? ( ${PYTHON_REQUIRED_USE} )
+	rpm? ( bzip2 zlib )
+"
 
 COMMON_DEPEND="
 	bzip2? ( app-arch/bzip2 )
@@ -39,7 +43,9 @@
 	pci? ( sys-apps/pciutils )
 	perl? ( dev-lang/perl:= )
 	python? (
-		dev-python/setuptools[${PYTHON_USEDEP}]
+		$(python_gen_cond_dep '
+			dev-python/setuptools[${PYTHON_MULTI_USEDEP}]
+		')
 		${PYTHON_DEPS}
 	)
 	rpm? (
@@ -65,14 +71,17 @@
 	)
 	selinux? ( sec-policy/selinux-snmp )
 "
-
-REQUIRED_USE="
-	python? ( ${PYTHON_REQUIRED_USE} )
-	rpm? ( bzip2 zlib )
-"
-S=${WORKDIR}/${P/_p*/}
-
+S=${WORKDIR}/${P/_pre/.pre}
 RESTRICT=test
+PATCHES=(
+	"${FILESDIR}"/${PN}-5.7.3-include-limits.patch
+	"${FILESDIR}"/${PN}-5.8-do-not-conflate-LDFLAGS-and-LIBS.patch
+	"${FILESDIR}"/${PN}-5.8-pcap.patch
+	"${FILESDIR}"/${PN}-5.8-tinfo.patch
+	"${FILESDIR}"/${PN}-5.8.1-pkg-config.patch
+	"${FILESDIR}"/${PN}-5.8.1-net-snmp-config-libdir.patch
+	"${FILESDIR}"/${PN}-5.8.1-mysqlclient.patch
+)
 
 pkg_setup() {
 	use python && python-single-r1_pkg_setup
@@ -82,17 +91,11 @@
 	# snmpconf generates config files with proper selinux context
 	use selinux && eapply "${FILESDIR}"/${PN}-5.1.2-snmpconf-selinux.patch
 
-	eapply "${FILESDIR}"/${PN}-5.7.3-include-limits.patch
-	eapply "${FILESDIR}"/${PN}-5.8-do-not-conflate-LDFLAGS-and-LIBS.patch
-	eapply "${FILESDIR}"/${PN}-5.8-my_bool.patch
-	eapply "${FILESDIR}"/${PN}-5.8-pcap.patch
-	eapply "${FILESDIR}"/${PN}-5.8-tinfo.patch
-
 	mv "${WORKDIR}"/patches/0002-Respect-DESTDIR-for-pythoninstall.patch{,.disabled} || die
 	mv "${WORKDIR}"/patches/0004-Don-t-report-CFLAGS-and-LDFLAGS-in-net-snmp-config.patch{,.disabled} || die
 	eapply "${WORKDIR}"/patches/*.patch
 
-	eapply_user
+	default
 
 	eautoconf
 }
@@ -144,10 +147,12 @@
 	use doc && emake docsdox
 }
 
-src_install () {
+src_install() {
 	# bug #317965
 	emake -j1 DESTDIR="${D}" install
 
+	use python && python_optimize
+
 	if use perl ; then
 		perl_delete_localpod
 		if ! use X; then
@@ -202,5 +207,5 @@
 			|| die
 	fi
 
-	prune_libtool_files
+	find "${ED}" -name '*.la' -delete || die
 }