updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / vhba-module-all / PKGBUILD
blob9cff0557eacb630793182bbd6fb737d8ca048f32
2 # Mantainer: M0Rf39
3 # Contributor: Charles Lindsay <charles@chaoslizard.org>
5 pkgname=vhba-module-all
6 pkgver=20110416
7 pkgrel=1
8 pkgdesc="Kernel module that emulates SCSI devices (builded for all kernels)"
9 arch=('i686' 'x86_64')
10 url="http://cdemu.sourceforge.net/"
11 license=('GPL2')
12 depends=('linux')
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.
23 USE_PACMAN_VERSION=0
25 build() {
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/'`
29   else
30     _PACKAGES=`pacman -Qsq linux`
31     _KERNELS=`pacman -Ql $PACKAGES | grep /modules.alias.bin | sed 's/linux.*\/lib\/modules\/\(.*\)\/modules.alias.bin/\1/g'`
32   fi
34   # Loop through all detected kernels
35   for _kernver in $_KERNELS;
36   do  
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"
42   done
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')