From 3b77f3854cf2d73197e7f9d213b95390f25f7d33 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 11 Jan 2011 16:12:28 +0100 Subject: [PATCH] virtualbox-ose: add a rc script to (un)load host modules, disable makeself/mkisofs builddeps. --- srcpkgs/virtualbox-ose/INSTALL | 6 ---- srcpkgs/virtualbox-ose/files/virtualbox.rc | 33 +++++++++++++++++++ .../patches/virtualbox-4-makeself-check.patch | 10 ++++++ .../patches/virtualbox-4-mkisofs-check.patch | 10 ++++++ srcpkgs/virtualbox-ose/template | 9 +++-- 5 files changed, 59 insertions(+), 9 deletions(-) create mode 100644 srcpkgs/virtualbox-ose/files/virtualbox.rc create mode 100644 srcpkgs/virtualbox-ose/patches/virtualbox-4-makeself-check.patch create mode 100644 srcpkgs/virtualbox-ose/patches/virtualbox-4-mkisofs-check.patch diff --git a/srcpkgs/virtualbox-ose/INSTALL b/srcpkgs/virtualbox-ose/INSTALL index 9c137d1f2e2..20aa9ead5aa 100644 --- a/srcpkgs/virtualbox-ose/INSTALL +++ b/srcpkgs/virtualbox-ose/INSTALL @@ -3,12 +3,6 @@ post) cat <<_EOF ================================================================= -To use VirtualBox the following modules should be loaded: - vboxdrv, vboxnetadp, vboxnetflt - -You can load them at boot in /etc/conf.d/modules, like: - modules="vboxdrv vboxnetadp vboxnetflt" - You should also add your user to the 'vboxusers' group to be able to use some VirtualBox features, e.g USB. diff --git a/srcpkgs/virtualbox-ose/files/virtualbox.rc b/srcpkgs/virtualbox-ose/files/virtualbox.rc new file mode 100644 index 00000000000..ed184f2d79d --- /dev/null +++ b/srcpkgs/virtualbox-ose/files/virtualbox.rc @@ -0,0 +1,33 @@ +#!/sbin/runscript +# +# OpenRC service for VirtualBox. + +name="VirtualBox module (un)loader" + +depend() +{ + provide virtualbox + need sysfs +} + +start() +{ + ebegin "Loading VirtualBox host modules" + for _mod_ in vboxdrv vboxnetadp vboxnetflt; do + if grep -vq '^${_mod_}' /proc/modules; then + modprobe -q ${_mod_} + fi + done + eend $? +} + +stop() +{ + ebegin "Unloading VirtualBox host modules" + for _mod_ in vboxnetflt vboxnetadp vboxdrv; do + if ! grep -q '^${_mod_}' /proc/modules; then + modprobe -rq ${_mod_} + fi + done + eend $? +} diff --git a/srcpkgs/virtualbox-ose/patches/virtualbox-4-makeself-check.patch b/srcpkgs/virtualbox-ose/patches/virtualbox-4-makeself-check.patch new file mode 100644 index 00000000000..2b1a3694fb4 --- /dev/null +++ b/srcpkgs/virtualbox-ose/patches/virtualbox-4-makeself-check.patch @@ -0,0 +1,10 @@ +--- configure.orig ++++ configure +@@ -2527,7 +2527,6 @@ + check_compiler_h + [ "$BUILD_MACHINE" = "amd64" -a $WITH_VMMRAW -eq 1 ] && check_32bit + # tools/common/makeself* +- [ $OSE -ge 1 ] && check_makeself + fi + + [ -n "$SETUP_WINE" ] && setup_wine diff --git a/srcpkgs/virtualbox-ose/patches/virtualbox-4-mkisofs-check.patch b/srcpkgs/virtualbox-ose/patches/virtualbox-4-mkisofs-check.patch new file mode 100644 index 00000000000..e1db9102470 --- /dev/null +++ b/srcpkgs/virtualbox-ose/patches/virtualbox-4-mkisofs-check.patch @@ -0,0 +1,10 @@ +--- configure.orig ++++ configure +@@ -2499,7 +2499,6 @@ + # don't check for yasm for the time beeing as 0.40 and 0.50 both have known bugs + # [ "$OS" != "darwin" ] && check_yasm + [ "$OS" != "darwin" ] && check_xsltproc +-[ "$OS" != "darwin" ] && check_mkisofs + + # the libraries + [ "$OS" != "darwin" ] && check_pthread diff --git a/srcpkgs/virtualbox-ose/template b/srcpkgs/virtualbox-ose/template index 1cb76c96efe..0b7113f013c 100644 --- a/srcpkgs/virtualbox-ose/template +++ b/srcpkgs/virtualbox-ose/template @@ -1,7 +1,7 @@ # Template file for 'virtualbox-ose' pkgname=virtualbox-ose version=4.0.0 -revision=1 +revision=2 wrksrc="VirtualBox-${version}_OSE" distfiles="http://download.virtualbox.org/virtualbox/$version/VirtualBox-$version.tar.bz2" build_style=custom-install @@ -15,6 +15,7 @@ long_desc=" system_groups="vboxusers" gtk_iconcache_dirs="/usr/share/icons/hicolor" subpackages="${pkgname}-dkms ${pkgname}-guest ${pkgname}-guest-dkms" +openrc_services="virtualbox default true" Add_dependency run libgcc Add_dependency run glibc @@ -62,8 +63,6 @@ Add_dependency build docbook-xsl Add_dependency build acpica-utils Add_dependency build kernel-headers Add_dependency build dev86 -Add_dependency build makeself -Add_dependency build cdrtools if [ "${xbps_machine}" = "x86_64" ]; then Add_dependency build gcc-c++-multilib fi @@ -136,6 +135,10 @@ do_install() install -d ${DESTDIR}/usr/share/licenses/${pkgname} install -m0644 ${wrksrc}/COPYING* \ ${DESTDIR}/usr/share/licenses/${pkgname} + # Install the OpenRC service. + install -D -m755 ${FILESDIR}/virtualbox.rc \ + ${DESTDIR}/etc/init.d/virtualbox + # # virtualbox-ose-dkms. #