PKGBUILD 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # Maintainer (Arch): Dave Reisner <dreisner@archlinux.org>
  2. # Maintainer: André Silva <emulatorman@hyperbola.info>
  3. # Contributor: Márcio Silva <coadde@hyperbola.info>
  4. pkgname=kmod
  5. pkgver=27
  6. _debver=27+20200310
  7. _debrel=2
  8. pkgrel=2
  9. pkgdesc="Linux kernel module management tools and library"
  10. arch=('i686' 'x86_64')
  11. url='https://git.kernel.org/?p=utils/kernel/kmod/kmod.git;a=summary'
  12. license=('LGPL-2.1' 'GPL-2')
  13. depends=('zlib' 'libressl' 'xz')
  14. makedepends=('quilt')
  15. checkdepends=('linux-libre-lts-headers' 'libelf')
  16. options=('strip' 'debug')
  17. provides=('module-init-tools=3.16')
  18. conflicts=('module-init-tools')
  19. replaces=('module-init-tools')
  20. validpgpkeys=('EAB33C9690013C733916AC839BA2A5A630CBEA53') # Lucas DeMarchi
  21. source=("https://www.kernel.org/pub/linux/utils/kernel/$pkgname/$pkgname-$pkgver.tar."{xz,sign}
  22. "https://deb.debian.org/debian/pool/main/k/kmod/kmod_$_debver-$_debrel.debian.tar.xz"
  23. 'depmod-search.conf'
  24. 'depmod.hook' 'depmod.script'
  25. 'dummy.conf')
  26. sha512sums=('e0513094935333fca1fb4c3e3493b232507a579ab00a6457cc9ed3e928363d05aad80634fb65a8287a336bf9895194c7be8ddc41bb088a6c2cca44fc1bfbdb6c'
  27. 'SKIP'
  28. '2a9c5c6893659b6b157f7d1172b3a4dd99213cd886a1e48ed7950944a5573b5bf43cf42c3f837b1a1e862f4592f697671588d3d38bc4e3d51fdfb11ce336e286'
  29. 'a3fde7af956736fbc1c5f7a4b738c6562eff017e6506d448513c8c72215a66ce2558bf0cf3dbc8c7571a90bc5e3b83d1d4feeeb06d1333408e6f9c6bdfe4d4ad'
  30. '6c343d30b3e9c859dd1f251d88810f0515cbff2d9b7851a3b22385f3ed15a59df4365e92435229eab1ff2b0d5a240d4866c9cbba6d8bcb9f042907ad0b7e89ec'
  31. '43ee0ca3a5f015120095804950ee1191c6d0d3e5048e00ff1f62ef5105a675e8bd914939b88814a742faf445adede3d3717886ab4b025c7f1620fc3d208648c9'
  32. '023648ac2d1249ca8b692d350c753ac6be837d948c0da24fe47bf4ac3bfe0eda7f997dfa1b96efe92d52d415e7e0371221f014e66eb82f42d6d3eda075bd9ea4')
  33. prepare() {
  34. cd $srcdir/$pkgname-$pkgver
  35. if [[ $pkgver = ${_debver%+*} ]]; then
  36. # Debian patches
  37. export QUILT_PATCHES=debian/patches
  38. export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
  39. export QUILT_DIFF_ARGS='--no-timestamps'
  40. mv "$srcdir"/debian .
  41. # Doesn't apply and seems unimportant
  42. rm -v debian/patches/debian_manpages || true
  43. quilt push -av
  44. fi
  45. }
  46. build() {
  47. cd "$pkgname-$pkgver"
  48. ./configure \
  49. --bindir=/bin \
  50. --libdir=/usr/lib \
  51. --sysconfdir=/etc \
  52. --with-rootlibdir=/lib \
  53. --with-xz \
  54. --with-zlib \
  55. --with-openssl
  56. make
  57. }
  58. check() {
  59. # As of kmod v20, the test suite needs to build some kernel modules, and thus
  60. # needs headers available in order to run. We depend on linux-libre-lts-headers,
  61. # but this is really only to try and make sure that *some* useable tree of kernel
  62. # headers exist. The first useable tree we find is good enough, as these modules
  63. # will never be loaded by tests.
  64. local kdirs=(/lib/modules/*/build/Makefile)
  65. if [[ ! -f ${kdirs[0]} ]]; then
  66. printf '==> Unable to find kernel headers to build modules for tests\n' >&2
  67. return 1
  68. fi
  69. local kver kdir=${kdirs[0]%/Makefile}
  70. IFS=/ read _ _ _ kver _ <<<"$kdir"
  71. make -C "$pkgname-$pkgver" check KDIR="$kdir" KVER="$kver"
  72. }
  73. package() {
  74. make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install
  75. # extra directories
  76. install -dm755 "$pkgdir"/{etc,lib}/{depmod,modprobe}.d "$pkgdir/sbin"
  77. ln -s kmod "$pkgdir/bin/lsmod"
  78. for tool in {ins,ls,rm,dep}mod mod{probe,info}; do
  79. ln -s ../bin/kmod "$pkgdir/sbin/$tool"
  80. done
  81. # install depmod.d file for search/ dir
  82. install -Dm644 "$srcdir/depmod-search.conf" "$pkgdir/lib/depmod.d/search.conf"
  83. # hook
  84. install -Dm644 "$srcdir/depmod.hook" "$pkgdir/usr/share/libalpm/hooks/60-depmod.hook"
  85. install -Dm755 "$srcdir/depmod.script" "$pkgdir/usr/share/libalpm/scripts/depmod"
  86. # disable numdummies option
  87. # https://issues.hyperbola.info/index.php?do=details&task_id=700
  88. install -Dm644 "$srcdir/dummy.conf" "$pkgdir/lib/modprobe.d/dummy.conf"
  89. # install licenses
  90. install -Dm644 "$pkgname-$pkgver/COPYING" "$pkgdir/usr/share/licenses/$pkgname/COPYING.LIB"
  91. install -Dm644 "$pkgname-$pkgver/tools/COPYING" "$pkgdir/usr/share/licenses/$pkgname/COPYING"
  92. }
  93. # vim: ft=sh syn=sh et