summaryrefslogtreecommitdiff
path: root/libre/vhba-module
diff options
context:
space:
mode:
Diffstat (limited to 'libre/vhba-module')
-rw-r--r--libre/vhba-module/PKGBUILD71
1 files changed, 22 insertions, 49 deletions
diff --git a/libre/vhba-module/PKGBUILD b/libre/vhba-module/PKGBUILD
index 4efe21005..a2fd335d9 100644
--- a/libre/vhba-module/PKGBUILD
+++ b/libre/vhba-module/PKGBUILD
@@ -6,36 +6,25 @@
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
# Contributor: Luke Shumaker <lukeshu@sbcglobal.net>
-_kernelname=
-
-if [[ ${_kernelname} == "" ]]; then
- _basekernel=4.14
- _archrel=31
- _parabolarel=1
-elif [[ ${_kernelname} == -lts ]]; then
- _basekernel=4.9
- _archrel=1
- _parabolarel=1
-fi
+_basekernel=4.14
+_archrel=31
+_parabolarel=2
pkgbase=vhba-module
+pkgname=(vhba-module vhba-module-dkms)
pkgver=20170610
pkgrel=${_archrel}.parabola${_parabolarel}.basekernel${_basekernel}
-_extramodules=extramodules-${_basekernel}${_kernelname}
-pkgdesc="Kernel module that emulates SCSI devices (built for the linux-libre${_kernelname} kernel package)"
+pkgdesc="Kernel module that emulates SCSI devices (built for the linux-libre kernel package)"
arch=('i686' 'x86_64' 'armv7h')
url="http://cdemu.sourceforge.net/"
license=('GPL')
# Generic (you shouldn't have to modify any of these variables)
_toohigh=$(IFS=. read a b <<<$_basekernel; echo $a.$((b+1)))
-makedepends=("linux-libre${_kernelname}-headers>=${_basekernel}" "linux-libre${_kernelname}-headers<${_toohigh}" "linux-libre${_kernelname}>=${_basekernel}" "linux-libre${_kernelname}<${_toohigh}")
+makedepends=("linux-libre-headers>=${_basekernel}" "linux-libre-headers<${_toohigh}" "linux-libre>=${_basekernel}" "linux-libre<${_toohigh}")
makedepends+=('libelf')
-if [[ ${_kernelname} != "" ]]; then
- provides=("${pkgbase}")
-fi
-
+_extramodules=extramodules-${_basekernel}
source=("https://downloads.sourceforge.net/cdemu/$pkgbase-$pkgver.tar.bz2"
'60-vhba.rules' 'dkms.conf')
sha256sums=('7970c93f989d9c4f2629371bf5ee7a76f95e4c12342c3320ddc528d0df02d9ec'
@@ -43,19 +32,16 @@ sha256sums=('7970c93f989d9c4f2629371bf5ee7a76f95e4c12342c3320ddc528d0df02d9ec'
'8cab0ebb4fee72069d63616b0983f105b98d1261e72e9bef5509a6e60bc382a7')
build() {
- cd "${pkgbase}-${pkgver}"
-
+ cd $pkgbase-$pkgver
make KERNELRELEASE="$(cat /usr/lib/modules/$_extramodules/version)"
}
-_package() {
- depends=("linux-libre${_kernelname}>=${_basekernel}" "linux-libre${_kernelname}<${_toohigh}")
- replaces=("${pkgbase}-libre${_kernelname}" "${pkgbase}-parabola${_kernelname}")
- conflicts=("${pkgbase}-libre${_kernelname}" "${pkgbase}-parabola${_kernelname}")
+package_vhba-module() {
+ depends=("linux-libre>=${_basekernel}" "linux-libre<${_toohigh}")
+ replaces=("${pkgbase}-libre" "${pkgbase}-parabola")
+ conflicts=("${pkgbase}-libre" "${pkgbase}-parabola")
- cd "${pkgbase}-${pkgver}"
-
- # Actually install
+ cd $pkgbase-$pkgver
install -Dt "$pkgdir/usr/lib/modules/$_extramodules" -m644 vhba.ko
install -Dt "$pkgdir/usr/lib/udev/rules.d" -m644 ../60-vhba.rules
echo 'g cdemu - -' | install -Dm644 /dev/stdin "$pkgdir/usr/lib/sysusers.d/cdemu.conf"
@@ -63,28 +49,15 @@ _package() {
find "$pkgdir" -name '*.ko' -exec gzip -n {} +
}
-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
- echo 'g cdemu - -' | install -Dm644 /dev/stdin "$pkgdir/usr/lib/sysusers.d/cdemu.conf"
- }
+package_vhba-module-dkms() {
+ depends=(dkms)
+ provides=("vhba-module=$pkgver-$pkgrel")
+ conflicts=(vhba-module)
- 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
+ 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
+ echo 'g cdemu - -' | install -Dm644 /dev/stdin "$pkgdir/usr/lib/sysusers.d/cdemu.conf"
+}
# vim:set ts=2 sw=2 et: