summaryrefslogtreecommitdiff
path: root/system/virtualbox-ose/virtualbox-ose.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'system/virtualbox-ose/virtualbox-ose.SlackBuild')
-rw-r--r--system/virtualbox-ose/virtualbox-ose.SlackBuild151
1 files changed, 70 insertions, 81 deletions
diff --git a/system/virtualbox-ose/virtualbox-ose.SlackBuild b/system/virtualbox-ose/virtualbox-ose.SlackBuild
index 5251b92707..f6e26c2005 100644
--- a/system/virtualbox-ose/virtualbox-ose.SlackBuild
+++ b/system/virtualbox-ose/virtualbox-ose.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for virtualbox-ose
-# Copyright 2008-2009 Heinz Wiesinger <pprkut@liwjatan.at>
+# Copyright 2008-2009 Heinz Wiesinger, Amsterdam, The Netherlands
# Copyright 2008 Mauro Giachero <mauro.giachero@gmail.com>
# All rights reserved.
#
@@ -25,9 +25,9 @@
PRGNAM=virtualbox-ose
SRCNAM=VirtualBox
-VERSION=2.1.4
+VERSION=3.1.2
ARCH=${ARCH:-i486}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
CWD=$(pwd)
@@ -39,42 +39,42 @@ OUTPUT=${OUTPUT:-/tmp}
JOBS=${JOBS:-3}
# Define Variable Names
-GUI=""
qtgui=""
-# Support for the pulseaudio-backend
-if [ "${PULSE:-no}" = "no" ]; then
- do_pulse="--disable-pulse"
-else
- do_pulse=""
-fi
-
-# Using the vboxusers-group
-VBOXUSERS=${VBOXUSERS:-yes}
-
-if [ "$VBOXUSERS" = "yes" ]; then
- # Check for vboxusers group here
- if ! grep ^vboxusers: /etc/group 2>&1 > /dev/null; then
- echo " You must have a vboxusers group to run this script."
- echo " # groupadd -g 215 vboxusers"
- exit 1
- fi
+# Check for vboxusers group here
+if ! grep ^vboxusers: /etc/group 2>&1 > /dev/null; then
+ echo " You must have a vboxusers group to run this script."
+ echo " # groupadd -g 215 vboxusers"
+ exit 1
fi
# Enable Hardening - Defaulting to yes as requested by upstream
if [ "${HARDENING:-yes}" = "yes" ]; then
harden="--enable-hardening"
- VBOXUSERS="yes"
else
harden="--disable-hardening"
fi
+if [ "${WEBSERVICE:-no}" = "yes" ]; then
+ web_service="--enable-webservice"
+ vboxwebsrv="vboxwebsrv"
+else
+ web_service=""
+ vboxwebsrv=""
+fi
+
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+ BUILDDIR="x86"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+ BUILDDIR="x86"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+ BUILDDIR="amd64"
fi
set -e
@@ -83,50 +83,27 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $SRCNAM-${VERSION}_OSE
-tar xvf $CWD/$SRCNAM-${VERSION}-3-OSE.tar.bz2
+tar xvf $CWD/$SRCNAM-${VERSION}-OSE.tar.bz2
cd $SRCNAM-${VERSION}_OSE
chown -R root:root .
chmod -R u+w,go+r-w,a-s .
-patch -d src/VBox/Installer/linux -i $CWD/VBox.diff
-
-# The Innotek init script tries to set the device nodes' permissions.
-# This is problematic with VBOXUSERS=no, but you probably still want
-# this for security reasons when using the vboxusers-group
-if [ "$VBOXUSERS" = "yes" ]; then
- GROUP="vboxusers"
- MODE="750"
- mkdir -p $PKG/lib/udev/rules.d
- echo 'KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="vboxusers", MODE="0660"' \
- > $PKG/lib/udev/rules.d/60-vboxdrv.rules
-else
- patch -d src/VBox/Installer/linux -i $CWD/vboxdrv.sh.in.diff
- GROUP="root"
- MODE="755"
- mkdir -p $PKG/lib/udev/rules.d
- echo 'KERNEL=="vboxdrv", NAME="vboxdrv", MODE="0666"' \
- > $PKG/lib/udev/rules.d/60-vboxdrv.rules
-fi
+GROUP="vboxusers"
+MODE="750"
+mkdir -p $PKG/lib/udev/rules.d
+echo 'KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="vboxusers", MODE="0660"' \
+ > $PKG/lib/udev/rules.d/60-vboxdrv.rules
-# Support for the qt3-frontend
-if [ "${QT3:-no}" = "no" ]; then
- qtgui+=" --disable-qt3"
-else
- qtgui+=" --with-qt-dir=/usr/lib/qt"
- GUI+=" VirtualBox3"
- mkdir -p $PKG/usr/share/applications
- cp -f $CWD/VirtualBox3.desktop $PKG/usr/share/applications/
- sed -i "s|\$VBOX_DOC_PATH|/usr/share/virtualbox|" \
- $PKG/usr/share/applications/VirtualBox3.desktop
-fi
+# We don't want a init-script building kernel modules.
+# Use virtualbox-kernel.SlackBuild for this.
+patch -d src/VBox/Installer/linux -i $CWD/vboxdrv.sh-setup.diff
# Support for the qt4-frontend
if [ "${QT4:-yes}" = "yes" ]; then
- GUI+=" VirtualBox"
mkdir -p $PKG/usr/share/applications
- cp -f src/VBox/Installer/linux/VirtualBox.desktop $PKG/usr/share/applications/
+ cp -f src/VBox/Installer/linux/virtualbox.desktop $PKG/usr/share/applications/
sed -i "s|\$VBOX_DOC_PATH|/usr/share/virtualbox|" \
- $PKG/usr/share/applications/VirtualBox.desktop
+ $PKG/usr/share/applications/virtualbox.desktop
else
qtgui+=" --disable-qt4"
fi
@@ -136,58 +113,70 @@ CXXFLAGS="$SLKCFLAGS" \
./configure \
--ose \
--disable-kmods \
+ --disable-pulse \
+ $web_service \
$harden \
- $qtgui \
- $do_pulse
+ $qtgui
+
+. ./env.sh
-. env.sh
+cp $CWD/LocalConfig.kmk .
+sed -i "s|LIBDIR|lib$LIBDIRSUFFIX|" ./LocalConfig.kmk
-kmk -j ${JOBS} LOCALCFG=$CWD/LocalConfig.kmk
+kmk -j ${JOBS} LOCALCFG=./LocalConfig.kmk
-mkdir -p $PKG/usr/{lib,share}/virtualbox \
+mkdir -p $PKG/usr/{lib$LIBDIRSUFFIX,share,include}/virtualbox \
$PKG/usr/{bin,src} \
$PKG/usr/share/pixmaps \
- $PKG/etc/{rc.d,vbox}
+ $PKG/etc/{default,rc.d,vbox}
cp -f src/VBox/Installer/linux/vboxdrv.sh.in $PKG/etc/rc.d/rc.vboxdrv.new
+sed -i "s/%PACKAGE%/virtualbox/g" $PKG/etc/rc.d/rc.vboxdrv.new
+sed -i "s/%NOLSB%/yes/" $PKG/etc/rc.d/rc.vboxdrv.new
+sed -i "s/%DEBIAN%/no/" $PKG/etc/rc.d/rc.vboxdrv.new
+sed -i "s/\[ -z \"\$DEBIAN\"/#\[ -z \"\$DEBIAN\"/" $PKG/etc/rc.d/rc.vboxdrv.new
+
cp -f $CWD/vbox.cfg $PKG/etc/vbox/vbox.cfg.new
+sed -i "s|LIBDIR|lib$LIBDIRSUFFIX|" $PKG/etc/vbox/vbox.cfg.new
+cp -f $CWD/virtualbox.default $PKG/etc/default/virtualbox.new
-cd out/linux.x86/release/bin/
- rm -f vboxdrv.ko VirtualBox.desktop
+cd out/linux.$BUILDDIR/release/bin/
+ rm -f vboxdrv.ko virtualbox.desktop
mv VBox.png $PKG/usr/share/pixmaps/
mv src $PKG/usr/src/virtualbox-kernel-$VERSION
mv sdk nls* *.tar.gz $PKG/usr/share/virtualbox/
install -m $MODE -g $GROUP VBoxSysInfo.sh $PKG/usr/share/virtualbox/
install -m $MODE -g $GROUP VBoxTunctl $PKG/usr/bin/
rm -f VoxSysInfo.sh VBoxTunctl
- mv * $PKG/usr/lib/virtualbox/
- chown -R root:$GROUP $PKG/usr/lib/virtualbox/
- chmod -R $MODE $PKG/usr/lib/virtualbox/
- mv $PKG/usr/lib/virtualbox/VBox.sh $PKG/usr/lib/virtualbox/VBox
+ mv * $PKG/usr/lib$LIBDIRSUFFIX/virtualbox/
+ chown -R root:$GROUP $PKG/usr/lib$LIBDIRSUFFIX/virtualbox/
+ chmod -R $MODE $PKG/usr/lib$LIBDIRSUFFIX/virtualbox/
+ mv $PKG/usr/lib$LIBDIRSUFFIX/virtualbox/VBox.sh $PKG/usr/lib$LIBDIRSUFFIX/virtualbox/VBox
cd -
-for i in $GUI VBoxManage VBoxSDL VBoxHeadless VBoxVRDP; do
- ln -s /usr/lib/virtualbox/VBox $PKG/usr/bin/$i ;
+for i in VirtualBox VBoxManage VBoxSDL VBoxHeadless VBoxVRDP $vboxwebsrv; do
+ ln -s /usr/lib$LIBDIRSUFFIX/virtualbox/VBox $PKG/usr/bin/$i ;
done
if [ "$harden" = "--enable-hardening" ]; then
- for i in $GUI VBoxSDL VBoxHeadless; do
- chmod 4${MODE} $PKG/usr/lib/virtualbox/$i
+ for i in VirtualBox VBoxSDL VBoxHeadless; do
+ chmod 4${MODE} $PKG/usr/lib$LIBDIRSUFFIX/virtualbox/$i
done
fi
-if [ -e "$CWD/VBoxGuestAdditions_$VERSION.iso" ]; then
- cp -f $CWD/VBoxGuestAdditions_$VERSION.iso \
- $PKG/usr/share/virtualbox/VBoxGuestAdditions.iso
-fi
+# install headers. Needed by some third party tools
+cp -rf include/* $PKG/usr/include/virtualbox/
+rm -f $PKG/usr/include/virtualbox/Makefile.kmk
-if [ -e "$CWD/UserManual.pdf" ]; then
- cp -f $CWD/UserManual.pdf \
- $PKG/usr/share/virtualbox/UserManual.pdf
-fi
+cp -f $CWD/VBoxGuestAdditions_$VERSION.iso \
+ $PKG/usr/share/virtualbox/VBoxGuestAdditions.iso
+
+cp -f $CWD/UserManual.pdf \
+ $PKG/usr/share/virtualbox/UserManual.pdf
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -f COPYING COPYING.CDDL $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/README.SLACKWARE > $PKG/usr/doc/$PRGNAM-$VERSION/README.SLACKWARE
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
@@ -195,4 +184,4 @@ cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}