summaryrefslogtreecommitdiff
path: root/community/virtualbox-modules-lts
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-09-19 03:25:17 -0700
committerroot <root@rshg054.dnsready.net>2012-09-19 03:25:17 -0700
commite8f387c8a45ee846f01fed02259d061d2d6e8d3d (patch)
tree5c1fa60af0dbc3b6dccaeb1055cf80de789b10b0 /community/virtualbox-modules-lts
parent3e9f7fe2a26ee7496abdc6e9e4b54c4f5caddcae (diff)
Wed Sep 19 03:25:16 PDT 2012
Diffstat (limited to 'community/virtualbox-modules-lts')
-rw-r--r--community/virtualbox-modules-lts/PKGBUILD69
-rwxr-xr-xcommunity/virtualbox-modules-lts/build.sh20
-rw-r--r--community/virtualbox-modules-lts/virtualbox-guest-modules-lts.install16
-rw-r--r--community/virtualbox-modules-lts/virtualbox-host-modules-lts.install18
4 files changed, 123 insertions, 0 deletions
diff --git a/community/virtualbox-modules-lts/PKGBUILD b/community/virtualbox-modules-lts/PKGBUILD
new file mode 100644
index 000000000..53f2c101d
--- /dev/null
+++ b/community/virtualbox-modules-lts/PKGBUILD
@@ -0,0 +1,69 @@
+# $Id: PKGBUILD 76475 2012-09-18 19:15:56Z seblu $
+# Maintainer: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>
+# Contributor: Ionut Biru <ibiru@archlinux.org>
+# Contributor: Sébastien Luttringer <seblu@aur.archlinux.org>
+
+pkgbase=virtualbox-modules-lts
+pkgname=('virtualbox-host-modules-lts' 'virtualbox-guest-modules-lts')
+pkgver=4.2.0
+pkgrel=2
+arch=('i686' 'x86_64')
+url='http://virtualbox.org'
+license=('GPL')
+makedepends=('linux-lts-headers'
+ "virtualbox-host-source>=$pkgver"
+ "virtualbox-guest-source>=$pkgver"
+ 'expac')
+
+build() {
+ # current kernel version
+ _kernver=$(expac -Q '%v' linux-lts-headers)-lts
+ # 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-lts(){
+ pkgdesc='Host kernel modules for VirtualBox'
+ depends=('linux-lts>=3.0' 'linux-lts<3.1')
+ replaces=('virtualbox-modules-lts')
+ conflicts=('virtualbox-modules-lts')
+ provides=("virtualbox-host-modules=$pkgver")
+ install=virtualbox-host-modules-lts.install
+
+ _kernver=$(expac -Q '%v' linux-lts-headers)-lts
+ _extraver=extramodules-${_kernver%.*}-lts
+
+ install -dm755 "$pkgdir/usr/lib/modules/$_extraver"
+ cd "dkms/vboxhost/$pkgver/$_kernver/$CARCH/module"
+ install -m644 * "$pkgdir/usr/lib/modules/$_extraver"
+ find "$pkgdir" -name '*.ko' -exec gzip -9 {} +
+ sed -ie "s/EXTRAMODULES='.*'/EXTRAMODULES='$_extraver'/" "$startdir/virtualbox-host-modules-lts.install"
+}
+
+package_virtualbox-guest-modules-lts(){
+ pkgdesc='Guest kernel modules for VirtualBox'
+ license=('GPL')
+ depends=('linux-lts>=3.0' 'linux-lts<3.1')
+ replaces=('virtualbox-archlinux-modules-lts')
+ conflicts=('virtualbox-archlinux-modules-lts')
+ provides=("virtualbox-host-modules=$pkgver")
+ install=virtualbox-guest-modules-lts.install
+
+ _kernver=$(expac -Q '%v' linux-lts-headers)-lts
+ _extraver=extramodules-${_kernver%.*}-lts
+
+ install -dm755 "$pkgdir/usr/lib/modules/$_extraver"
+ cd "dkms/vboxguest/$pkgver/$_kernver/$CARCH/module"
+ install -m644 * "$pkgdir/usr/lib/modules/$_extraver"
+ find "$pkgdir" -name '*.ko' -exec gzip -9 {} +
+ sed -ie "s/EXTRAMODULES='.*'/EXTRAMODULES='$_extraver'/" "$startdir/virtualbox-guest-modules-lts.install"
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/community/virtualbox-modules-lts/build.sh b/community/virtualbox-modules-lts/build.sh
new file mode 100755
index 000000000..828448cab
--- /dev/null
+++ b/community/virtualbox-modules-lts/build.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+if (( $# != 1 )); then
+ echo "usage: $0 extra"
+ echo " $0 testing"
+ exit 1
+fi
+
+$1-i686-build
+linux32 makechrootpkg -I ../../virtualbox/trunk/virtualbox-host-source-*-i686.pkg.tar.xz -r /var/lib/archbuild/$1-i686
+linux32 makechrootpkg -I ../../virtualbox/trunk/virtualbox-guest-source-*-i686.pkg.tar.xz -r /var/lib/archbuild/$1-i686
+linux32 makechrootpkg -r /var/lib/archbuild/$1-i686
+
+$1-x86_64-build
+makechrootpkg -I ../../virtualbox/trunk/virtualbox-host-source-*-x86_64.pkg.tar.xz -r /var/lib/archbuild/$1-x86_64
+makechrootpkg -I ../../virtualbox/trunk/virtualbox-guest-source-*-x86_64.pkg.tar.xz -r /var/lib/archbuild/$1-x86_64
+makechrootpkg -r /var/lib/archbuild/$1-x86_64
+
+
+# vim:set ts=2 sw=2 ft=sh et:
diff --git a/community/virtualbox-modules-lts/virtualbox-guest-modules-lts.install b/community/virtualbox-modules-lts/virtualbox-guest-modules-lts.install
new file mode 100644
index 000000000..d2984a743
--- /dev/null
+++ b/community/virtualbox-modules-lts/virtualbox-guest-modules-lts.install
@@ -0,0 +1,16 @@
+EXTRAMODULES='extramodules-3.0-lts'
+
+post_install() {
+cat << EOF
+===> You may want to load vboxguest, vboxsf and vboxvideo
+EOF
+ depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
+}
+
+post_upgrade() {
+ depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
+}
+
+post_remove() {
+ depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
+}
diff --git a/community/virtualbox-modules-lts/virtualbox-host-modules-lts.install b/community/virtualbox-modules-lts/virtualbox-host-modules-lts.install
new file mode 100644
index 000000000..07ecf7311
--- /dev/null
+++ b/community/virtualbox-modules-lts/virtualbox-host-modules-lts.install
@@ -0,0 +1,18 @@
+EXTRAMODULES='extramodules-3.0-lts'
+
+post_install() {
+cat << EOF
+===> You must load vboxdrv module before starting VirtualBox:
+===> # modprobe vboxdrv
+EOF
+ depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
+}
+
+post_upgrade() {
+ depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
+ echo 'In order to use the new version, reload all virtualbox modules manually.'
+}
+
+post_remove() {
+ depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
+}