d12db82c79059716331feac60504d4c5568e8cd2
[gentoo.git] / sys-apps / usbutils / usbutils-010-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python3_{6,7} )
6
7 inherit python-single-r1
8
9 DESCRIPTION="USB enumeration utilities"
10 HOMEPAGE="https://www.kernel.org/pub/linux/utils/usb/usbutils/
11         https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usbutils.git/"
12 SRC_URI="https://www.kernel.org/pub/linux/utils/usb/${PN}/${P}.tar.xz"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~x86-linux"
17 IUSE="python"
18 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
19
20 CDEPEND="virtual/libusb:1=
21         virtual/libudev:="
22 DEPEND="${CDEPEND}
23         app-arch/xz-utils
24         virtual/pkgconfig"
25 RDEPEND="${CDEPEND}
26         sys-apps/hwids
27         python? ( ${PYTHON_DEPS} )"
28
29 PATCHES=( "${FILESDIR}"/${P}-fix-py3-support.patch )
30
31 pkg_setup() {
32         use python && python-single-r1_pkg_setup
33 }
34
35 src_prepare() {
36         default
37         use python && python_fix_shebang lsusb.py.in
38 }
39
40 src_configure() {
41         local myeconfargs=(
42                 --datarootdir="${EPREFIX}/usr/share"
43                 --datadir="${EPREFIX}/usr/share/misc"
44         )
45         econf "${myeconfargs[@]}"
46 }
47
48 src_install() {
49         default
50         newdoc usbhid-dump/NEWS NEWS.usbhid-dump
51
52         use python || rm -f "${ED%/}"/usr/bin/lsusb.py
53 }