PKGBUILD 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # Contributor: Ray Rashif <schiv@archlinux.org>
  2. # Contributor: Mateusz Herych <heniekk@gmail.com>
  3. # Contributor: Charles Lindsay <charles@chaoslizard.org>
  4. # Contributor: André Silva <emulatorman@hyperbola.info>
  5. # Contributor: Márcio Silva <coadde@hyperbola.info>
  6. # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
  7. _basekernel=5.12.6
  8. pkgbase=vhba-module
  9. pkgname=(vhba-module vhba-module-dkms)
  10. pkgver=20210418
  11. pkgrel=15
  12. pkgrel+=.parabola1.basekernel${_basekernel%-*}
  13. pkgdesc="Kernel module that emulates SCSI devices"
  14. pkgdesc+=" (built for the linux-libre kernel package)"
  15. url="https://cdemu.sourceforge.io/"
  16. arch=(x86_64)
  17. arch+=(i686)
  18. license=(GPL)
  19. makedepends=(linux-libre-headers=${_basekernel%-*} git libelf)
  20. source=("https://downloads.sourceforge.net/cdemu/$pkgbase-$pkgver.tar.xz"
  21. 60-vhba.rules dkms.conf)
  22. sha256sums=('18bd82ae27721ad1612b3c31accd81898ae326370964385ca52a2a66b67a3f85'
  23. '3052cb1cadbdf4bfb0b588bb8ed80691940d8dd63dc5502943d597eaf9f40c3b'
  24. '8cab0ebb4fee72069d63616b0983f105b98d1261e72e9bef5509a6e60bc382a7')
  25. prepare() {
  26. cd $pkgbase-$pkgver
  27. sed -i 's/20190302/20190410/' Makefile # Fixup VHBA_VERSION
  28. }
  29. build() {
  30. cd $pkgbase-$pkgver
  31. make KERNELRELEASE="$(</usr/src/linux-libre/version)"
  32. }
  33. package_vhba-module() {
  34. depends=(linux-libre=${_basekernel%-*})
  35. provides=(VHBA-MODULE)
  36. local extradir="/usr/lib/modules/$(</usr/src/linux-libre/version)/extramodules"
  37. cd $pkgbase-$pkgver
  38. install -Dt "$pkgdir$extradir" -m644 *.ko
  39. install -Dt "$pkgdir/usr/lib/udev/rules.d" -m644 ../60-vhba.rules
  40. echo 'g cdemu - -' | install -Dm644 /dev/stdin "$pkgdir/usr/lib/sysusers.d/cdemu.conf"
  41. find "$pkgdir" -name '*.ko' -exec strip --strip-debug {} +
  42. find "$pkgdir" -name '*.ko' -exec xz {} +
  43. }
  44. package_vhba-module-dkms() {
  45. depends=(dkms)
  46. provides=(VHBA-MODULE)
  47. conflicts=(vhba-module)
  48. cd $pkgbase-$pkgver
  49. install -Dt "$pkgdir/usr/src/$pkgbase-$pkgver" -m644 Makefile vhba.c ../dkms.conf
  50. install -Dt "$pkgdir/usr/lib/udev/rules.d" -m644 ../60-vhba.rules
  51. echo 'g cdemu - -' | install -Dm644 /dev/stdin "$pkgdir/usr/lib/sysusers.d/cdemu.conf"
  52. }
  53. # vim:set ts=2 sw=2 et: