1 # Build recipe for pciutils.
3 # Copyright (c) 2017-2018 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
21 # Set 'outdir' for a nice and well-organized output directory
22 outdir="${outdir}/${arch}/tools"
24 tarname=${program}-${version}.tar.gz
27 fetch=ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci/$tarname
32 The PCI Utilities package is a set of programs for listing PCI devices,
33 inspecting their status and setting their configuration registers.
36 homepage=http://mj.ucw.cz/sw/pciutils/
39 # Source documentation
40 docs="COPYING ChangeLog README TODO"
41 docsdir="${docdir}/${program}-${version}"
47 unpack "${tardir}/$tarname"
51 # Set sane permissions
52 chmod -R u+w,go-w,a+rX-s .
54 # Provide both, the static and the dynamic library
56 make -j${jobs} V=1 OPT="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
58 LIBDIR=/usr/lib${libSuffix} \
59 SHAREDIR=/usr/share/hwdata \
63 mkdir -p "${destdir}/usr/lib${libSuffix}"
64 cp -p lib/libpci.a "${destdir}/usr/lib${libSuffix}/"
68 make -j${jobs} V=1 OPT="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
70 LIBDIR=/usr/lib${libSuffix} \
71 SHAREDIR=/usr/share/hwdata \
75 # Make the installation
77 make -j${jobs} V=1 OPT="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
79 LIBDIR=/usr/lib${libSuffix} \
80 SHAREDIR=/usr/share/hwdata \
83 DESTDIR="$destdir" install install-lib
85 # Fix library permissions
86 chmod 755 "${destdir}/usr/lib${libSuffix}/libpci.so.${version}"
88 # This is provided by the 'hwids' package
89 rm -rf "${destdir}/usr/share/hwdata"
91 # Compress and link man pages (if needed)
92 if test -d "${destdir}/$mandir"
95 cd "${destdir}/$mandir"
96 find . -type f -exec lzip -9 '{}' +
97 find . -type l | while read -r file
99 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
106 mkdir -p "${destdir}${docsdir}"
107 cp -p $docs "${destdir}${docsdir}"