recipe 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. # Build recipe for pciutils.
  2. #
  3. # Copyright (c) 2017 Matias Fonzo, <selk@dragora.org>.
  4. #
  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
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  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.
  16. program=pciutils
  17. version=3.5.6
  18. release=1
  19. tarname=${program}-${version}.tar.gz
  20. # Remote source(s)
  21. fetch=ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci/$tarname
  22. description="
  23. The PCI utilities.
  24. The PCI Utilities package is a set of programs for listing PCI devices,
  25. inspecting their status and setting their configuration registers.
  26. "
  27. homepage=http://mj.ucw.cz/sw/pciutils/
  28. license=GPLv2+
  29. # Source documentation
  30. docs="COPYING ChangeLog README TODO"
  31. docsdir="${docdir}/${program}-${version}"
  32. build()
  33. {
  34. set -e
  35. unpack "${tardir}/$tarname"
  36. cd "$srcdir"
  37. # Provide both, the static and the dynamic library
  38. make -j${jobs} V=1 OPT="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  39. PREFIX=/usr \
  40. LIBDIR=/usr/lib${libSuffix} \
  41. SHAREDIR=/usr/share/hwdata \
  42. SHARED=no \
  43. ZLIB=no
  44. mkdir -p "${destdir}/usr/lib${libSuffix}"
  45. cp -p lib/libpci.a "${destdir}/usr/lib${libSuffix}/"
  46. make clean
  47. make -j${jobs} V=1 OPT="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  48. PREFIX=/usr \
  49. LIBDIR=/usr/lib${libSuffix} \
  50. SHAREDIR=/usr/share/hwdata \
  51. SHARED=yes \
  52. ZLIB=no
  53. # Make the installation
  54. make -j${jobs} V=1 OPT="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  55. PREFIX=/usr \
  56. LIBDIR=/usr/lib${libSuffix} \
  57. SHAREDIR=/usr/share/hwdata \
  58. SHARED=yes \
  59. ZLIB=no \
  60. DESTDIR="$destdir" install install-lib
  61. # Fix library permissions
  62. chmod 755 "${destdir}/usr/lib${libSuffix}/libpci.so.${version}"
  63. # This is provided by the 'hwids' package
  64. rm -rf "${destdir}/usr/share/hwdata"
  65. # Compress and link man pages (if needed)
  66. if test -d "${destdir}/$mandir"
  67. then
  68. (
  69. cd "${destdir}/$mandir"
  70. find . -type f -exec lzip -9 '{}' +
  71. find . -type l | while read -r file
  72. do
  73. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  74. rm -- "$file"
  75. done
  76. )
  77. fi
  78. # Copy documentation
  79. mkdir -p "${destdir}${docsdir}"
  80. cp -p $docs "${destdir}${docsdir}"
  81. }