From 0be281e287d432ff40e2a4f4005524d24c98cd33 Mon Sep 17 00:00:00 2001
From: Mike Gilbert <floppym@gentoo.org>
Date: Fri, 25 Oct 2019 11:13:49 -0400
Subject: [PATCH] sys-apps/hwids: bump to 20191025

Package-Manager: Portage-2.3.77_p5, Repoman-2.3.17_p81
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
---
 sys-apps/hwids/Manifest              |  1 +
 sys-apps/hwids/hwids-20191025.ebuild | 91 ++++++++++++++++++++++++++++
 2 files changed, 92 insertions(+)
 create mode 100644 sys-apps/hwids/hwids-20191025.ebuild

diff --git a/sys-apps/hwids/Manifest b/sys-apps/hwids/Manifest
index c0c64ad3112c..cba424458564 100644
--- a/sys-apps/hwids/Manifest
+++ b/sys-apps/hwids/Manifest
@@ -1,2 +1,3 @@
 DIST hwids-20190316.tar.gz 3312959 BLAKE2B d9f4c7170979c404a69ca0b51903af34db01a6150ec70dc1416dcb507dfa4d8ad9ce325204791a24e5646dee67aea0c1566c15dcddb65a5d9dddbbbb9b896398 SHA512 6db50577b5d29d73f1dc0a44d0b74320cb0df186b9850160b15a6e8f2bcbdbf8193bae4146f81a5afc6b0e05706b5286b4b5858eb028d6c58ea4582df61d232e
 DIST hwids-20190818.tar.gz 3407208 BLAKE2B c2a0098cba4a34210461a2781f325a95f18696c1917ff3a1c26a2f56383e9edd087ab6b3a1a173a92df829fc250cf460d915a98298f9c38a71396bf232916245 SHA512 74086f96152482af3c9caabc729f34d193cc619aae88d44aa0472d674b7533ab806b13243c95bfa04417bdd40e3bb7069b766c2c0824f19d0c62385b043a01c2
+DIST hwids-20191025.tar.gz 3443988 BLAKE2B 0352f1568d7ceeb2c599d789f96a3175703f3c86240188beb9a080eabb6e7659aeeadf193f15050519fb64c58ee8d8832919cf6922b5017861b32be543235a03 SHA512 6f637ca8c4d6b1261c5c2eccd8d1a64ab750f4c36f3d435b50b75949c15e571d83bc61dd6a14e777b53d383d7d02c34f616cc6a62d005db3d965b33b4121deca
diff --git a/sys-apps/hwids/hwids-20191025.ebuild b/sys-apps/hwids/hwids-20191025.ebuild
new file mode 100644
index 000000000000..81079882934b
--- /dev/null
+++ b/sys-apps/hwids/hwids-20191025.ebuild
@@ -0,0 +1,91 @@
+# Copyright 2012-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit udev
+
+DESCRIPTION="Hardware (PCI, USB, OUI, IAB) IDs databases"
+HOMEPAGE="https://github.com/gentoo/hwids"
+if [[ ${PV} == 99999999 ]]; then
+	PYTHON_COMPAT=( python3_{6,7} )
+	inherit git-r3 python-any-r1
+	EGIT_REPO_URI="${HOMEPAGE}.git"
+else
+	SRC_URI="${HOMEPAGE}/archive/${P}.tar.gz"
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+
+LICENSE="|| ( GPL-2 BSD ) public-domain"
+SLOT="0"
+IUSE="+net +pci +udev +usb"
+
+RDEPEND="
+	udev? ( virtual/udev )
+	!<sys-apps/pciutils-3.1.9-r2
+	!<sys-apps/usbutils-005-r1
+"
+
+if [[ ${PV} == 99999999 ]]; then
+	BDEPEND="
+		net-misc/curl
+		udev? ( $(python_gen_any_dep 'dev-python/pyparsing[${PYTHON_USEDEP}]') )
+	"
+	python_check_deps() {
+		if use udev; then
+			has_version -b "dev-python/pyparsing[${PYTHON_USEDEP}]"
+		fi
+	}
+else
+	S=${WORKDIR}/hwids-${P}
+fi
+
+pkg_setup() {
+	:
+}
+
+src_unpack() {
+	if [[ ${PV} == 99999999 ]]; then
+		git-r3_src_unpack
+		cd "${S}" || die
+		emake fetch
+	else
+		default
+	fi
+}
+
+src_prepare() {
+	default
+	sed -i -e '/udevadm hwdb/d' Makefile || die
+}
+
+_emake() {
+	emake \
+		NET=$(usex net) \
+		PCI=$(usex pci) \
+		UDEV=$(usex udev) \
+		USB=$(usex usb) \
+		"$@"
+}
+
+src_compile() {
+	if [[ ${PV} == 99999999 ]] && use udev; then
+		python_setup
+		_emake udev-hwdb
+	fi
+	_emake
+}
+
+src_install() {
+	_emake install \
+		DOCDIR="${EPREFIX}/usr/share/doc/${PF}" \
+		MISCDIR="${EPREFIX}/usr/share/misc" \
+		HWDBDIR="${EPREFIX}$(get_udevdir)/hwdb.d" \
+		DESTDIR="${D}"
+}
+
+pkg_postinst() {
+	if use udev; then
+		udevadm hwdb --update --root="${ROOT}"
+	fi
+}
-- 
2.26.2