Advertisement
Guest User

dahdi-linux pkgbuild

a guest
Aug 21st, 2015
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.32 KB | None | 0 0
  1. # Maintainer: Maik Broemme <mbroemme@libmpq.org>
  2. pkgname="dahdi-linux"
  3. pkgdesc="DAHDI drivers for Asterisk (Digium, OpenVox, Allo and Yeastar cards)"
  4. pkgver=2.10.1
  5. pkgrel=2
  6. arch=("i686" "x86_64")
  7. url="http://www.asterisk.org/"
  8. license=("LGPLv2")
  9. depends=("linux>=4.1" "linux<4.2")
  10. makedepends=("linux-headers>=4.0" "linux-headers<4.2")
  11. conflicts=("dahdi")
  12. install="${pkgname}.install"
  13. source=(
  14. "http://downloads.asterisk.org/pub/telephony/${pkgname}/${pkgname}-${pkgver}.tar.gz"
  15. "oslec.h::http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/plain/drivers/misc/echo/oslec.h?id=refs/tags/v4.0"
  16. "dahdi-linux-2.10.1-allo.patch"
  17. "dahdi-linux-2.10.1-openvox-1.patch"
  18. "dahdi-linux-2.10.1-openvox-2.patch"
  19. "dahdi-linux-2.10.1-openvox-3.patch"
  20. "dahdi-linux-2.10.1-yeastar.patch"
  21. "dahdi-kernel-4.0-1.patch::https://github.com/asterisk/dahdi-linux/commit/1cc0ad510acd404e63923ed3062b9302d53580da.diff"
  22. "dahdi-kernel-4.0-2.patch::https://github.com/asterisk/dahdi-linux/commit/1559db9d1ae03780788788c07334ca54cdd1253a.diff"
  23. "dahdi-kernel-4.1.patch"
  24. )
  25. sha256sums=(
  26. "94c532e190fc6372f9731df71f8c590fc6f6f184d5394339ce892ac6788843aa"
  27. "dc8b86ded9963ad825ea7a18bdbcfb0a4758bbc9dcac5fc9cd9bcf58074a0748"
  28. "626c63d2baad6d7236e98904002d447eefc055b051a87264c4e0175446be7625"
  29. "5e1e109039395a09412a6639fd25c5e70cc353ebc1c7b1ef26709bec1f22c6cb"
  30. "941c8fba7516b1f8fe961fe31087894a556243f2e28fdcbbf25ae0ea962bfd13"
  31. "1e06d18f7a995ac2534fc0109f6f170981cd4be9ebc6e69779552a0b2ebd5634"
  32. "1830ed6696f6c28f61943d5f037e2f6306237a4a7ba0b6b1c2d5b801378413b8"
  33. "ac261ef988e16ef348f9b67e0ccf9cded32808c90b487cc13d8422252516e808"
  34. "4cf5aaa0c288661ade991122fbcd5c5dca7f2a3fa4cfad32d98b807b6641d9f1"
  35. "a8d24e4aa3f6052136e18b8cef68fe5d39a61ed51cb5a6058e16389e602c5b4f"
  36. )
  37.  
  38. build() {
  39. cd "${srcdir}/${pkgname}-${pkgver}"
  40.  
  41. # enable additional drivers.
  42. patch -Np1 -i "${srcdir}/dahdi-linux-2.10.1-allo.patch"
  43. patch -Np1 -i "${srcdir}/dahdi-linux-2.10.1-openvox-1.patch"
  44. patch -Np1 -i "${srcdir}/dahdi-linux-2.10.1-openvox-2.patch"
  45. patch -Np1 -i "${srcdir}/dahdi-linux-2.10.1-openvox-3.patch"
  46. patch -Np1 -i "${srcdir}/dahdi-linux-2.10.1-yeastar.patch"
  47.  
  48. # linux >= 4.0 patches.
  49. patch -Np1 -i "${srcdir}/dahdi-kernel-4.0-1.patch"
  50. patch -Np1 -i "${srcdir}/dahdi-kernel-4.0-2.patch"
  51.  
  52. # linux >= 4.1 patches.
  53. patch -Np1 -i "${srcdir}/dahdi-linux-4.1.patch"
  54.  
  55. # enable dahdi oslec with upstream echo module.
  56. mkdir -p drivers/staging/echo
  57. cp "${srcdir}/oslec.h" drivers/staging/echo/oslec.h
  58. sed 's|ifneq (,$(wildcard $(src)/../staging/echo/echo.c))|ifneq (,$(wildcard $(src)/../staging/echo/oslec.h))|' -i drivers/dahdi/Kbuild
  59. sed '\|obj-m += ../staging/echo/echo.o|d' -i drivers/dahdi/Kbuild
  60.  
  61. # fix wrong installation paths.
  62. sed 's,$(DESTDIR)/lib/firmware,$(DESTDIR)/usr/lib/firmware,g' -i drivers/dahdi/firmware/Makefile
  63. sed 's,$DESTDIR/lib/firmware,$DESTDIR/usr/lib/firmware,g' -i build_tools/install_firmware
  64.  
  65. # compile.
  66. make -j1 DESTDIR="${pkgdir}" all
  67. }
  68.  
  69. package() {
  70. cd "${srcdir}/${pkgname}-${pkgver}"
  71. make DESTDIR="${pkgdir}" install-firmware
  72. make DESTDIR="${pkgdir}" install-include
  73. make DESTDIR="${pkgdir}" install-xpp-firm
  74. cd drivers
  75. find . -name "*.ko" -exec gzip "{}" \; -exec install -D -m 0644 "{}.gz" "${pkgdir}/usr/lib/modules/extramodules-4.1-ARCH/{}.gz" \;
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement