summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libre/vhba-module/PKGBUILD73
-rw-r--r--libre/vhba-module/dkms.conf9
-rw-r--r--libre/vhba-module/kmod.install13
3 files changed, 58 insertions, 37 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:
diff --git a/libre/vhba-module/dkms.conf b/libre/vhba-module/dkms.conf
new file mode 100644
index 000000000..22d8d0008
--- /dev/null
+++ b/libre/vhba-module/dkms.conf
@@ -0,0 +1,9 @@
+PACKAGE_NAME="vhba-module"
+PACKAGE_VERSION="#MODULE_VERSION#"
+AUTOINSTALL="yes"
+
+MAKE[0]="make KERNELRELEASE=$kernelver"
+CLEAN="make clean"
+
+BUILT_MODULE_NAME[0]="vhba"
+DEST_MODULE_LOCATION[0]="/kernel/drivers/scsi"
diff --git a/libre/vhba-module/kmod.install b/libre/vhba-module/kmod.install
index 08ecfbfba..2c7652580 100644
--- a/libre/vhba-module/kmod.install
+++ b/libre/vhba-module/kmod.install
@@ -1,20 +1,15 @@
-_EXTRAMODULES=
-
-_post_install() {
- echo ">>> Updating module dependencies. Please wait ..."
- depmod "$(cat /usr/lib/modules/$_EXTRAMODULES/version)" >/dev/null 2>&1
-}
post_install() {
- _post_install
+ post_upgrade $1 0
getent group cdemu &>/dev/null || groupadd -r cdemu
}
post_upgrade() {
- post_install
+ _EXTRAMODULES=extramodules-4.11
+ depmod "$(cat /usr/lib/modules/$_EXTRAMODULES/version)" >/dev/null 2>&1
}
post_remove() {
- _post_install
+ post_upgrade $1 0
groupdel cdemu
}