diff options
Diffstat (limited to 'libre/vhba-module/PKGBUILD')
-rw-r--r-- | libre/vhba-module/PKGBUILD | 73 |
1 files changed, 45 insertions, 28 deletions
diff --git a/libre/vhba-module/PKGBUILD b/libre/vhba-module/PKGBUILD index e09166636..e00826b27 100644 --- a/libre/vhba-module/PKGBUILD +++ b/libre/vhba-module/PKGBUILD @@ -1,15 +1,16 @@ # Maintainer (Arch): Ray Rashif <schiv@archlinux.org> # Contributor (Arch): Mateusz Herych <heniekk@gmail.com> # Contributor (Arch): Charles Lindsay <charles@chaoslizard.org> -# Maintainer: André Silva <emulatorman@parabola.nu> +# Contributor (Hyperbola): André Silva <emulatorman@hyperbola.info> +# Contributor (Hyperbola): Márcio Silva <coadde@hyperbola.info> +# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe> # Contributor: Luke Shumaker <lukeshu@sbcglobal.net> -# Contributor: Márcio Silva <coadde@parabola.nu> _kernelname= if [[ ${_kernelname} == "" ]]; then _basekernel=4.11 - _archrel=4 + _archrel=5 _parabolarel=1 elif [[ ${_kernelname} == -lts ]]; then _basekernel=4.9 @@ -17,8 +18,7 @@ elif [[ ${_kernelname} == -lts ]]; then _parabolarel=1 fi -_pkgname=vhba-module -pkgname=${_pkgname}${_kernelname} +pkgbase=vhba-module pkgver=20170610 pkgrel=${_archrel}.parabola${_parabolarel}.basekernel${_basekernel} _extramodules=extramodules-${_basekernel}${_kernelname} @@ -29,42 +29,59 @@ license=('GPL') # Generic (you shouldn't have to modify any of these variables) _toohigh=$(IFS=. read a b <<<$_basekernel; echo $a.$((b+1))) -depends=("linux-libre${_kernelname}>=${_basekernel}" "linux-libre${_kernelname}<${_toohigh}") -makedepends=("linux-libre${_kernelname}-headers>=${_basekernel}" "linux-libre${_kernelname}-headers<${_toohigh}") +makedepends=("linux-libre${_kernelname}-headers>=${_basekernel}" "linux-libre${_kernelname}-headers<${_toohigh}" "linux-libre${_kernelname}>=${_basekernel}" "linux-libre${_kernelname}<${_toohigh}") makedepends+=('libelf') -replaces=("${_pkgname}-libre${_kernelname}" "${_pkgname}-parabola${_kernelname}") -conflicts=("${_pkgname}-libre${_kernelname}" "${_pkgname}-parabola${_kernelname}") if [[ ${_kernelname} != "" ]]; then - provides=("${_pkgname}") + provides=("${pkgbase}") fi -options=(!makeflags) -install='kmod.install' -source=("http://downloads.sourceforge.net/cdemu/$_pkgname-$pkgver.tar.bz2" - '60-vhba.rules') +source=("http://downloads.sourceforge.net/cdemu/$pkgbase-$pkgver.tar.bz2" + '60-vhba.rules' 'dkms.conf') sha256sums=('7970c93f989d9c4f2629371bf5ee7a76f95e4c12342c3320ddc528d0df02d9ec' - '3052cb1cadbdf4bfb0b588bb8ed80691940d8dd63dc5502943d597eaf9f40c3b') + '3052cb1cadbdf4bfb0b588bb8ed80691940d8dd63dc5502943d597eaf9f40c3b' + '8cab0ebb4fee72069d63616b0983f105b98d1261e72e9bef5509a6e60bc382a7') build() { - cd "${srcdir}/${_pkgname}-${pkgver}" + cd "${pkgbase}-${pkgver}" - _kernver="$(cat /usr/lib/modules/${_extramodules}/version)" - - make KDIR=/usr/lib/modules/$_kernver/build + make KERNELRELEASE="$(cat /usr/lib/modules/$_extramodules/version)" } -package() { - cd "${srcdir}/${_pkgname}-${pkgver}" +_package() { + depends=("linux-libre${_kernelname}>=${_basekernel}" "linux-libre${_kernelname}<${_toohigh}") + replaces=("${pkgbase}-libre${_kernelname}" "${pkgbase}-parabola${_kernelname}") + conflicts=("${pkgbase}-libre${_kernelname}" "${pkgbase}-parabola${_kernelname}") + install='kmod.install' - # Actually install - install -Dm644 vhba.ko "$pkgdir/usr/lib/modules/$_extramodules/vhba.ko" - install -Dm644 ../60-vhba.rules "$pkgdir/usr/lib/udev/rules.d/60-vhba.rules" + cd "${pkgbase}-${pkgver}" - # Set the correct extramodules directory for install - cp -f "${startdir}/${install}" "${startdir}/${install}.pkg" - true && install=${install}.pkg - sed -i "s/^_EXTRAMODULES=.*/_EXTRAMODULES="${_extramodules}"/" "${startdir}/${install}" + # Actually install + install -Dt "$pkgdir/usr/lib/modules/$_extramodules" -m644 vhba.ko + install -Dt "$pkgdir/usr/lib/udev/rules.d" -m644 ../60-vhba.rules } +if [[ ${_kernelname} == "" ]]; then + _package-dkms() { + depends=(dkms) + provides=("vhba-module=$pkgver-$pkgrel") + conflicts=(vhba-module) + + cd $pkgbase-$pkgver + install -Dt "$pkgdir/usr/src/$pkgbase-$pkgver" -m644 Makefile vhba.c ../dkms.conf + install -Dt "$pkgdir/usr/lib/udev/rules.d" -m644 ../60-vhba.rules + } + + pkgname=("${pkgbase}${_kernelname}" "${pkgbase}${_kernelname}-dkms") +else + pkgname=("${pkgbase}${_kernelname}") +fi + +for _p in ${pkgname[@]}; do + eval "package_${_p}() { + $(declare -f "_package${_p#${pkgbase}${_kernelname}}") + _package${_p#${pkgbase}${_kernelname}} + }" +done + # vim:set ts=2 sw=2 et: |