recipes: Rename 'pkghashtag' variable to 'pkgcategory'
[dragora.git] / recipes / tools / pciutils / recipe
blob96846331ba018686f6e22afd68c279b789830dfc
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.
17 program=pciutils
18 version=3.6.2
19 release=1
21 # Define a category for the output of the package name
22 pkgcategory=tools
24 tarname=${program}-${version}.tar.gz
26 # Remote source(s)
27 fetch=ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci/$tarname
29 description="
30 The PCI utilities.
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/
37 license=GPLv2+
39 # Source documentation
40 docs="COPYING ChangeLog README TODO"
41 docsdir="${docdir}/${program}-${version}"
43 build()
45     set -e
47     unpack "${tardir}/$tarname"
49     cd "$srcdir"
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" \
57      PREFIX=/usr \
58      LIBDIR=/usr/lib${libSuffix} \
59      SHAREDIR=/usr/share/hwdata \
60      SHARED=no \
61      ZLIB=no
63     mkdir -p "${destdir}/usr/lib${libSuffix}"
64     cp -p lib/libpci.a "${destdir}/usr/lib${libSuffix}/"
66     make clean
68     make -j${jobs} V=1 OPT="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
69      PREFIX=/usr \
70      LIBDIR=/usr/lib${libSuffix} \
71      SHAREDIR=/usr/share/hwdata \
72      SHARED=yes \
73      ZLIB=no
75     # Make the installation
77     make -j${jobs} V=1 OPT="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
78      PREFIX=/usr \
79      LIBDIR=/usr/lib${libSuffix} \
80      SHAREDIR=/usr/share/hwdata \
81      SHARED=yes \
82      ZLIB=no \
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"
93     then
94         (
95             cd "${destdir}/$mandir"
96             find . -type f -exec lzip -9 '{}' +
97             find . -type l | while read -r file
98             do
99                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
100                 rm -- "$file"
101             done
102         )
103     fi
105     # Copy documentation
106     mkdir -p "${destdir}${docsdir}"
107     cp -p $docs "${destdir}${docsdir}"