mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-14 15:50:07 +02:00
140 lines
3.5 KiB
Bash
140 lines
3.5 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-2016 Martin Mares"
|
|
LICENSE="GNU GPL v2"
|
|
REVISION="1"
|
|
SOURCE_URI="ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci/pciutils-$portVersion.tar.gz"
|
|
CHECKSUM_SHA256="0d4d507d395e727384737d3c45cf8c5a0023864a6eb5c6ed7caf7d483995391d"
|
|
|
|
ARCHITECTURES="x86_gcc2 x86 x86_64"
|
|
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
|
|
|
|
# libpci.so can only be built (for this package) if gcc >= 4.
|
|
if [ "$effectiveTargetArchitecture" != x86_gcc2 ]; then
|
|
LIBPCI_SHARED=yes
|
|
else
|
|
LIBPCI_SHARED=no
|
|
fi
|
|
|
|
PROVIDES="
|
|
pciutils$secondaryArchSuffix = $portVersion
|
|
cmd:lspci$secondaryArchSuffix = $portVersion
|
|
cmd:setpci$secondaryArchSuffix = $portVersion
|
|
"
|
|
if [ "$LIBPCI_SHARED" = yes ]; then
|
|
PROVIDES="$PROVIDES
|
|
lib:libpci$secondaryArchSuffix = $portVersion compat >= 3
|
|
"
|
|
fi
|
|
|
|
REQUIRES="
|
|
haiku$secondaryArchSuffix
|
|
pciutils_data == $portVersion
|
|
"
|
|
|
|
if [ -z "$secondaryArchSuffix" ]; then
|
|
SUMMARY_data="Utilities for inspecting and manipulating PCI devices \
|
|
(data)"
|
|
ARCHITECTURES_data="any"
|
|
PROVIDES_data="
|
|
pciutils_data = $portVersion
|
|
"
|
|
REQUIRES_data=""
|
|
fi
|
|
|
|
PROVIDES_devel="
|
|
pciutils${secondaryArchSuffix}_devel = $portVersion
|
|
devel:libpci$secondaryArchSuffix = $portVersion compat >= 3
|
|
"
|
|
REQUIRES_devel="
|
|
pciutils$secondaryArchSuffix == $portVersion base
|
|
"
|
|
|
|
BUILD_REQUIRES="
|
|
haiku${secondaryArchSuffix}_devel
|
|
"
|
|
BUILD_PREREQUIRES="
|
|
cmd:make
|
|
cmd:gcc$secondaryArchSuffix
|
|
cmd:sed
|
|
"
|
|
|
|
|
|
BUILD()
|
|
{
|
|
make \
|
|
ZLIB=no \
|
|
SHARED=$LIBPCI_SHARED \
|
|
PREFIX=$prefix \
|
|
SHAREDIR=$dataDir \
|
|
IDSDIR=$dataDir/pciutils \
|
|
SBINDIR=$binDir \
|
|
MANDIR=$manDir \
|
|
INCDIR=$includeDir \
|
|
LIBDIR=$libDir
|
|
}
|
|
|
|
INSTALL()
|
|
{
|
|
make \
|
|
ZLIB=no \
|
|
SHARED=$LIBPCI_SHARED \
|
|
PREFIX=$prefix \
|
|
SHAREDIR=$dataDir \
|
|
IDSDIR=$dataDir/pciutils \
|
|
SBINDIR=$binDir \
|
|
MANDIR=$manDir \
|
|
INCDIR=$includeDir \
|
|
LIBDIR=$libDir \
|
|
install install-lib
|
|
|
|
# update-pciids is useless because pci.ids is read-only.
|
|
rm -f $binDir/update-pciids
|
|
rm -f $manDir/man*/update-pciids.*
|
|
|
|
prepareInstalledDevelLib libpci
|
|
fixPkgconfig
|
|
|
|
if [ -z "$secondaryArchSuffix" ]; then
|
|
maybe_manDir_man7=$manDir/man7
|
|
packageEntries data \
|
|
$dataDir
|
|
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
|
|
else
|
|
maybe_manDir_man7=
|
|
rm -rf $dataDir $documentationDir
|
|
fi
|
|
|
|
# $dataDir/pciutils/pci.ids is not in pciutils but in pciutils_data.
|
|
local data_dir=/packages/pciutils_data${dataDir#/packages/pciutils$secondaryArchSuffix}
|
|
# So we need to fix the idsdir custom parameter in libpci.pc to make
|
|
# pkg-config --variable=idsdir libpci
|
|
# yeld the correct path to the directory where pci.ids will be.
|
|
sed -i \
|
|
-e "/^idsdir=/ s,=$dataDir/,=$data_dir/," \
|
|
$developLibDir/pkgconfig/libpci.pc
|
|
|
|
# devel package
|
|
packageEntries devel \
|
|
$developDir \
|
|
$maybe_manDir_man7
|
|
}
|