Browse Source

xap/virtualbox-ose: Add the option to build a headless server.

slackware-14.2
Damien Goutte-Gattat 13 years ago
parent
commit
861a605b99
  1. 4
      xap/virtualbox-ose/doinst.sh
  2. 35
      xap/virtualbox-ose/virtualbox-ose.SlackBuild

4
xap/virtualbox-ose/doinst.sh

@ -20,5 +20,7 @@ chown root:vbox /usr/bin/VBoxTunctl /usr/share/virtualbox/VBoxSysInfo.sh
chown -R root:vbox /usr/lib/virtualbox/
for i in VirtualBox VBoxSDL VBoxHeadless; do
chmod 4750 /usr/lib/virtualbox/$i
if [ -f /usr/lib/virtualbox/$i ]; then
chmod 4750 /usr/lib/virtualbox/$i
fi
done

35
xap/virtualbox-ose/virtualbox-ose.SlackBuild

@ -58,6 +58,15 @@ OUT=${OUT:-$TMP/build}
PKG=${PKG:-$OUT/$NAMEPKG}
CWD=$(pwd)
# Build a headless server?
HEADLESS=${HEADLESS:-no}
CONFIGURE_EXTRA_OPTS=""
SYMLINKS="VirtualBox VBoxManage VBoxSDL VBoxHeadless VBoxVRDP"
if [ "x$HEADLESS" = xyes ]; then
CONFIGURE_EXTRA_OPTS="--build-headless"
SYMLINKS="VBoxManage VBoxHeadless VBoxVRDP"
fi
set -e # Quit if a command returns non-zero
# Sanity checks
@ -113,7 +122,7 @@ CFLAGS=$CPUOPT \
CXXFLAGS=$CPUOPT \
./configure \
--disable-kmods \
--disable-pulse
--disable-pulse $CONFIGURE_EXTRA_OPTS
. env.sh
sed -e "s,/usr/lib/virtualbox,$LIBDIR," $CWD/LocalConfig.kmk > LocalConfig.kmk
kmk -j ${JOBS} LOCALCFG=LocalConfig.kmk
@ -123,25 +132,33 @@ mkdir -p $PKG/etc/vbox \
$PKG/lib/udev/rules.d \
$PKG/usr/bin \
$PKG$LIBDIR \
$PKG/usr/share/applications \
$PKG/usr/share/pixmaps \
$PKG/usr/share/virtualbox \
$PKG/usr/doc/$NAMEPKG-$VERSION \
$PKG/usr/src \
$PKG/install
if [ "x$HEADLESS" = xno ]; then
mkdir -p $PKG/usr/share/applications $PKG/usr/share/pixmaps
fi
# Install config file and udev rule
echo "INSTALL_DIR='$LIBDIR'" > $PKG/etc/vbox/vbox.cfg.new
echo 'KERNEL=="vboxdrv", NAME"vboxdrv", OWNER="root", GROUP="vbox", ' \
'MODE="0660"' > $PKG/lib/udev/rules.d/60-vboxdrv.rules
# Install main files
# Install built files
(
cd out/linux.$ARCHNAME/release/bin
mv VBox.png $PKG/usr/share/pixmaps/
mv VirtualBox.desktop $PKG/usr/share/applications
if [ "x$HEADLESS" = xno ]; then
mv VBox.png $PKG/usr/share/pixmaps/
mv nls *.tar.gz $PKG/usr/share/virtualbox/
sed 's,^Doc.*$,DocPath=file:///usr/share/virtualbox/UserManual.pdf,' \
VirtualBox.desktop > $PKG/usr/share/applications/VirtualBox.desktop
rm VirtualBox.desktop
else
rm VBox.png
fi
mv src $PKG/usr/src/virtualbox-kmods-$VERSION
mv sdk nls *.tar.gz $PKG/usr/share/virtualbox/
mv sdk $PKG/usr/share/virtualbox/
install -m 750 VBoxSysInfo.sh $PKG/usr/share/virtualbox/
install -m 750 VBoxTunctl $PKG/usr/bin
rm VBoxSysInfo.sh VBoxTunctl
@ -151,15 +168,13 @@ echo 'KERNEL=="vboxdrv", NAME"vboxdrv", OWNER="root", GROUP="vbox", ' \
)
# Create symlinks
for i in VirtualBox VBoxManage VBoxSDL VBoxHeadless VBoxVRDP ; do
for i in $SYMLINKS ; do
ln -s $LIBDIR/VBox $PKG/usr/bin/$i
done
# Copy auxiliary files
cp $CWD/$GUESTISO $PKG/usr/share/virtualbox/
cp $CWD/UserManual.pdf $PKG/usr/share/virtualbox/
sed -ri 's,^DocPath=.*$,DocPath=file:///usr/share/virtualbox/UserManual.pdf,' \
$PKG/usr/share/applications/VirtualBox.desktop
# Install the documentation
mkdir -p $PKG/usr/doc/$NAMEPKG-$VERSION

Loading…
Cancel
Save