blob: f9fe7aa76a32c5e78f58472728537ab417eac8b7 [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001SUMMARY = "PCI utilities"
2DESCRIPTION = 'The PCI Utilities package contains a library for portable access \
3to PCI bus configuration space and several utilities based on this library.'
4HOMEPAGE = "http://atrey.karlin.mff.cuni.cz/~mj/pciutils.shtml"
5SECTION = "console/utils"
6
7LICENSE = "GPL-2.0-or-later"
8LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
9# Can drop make-native when all systems have make 4.3
10# https://git.savannah.gnu.org/cgit/make.git/commit/?id=b90fabc8d6f34fb37d428dc0fb1b8b1951a9fbed
11# causes space issues in lib/libpci.pc
12DEPENDS = "zlib kmod make-native"
13
14SRC_URI = "${KERNELORG_MIRROR}/software/utils/pciutils/pciutils-${PV}.tar.xz \
15 file://configure.patch"
16
17SRC_URI[sha256sum] = "cdea7ae97239dee23249a09c68a19a287a3f109fbeb2c232ebb616cb38599012"
18
19inherit multilib_header pkgconfig update-alternatives
20
21PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'hwdb', '', d)}"
22PACKAGECONFIG[hwdb] = "HWDB=yes,HWDB=no,udev"
23
24PCI_CONF_FLAG = "ZLIB=yes DNS=yes SHARED=yes STRIP= LIBDIR=${libdir}"
25
26# see configure.patch
27do_configure () {
28 (
29 cd lib && \
30 # PACKAGECONFIG_CONFARGS for this recipe could only possibly contain 'HWDB=yes/no',
31 # so we put it before ./configure
32 ${PCI_CONF_FLAG} ${PACKAGECONFIG_CONFARGS} ./configure ${PV} ${datadir} ${TARGET_OS} ${TARGET_ARCH}
33 )
34}
35
36export PREFIX = "${prefix}"
37export SBINDIR = "${sbindir}"
38export SHAREDIR = "${datadir}"
39export MANDIR = "${mandir}"
40
41EXTRA_OEMAKE = "-e MAKEFLAGS= ${PCI_CONF_FLAG}"
42
43ASNEEDED = ""
44
45# The configure script breaks if the HOST variable is set
46HOST[unexport] = "1"
47
48do_install () {
49 oe_runmake DESTDIR=${D} install install-lib
50
51 install -d ${D}${bindir}
52
53 oe_multilib_header pci/config.h
54}
55
56PACKAGES =+ "${PN}-ids libpci"
57FILES:${PN}-ids = "${datadir}/pci.ids*"
58FILES:libpci = "${libdir}/libpci.so.*"
59SUMMARY:${PN}-ids = "PCI utilities - device ID database"
60DESCRIPTION:${PN}-ids = "Package providing the PCI device ID database for pciutils."
61RDEPENDS:${PN} += "${PN}-ids"
62
63ALTERNATIVE:${PN} = "lspci"
64ALTERNATIVE_PRIORITY = "100"