blob: e3862c9731ec30330b714cb3b7c0d6fe109458ca (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
# $Id: PKGBUILD 93064 2013-06-23 17:40:06Z seblu $
# Maintainer: Ionut Biru <ibiru@archlinux.org>
# Maintainer: Sébastien Luttringer
pkgbase=virtualbox-modules
pkgname=('virtualbox-host-modules' 'virtualbox-guest-modules')
pkgver=4.2.14
pkgrel=1
arch=('i686' 'x86_64')
url='http://virtualbox.org'
license=('GPL')
makedepends=('linux'
'linux-headers'
"virtualbox-host-dkms>=$pkgver"
"virtualbox-guest-dkms>=$pkgver"
'expac'
'sed'
'bc')
build() {
_kernmaj=$(expac -Q '%v' linux|sed -r 's/([[:digit:]]+\.[[:digit:]]+).*/\1/')
_kernver=$(< /usr/lib/modules/extramodules-$_kernmaj-ARCH/version)
# dkms need modification to be run as user
cp -r /var/lib/dkms .
echo "dkms_tree='$srcdir/dkms'" > dkms.conf
# build host modules
msg2 'Host modules'
dkms --dkmsframework dkms.conf build "vboxhost/$pkgver" -k "$_kernver"
# build guest modules
msg2 'Guest modules'
dkms --dkmsframework dkms.conf build "vboxguest/$pkgver" -k "$_kernver"
}
package_virtualbox-host-modules(){
_kernmaj=$(expac -Q '%v' linux|sed -r 's/([[:digit:]]+\.[[:digit:]]+).*/\1/')
_kernver=$(< /usr/lib/modules/extramodules-$_kernmaj-ARCH/version)
pkgdesc='Host kernel modules for VirtualBox'
depends=("linux>=$_kernmaj" "linux<$(echo "$_kernmaj+0.1"|bc)")
replaces=('virtualbox-modules')
conflicts=('virtualbox-modules')
install=virtualbox-host-modules.install
cd "dkms/vboxhost/$pkgver/$_kernver/$CARCH/module"
install -dm755 "$pkgdir/usr/lib/modules/extramodules-$_kernmaj-ARCH/"
install -m644 * "$pkgdir/usr/lib/modules/extramodules-$_kernmaj-ARCH/"
find "$pkgdir" -name '*.ko' -exec gzip -9 {} +
sed -ie "s/VERSION='.*'/VERSION='$_kernver'/" "$startdir/virtualbox-host-modules.install"
}
package_virtualbox-guest-modules(){
_kernmaj=$(expac -Q '%v' linux|sed -r 's/([[:digit:]]+\.[[:digit:]]+).*/\1/')
_kernver=$(< /usr/lib/modules/extramodules-$_kernmaj-ARCH/version)
pkgdesc='Guest kernel modules for VirtualBox'
license=('GPL')
depends=("linux>=$_kernmaj" "linux<$(echo "$_kernmaj+0.1"|bc)")
replaces=('virtualbox-archlinux-modules')
conflicts=('virtualbox-archlinux-modules')
install=virtualbox-guest-modules.install
cd "dkms/vboxguest/$pkgver/$_kernver/$CARCH/module"
install -dm755 "$pkgdir/usr/lib/modules/extramodules-$_kernmaj-ARCH/"
install -m644 * "$pkgdir/usr/lib/modules/extramodules-$_kernmaj-ARCH/"
find "$pkgdir" -name '*.ko' -exec gzip -9 {} +
sed -ie "s/VERSION='.*'/VERSION='$_kernver'/" "$startdir/virtualbox-guest-modules.install"
}
# vim:set ts=2 sw=2 et:
|