libpcap: upgraded package to upstream

Upgraded net-libs/libpcap to version 1.10.5.

BUG=b/364128456
TEST=None
RELEASE_NOTE=Fixed CVE-2023-7256 in net-libs/libpcap.

cos-patch: security-moderate
Change-Id: I290268dba4e9d867417de2dc7113db0fa1d0fddc
Reviewed-on: https://cos-review.googlesource.com/c/third_party/overlays/portage-stable/+/80182
Tested-by: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
Reviewed-by: Oleksandr Tymoshenko <ovt@google.com>
diff --git a/net-libs/libpcap/Manifest b/net-libs/libpcap/Manifest
index 1ae3f9e..8c1b9da 100644
--- a/net-libs/libpcap/Manifest
+++ b/net-libs/libpcap/Manifest
@@ -1 +1,4 @@
-DIST libpcap-1.9.1.tar.gz 849407 BLAKE2B 700d8b3d25c036033c4f9b652cec6a30d4a45aa418c2ec45698018b3d3fe8d0a61f6759f5734e2c7ff9a8f42cce65fbd8b3e1b1efd44776e53674fbc609da59d SHA512 9ab9da20194e0dfb105daa28c8841118118f5a7f68b5e30e31da6c56eec91430c8ee481f1f9d20aec4d33d7ee9e6fb0b5e08a90a8d7e5ace8e6210e29e7eab0f
+DIST libpcap-1.10.4.tar.gz 952153 BLAKE2B 05a7eafc1e1817f7844008db89d8fb10cd2525c22f7ee6c9e3d582b14229412f38ccced5e9d80a96dd459ef9eab12eccb5c1dd4978ddc9f66267469212005e4c SHA512 1f6d6ddd07dae7c557054cb246437ecdaf39d579592a5a6bdf1144eea6cb5a779ac4ca647cfed11ec1b0bb18efc63b845444e497070bacefaaed19a5787ae5e1
+DIST libpcap-1.10.4.tar.gz.sig 442 BLAKE2B d0eb5da9a57003848b24d458e50a201d0bb8876a12e63f6627bf9dc1a784e780610cd0c858243cc75a63999b40bc64507b078777ae844ede7c07eef9f4f9e0d5 SHA512 34aa401c2e162d708c61b78b445af2fe4ddc0e57de9124b5cc3a05679ffbc3834088160f83892d827e25c65b33313fe71aa73c2de09935d387252ab315ca5ee1
+DIST libpcap-1.10.5.tar.gz 974772 BLAKE2B c0bb29c5c308cb21244a9c63d3daa19033eb21fbd721607c057f04b2ae6b2527fb1cfeeb2b29b7c3535d5d6256aa5fdf5aa22ce48aa4f88a3cc8a81029a98116 SHA512 e599a31f2f1c03bdf386defa613ea9f08f80459c87068c2dd36c55c1bd678e2622cdce6333f0a776f16812df7bd4d6747820d1c35c7a2f1d7ad4a2ffb45dbe24
+DIST libpcap-1.10.5.tar.gz.sig 442 BLAKE2B 6816bb76c6b41b292a29edcff7d89e71511d25190da7e4f26296fbae2690e476b5072f44b5ff1c9e43f31403a37e23d69c18e1f2483488fe8d742cbe3f768312 SHA512 183ed0f6a93679550dc5a589422e92023a92be8fe29f79fb296e966f26e3693e1c6d47c5e88bccbb6004cb19b6419c9d7cd998f4e2255f5594a7f5f6e84ecdc9
diff --git a/net-libs/libpcap/files/libpcap-1.8.1-usbmon.patch b/net-libs/libpcap/files/libpcap-1.8.1-usbmon.patch
deleted file mode 100644
index 0b69e43..0000000
--- a/net-libs/libpcap/files/libpcap-1.8.1-usbmon.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -1493,10 +1493,9 @@
- 	AC_DEFINE(PCAP_SUPPORT_USB, 1, [target host supports USB sniffing])
- 	USB_SRC=pcap-usb-linux.c
- 	AC_MSG_RESULT(yes)
--	ac_usb_dev_name=`udevinfo -q name -p /sys/class/usb_device/usbmon 2>/dev/null`
--	if test $? -ne 0 ; then
--	  ac_usb_dev_name="usbmon"
--	fi
-+
-+	ac_usb_dev_name="usbmon"
-+
- 	AC_DEFINE_UNQUOTED(LINUX_USB_MON_DEV, "/dev/$ac_usb_dev_name", [path for device for USB sniffing])
- 	AC_MSG_NOTICE(Device for USB sniffing is /dev/$ac_usb_dev_name)
- 	#
diff --git a/net-libs/libpcap/files/libpcap-1.9.0-pcap-config-includedir.patch b/net-libs/libpcap/files/libpcap-1.9.0-pcap-config-includedir.patch
deleted file mode 100644
index cd2c9fe..0000000
--- a/net-libs/libpcap/files/libpcap-1.9.0-pcap-config-includedir.patch
+++ /dev/null
@@ -1,36 +0,0 @@
---- a/pcap-config.in
-+++ b/pcap-config.in
-@@ -59,13 +59,13 @@
- 	#
- 	if [ "$show_cflags" = 1 -a "$show_libs" = 1 ]
- 	then
--		echo "-I$includedir -L$libdir -lpcap $LIBS"
-+		echo "-L$libdir -lpcap $LIBS"
- 	elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ]
- 	then
--		echo "-I$includedir -L$libdir $LIBS"
-+		echo "-L$libdir $LIBS"
- 	elif [ "$show_cflags" = 1 ]
- 	then
--		echo "-I$includedir"
-+		echo ""
- 	elif [ "$show_libs" = 1 ]
- 	then
- 		echo "-L$libdir -lpcap $LIBS"
-@@ -80,13 +80,13 @@
- 	#
- 	if [ "$show_cflags" = 1 -a "$show_libs" = 1 ]
- 	then
--		echo "-I$includedir -L$libdir $RPATH -l$PACKAGE_NAME"
-+		echo "-L$libdir $RPATH -l$PACKAGE_NAME"
- 	elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ]
- 	then
--		echo "-I$includedir"
-+		echo ""
- 	elif [ "$show_cflags" = 1 ]
- 	then
--		echo "-I$includedir"
-+		echo ""
- 	elif [ "$show_libs" = 1 ]
- 	then
- 		echo "-L$libdir $RPATH -l$PACKAGE_NAME"
diff --git a/net-libs/libpcap/files/libpcap-9999-prefix-darwin.patch b/net-libs/libpcap/files/libpcap-9999-prefix-darwin.patch
deleted file mode 100644
index 5ac34fd..0000000
--- a/net-libs/libpcap/files/libpcap-9999-prefix-darwin.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Prefix' Darwin systems are single arch, hijack Darwin7 case which assumes this setup
-
---- a/configure.ac
-+++ b/configure.ac
-@@ -1860,7 +1860,7 @@
- 	if test "$enable_universal" != "no"; then
- 		case "$host_os" in
- 
--		darwin[[0-7]].*)
-+		darwin**)
- 			#
- 			# Pre-Tiger.  Build only for 32-bit PowerPC; no
- 			# need for any special compiler or linker flags.
diff --git a/net-libs/libpcap/libpcap-1.10.5.ebuild b/net-libs/libpcap/libpcap-1.10.5.ebuild
new file mode 100644
index 0000000..0eb82a6
--- /dev/null
+++ b/net-libs/libpcap/libpcap-1.10.5.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools multilib-minimal
+
+DESCRIPTION="A system-independent library for user-level network packet capture"
+HOMEPAGE="https://www.tcpdump.org/ https://github.com/the-tcpdump-group/libpcap"
+
+if [[ ${PV} == *9999* ]] ; then
+	EGIT_REPO_URI="https://github.com/the-tcpdump-group/libpcap"
+	inherit git-r3
+else
+	VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/tcpdump.asc
+	inherit verify-sig
+
+	SRC_URI="https://www.tcpdump.org/release/${P}.tar.gz"
+	SRC_URI+=" verify-sig? ( https://www.tcpdump.org/release/${P}.tar.gz.sig )"
+
+	KEYWORDS="*"
+fi
+
+# The project itself has COPYING with BSD, but the files used for
+# the libpcap library itself seem to be a mix of BSD-with-attribution
+# and BSD-4.
+LICENSE="BSD BSD-with-attribution BSD-4"
+SLOT="0"
+IUSE="bluetooth dbus netlink rdma remote static-libs test usb yydebug"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+	bluetooth? ( net-wireless/bluez:=[${MULTILIB_USEDEP}] )
+	dbus? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+	netlink? ( dev-libs/libnl:3[${MULTILIB_USEDEP}] )
+	remote? ( virtual/libcrypt:=[${MULTILIB_USEDEP}] )
+	rdma? ( sys-cluster/rdma-core )
+	usb? ( virtual/libusb:1[${MULTILIB_USEDEP}] )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	app-alternatives/yacc
+	sys-devel/flex
+	dbus? ( virtual/pkgconfig )
+"
+
+if [[ ${PV} != *9999* ]] ; then
+	BDEPEND+=" verify-sig? ( >=sec-keys/openpgp-keys-tcpdump-20240901 )"
+fi
+
+src_prepare() {
+	default
+
+	if ! [[ -f VERSION ]]; then
+		echo ${PV} > VERSION || die
+	fi
+
+	eautoreconf
+}
+
+multilib_src_configure() {
+	# bug #884275
+	export LEX=flex
+
+	ECONF_SOURCE="${S}" econf \
+		$(use_enable bluetooth) \
+		$(use_enable dbus) \
+		$(use_enable rdma) \
+		$(use_enable remote) \
+		$(use_enable usb) \
+		$(use_enable yydebug) \
+		$(use_with netlink libnl) \
+		--enable-ipv6
+}
+
+multilib_src_compile() {
+	emake all shared
+	use test && emake testprogs
+}
+
+multilib_src_test() {
+	testprogs/findalldevstest || die
+}
+
+multilib_src_install_all() {
+	dodoc CREDITS CHANGES VERSION TODO README.* doc/README.*
+
+	# remove static libraries (--disable-static does not work)
+	if ! use static-libs; then
+		find "${ED}" -name '*.a' -exec rm {} + || die
+	fi
+
+	find "${ED}" -name '*.la' -delete || die
+}
diff --git a/net-libs/libpcap/libpcap-1.9.1.ebuild b/net-libs/libpcap/libpcap-1.9.1.ebuild
deleted file mode 100644
index 44ae372..0000000
--- a/net-libs/libpcap/libpcap-1.9.1.ebuild
+++ /dev/null
@@ -1,76 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-inherit autotools multilib-minimal ltprune
-
-DESCRIPTION="A system-independent library for user-level network packet capture"
-HOMEPAGE="
-	https://www.tcpdump.org/
-	https://github.com/the-tcpdump-group/libpcap
-"
-SRC_URI="
-	https://github.com/the-tcpdump-group/${PN}/archive/${P/_}.tar.gz
-"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="*"
-IUSE="bluetooth dbus netlink static-libs usb"
-
-RDEPEND="
-	bluetooth? ( net-wireless/bluez:=[${MULTILIB_USEDEP}] )
-	dbus? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
-	netlink? ( dev-libs/libnl:3[${MULTILIB_USEDEP}] )
-"
-DEPEND="
-	${RDEPEND}
-	sys-devel/flex
-	virtual/yacc
-	dbus? ( virtual/pkgconfig[${MULTILIB_USEDEP}] )
-"
-
-S=${WORKDIR}/${PN}-${P/_}
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-1.8.1-usbmon.patch
-	"${FILESDIR}"/${PN}-1.9.0-pcap-config-includedir.patch
-)
-
-src_prepare() {
-	default
-
-	echo ${PV} > VERSION || die
-
-	eautoreconf
-}
-
-multilib_src_configure() {
-	ECONF_SOURCE="${S}" \
-	econf \
-		$(use_enable bluetooth) \
-		$(use_enable usb) \
-		$(use_enable dbus) \
-		$(use_with netlink libnl) \
-		--enable-ipv6
-}
-
-multilib_src_compile() {
-	emake all shared
-}
-
-multilib_src_install_all() {
-	dodoc CREDITS CHANGES VERSION TODO README.* doc/README.*
-
-	# remove static libraries (--disable-static does not work)
-	if ! use static-libs; then
-		find "${ED}" -name '*.a' -exec rm {} + || die
-	fi
-	prune_libtool_files
-
-	# We need this to build pppd on G/FBSD systems
-	if [[ "${USERLAND}" == "BSD" ]]; then
-		insinto /usr/include
-		doins pcap-int.h portability.h
-	fi
-}
diff --git a/net-libs/libpcap/metadata.xml b/net-libs/libpcap/metadata.xml
index 011e819..a3e378e 100644
--- a/net-libs/libpcap/metadata.xml
+++ b/net-libs/libpcap/metadata.xml
@@ -2,10 +2,6 @@
 <!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
 	<maintainer type="person">
-		<email>zlogene@gentoo.org</email>
-		<name>Mikle Kolyada</name>
-	</maintainer>
-	<maintainer type="person">
 		<email>sam@gentoo.org</email>
 		<name>Sam James</name>
 	</maintainer>