3 # Contributor: Charles Lindsay <charles@chaoslizard.org>
5 pkgname=vhba-module-all
8 pkgdesc="Kernel module that emulates SCSI devices (builded for all kernels)"
10 url="http://cdemu.sourceforge.net/"
13 makedepends=('kernel26-headers' 'git')
14 provides=('vhba-module')
15 conflicts=('vhba-module')
16 install=vhba-module.install
17 source=(http://downloads.sourceforge.net/cdemu/vhba-module-$pkgver.tar.gz
18 vhba-kernel2.6.37.patch)
19 ### Enable using of version numbers from pacman. This should only be used if you have kernels with
20 ### long version numbers (for example if compiled with git-suffixes). This will not work with kernels
21 ### compiled outside pacman's management, and takes much longer than the canonical method, due to
22 ### needing to search the local repository. Set to '1' to enable.
26 cd "$srcdir/vhba-module-$pkgver"
27 if [ "$USE_PACMAN_VERSION" = "0" ]; then
28 _KERNELS=`file /boot/* | grep 'Linux kernel.*boot executable' | sed 's/.*version \([^ ]\+\).*/\1/'`
30 _PACKAGES=`pacman -Qsq linux`
31 _KERNELS=`pacman -Ql $PACKAGES | grep /modules.alias.bin | sed 's/linux.*\/lib\/modules\/\(.*\)\/modules.alias.bin/\1/g'`
34 # Loop through all detected kernels
35 for _kernver in $_KERNELS;
37 cd ${srcdir}/vhba-module-${pkgver}
38 echo Building module for $_kernver
39 make -j1 KDIR=/usr/src/linux-${_kernver} || return 1
40 install -D vhba.ko "$pkgdir/lib/modules/${_kernver}/extra/vhba.ko" || return 1
41 sed -i -e "s/KERNEL_VERSION='.*'/KERNEL_VERSION='${_kernver}'/" "$startdir/vhba-module.install"
45 # git apply -p2 ../vhba-kernel2.6.37.patch
46 make -j1 KDIR=/usr/src/linux-${_kernver} || return 1
47 install -D vhba.ko "$pkgdir/lib/modules/${_kernver}/extra/vhba.ko" || return 1
48 sed -i -e "s/KERNEL_VERSION='.*'/KERNEL_VERSION='${_kernver}'/" "$startdir/vhba-module.install"
50 md5sums=('2f91dd4ee8648da92d625221d4275b60'
51 'f0499fc54f6ef9b8d6ca0b9e940c5906')