Files
haikuports/sys-apps/pciutils/pciutils-3.5.1.recipe
fbrosson 9483537974 pciutils: bump to 3.5.1, enable shared lib, split data. (#608)
* Drop 3.2.1_git and 3.4.1, add 3.5.1, also installing libpci.so.
* Do not install pci.ids.gz but pci.ids (i.e. uncompressed) and
  move it to an arch-independent pciutils_data sub-package, under
  /system/data/pciutils/ instead of /system/data/.
* In BUILD(), replaced INCDIR=$headersDir by INCDIR=$includeDir in
  the call to make because $headersDir is empty. INSTALL() was OK.
* Add required steps to make "pkg-config --variable=idsdir libpci"
  yeld the correct path to the directory where pci.ids is.
* Edit man8/{lspci,setpci}.8 to replace $dataDir/ by /system/data/
  and /usr/include/{linux,pci}/ by /system/develop/headers/pci/.
2016-05-26 20:47:50 -04:00

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="9e642d842d69e2780f7c11f405099c9f6748a3917a4210d5f0c18eb9b58822a6"
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
"
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
"
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
}