Files
haikuports/sys-apps/pciutils/pciutils-3.11.1.recipe
2025-02-12 15:55:12 +00:00

116 lines
2.8 KiB
Bash

SUMMARY="Utilities for inspecting and manipulating PCI devices"
DESCRIPTION="The PCI Utilities are a collection of programs for inspecting \
and manipulating configuration of PCI devices, all based on a common \
portable library libpci which offers access to the PCI configuration space \
on a variety of operating systems.
The utilities include:
- lspci - displays detailed information about all PCI buses and devices in \
the system
- setpci - allows reading from and writing to PCI device configuration \
registers. For example, you can adjust the latency timers with it."
HOMEPAGE="https://mj.ucw.cz/sw/pciutils/"
COPYRIGHT="1997-2024 Martin Mares"
LICENSE="GNU GPL v2"
REVISION="2"
SOURCE_URI="https://mj.ucw.cz/download/linux/pci/pciutils-$portVersion.tar.gz"
CHECKSUM_SHA256="1904864ce5b0272d0a2e42e72ceac9e8810d1898480567f36b70642f8205fbfd"
PATCHES="pciutils-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
libVersion="$portVersion"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
pciutils$secondaryArchSuffix = $portVersion
cmd:lspci$commandSuffix = $portVersion
cmd:pcilmr$commandSuffix = $portVersion
cmd:setpci$commandSuffix = $portVersion
lib:libpci$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
hwdata
"
PROVIDES_devel="
pciutils${secondaryArchSuffix}_devel = $portVersion
devel:libpci$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
pciutils$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:sed
"
TEST_REQUIRES="
lib:libpci$secondaryArchSuffix
"
INSTALL()
{
make \
ZLIB=no \
DNS=no \
SHARED=yes \
PREFIX="$prefix" \
BINDIR="$commandBinDir" \
SBINDIR="$commandBinDir" \
SHAREDIR="$dataDir" \
IDSDIR="$dataDir"/hwdata \
MANDIR="$manDir" \
INCDIR="$includeDir" \
LIBDIR="$libDir" \
install install-lib
# update-pciids is useless because pci.ids is read-only.
rm -f "$commandBinDir"/update-pciids
rm -f "$manDir"/man*/update-pciids.*
# use pci.ids from hwdata
rm -rf $dataDir/hwdata
prepareInstalledDevelLib libpci
fixPkgconfig
sed -i -e "s,$dataDir/,/system/data/,g" \
"$manDir"/man8/lspci.8 \
"$manDir"/man8/setpci.8
local include_pci=/system/$relativeOldIncludeDir/pci
sed -i -e "s,/usr/include/linux/,$include_pci/,g" \
"$manDir"/man8/lspci.8
sed -i -e "s,/usr/include/pci/,$include_pci/,g" \
"$manDir"/man8/setpci.8
# devel package
packageEntries devel \
"$developDir" \
"$manDir"/man7
}
TEST()
{
lspci
}