[Pkg-virtualbox-commits] r134 - trunk/debian
bengen at alioth.debian.org
bengen at alioth.debian.org
Fri Dec 14 16:58:00 UTC 2007
Author: bengen
Date: 2007-12-14 16:58:00 +0000 (Fri, 14 Dec 2007)
New Revision: 134
Added:
trunk/debian/virtualbox-ose-guest-source.dirs
trunk/debian/virtualbox-ose-source.dirs
trunk/debian/virtualbox-ose.init
trunk/debian/virtualbox-ose.links
Modified:
trunk/debian/changelog
trunk/debian/rules
trunk/debian/virtualbox-ose-guest-utils.dirs
Log:
Changes to the build system:
- Cleaned up patch/config phase
- Added copy of init script to debian directory -- no longer copy it
from src/VBox/Installer/linux/vboxnet.sh
- symlinks/directories in packages are now created using debhelper
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2007-12-10 16:05:20 UTC (rev 133)
+++ trunk/debian/changelog 2007-12-14 16:58:00 UTC (rev 134)
@@ -7,8 +7,13 @@
[ Hilko Bengen ]
* Added support for vditool to VBox.sh
+ * Build system:
+ - Cleaned up patch/config phase
+ - Added copy of init script to debian directory -- no longer copy it
+ from src/VBox/Installer/linux/vboxnet.sh
+ - symlinks/directories in packages are now created using debhelper
- -- Hilko Bengen <bengen at debian.org> Mon, 10 Dec 2007 16:33:16 +0100
+ -- Hilko Bengen <bengen at debian.org> Fri, 14 Dec 2007 17:57:22 +0100
virtualbox-ose (1.5.2-dfsg2-4) unstable; urgency=low
Modified: trunk/debian/rules
===================================================================
--- trunk/debian/rules 2007-12-10 16:05:20 UTC (rev 133)
+++ trunk/debian/rules 2007-12-14 16:58:00 UTC (rev 134)
@@ -18,17 +18,18 @@
MAKE:=kmk
-config.status: patch configure
+config-stamp: env.sh
+env.sh: patch-stamp
dh_testdir
- ./configure --with-linux="/usr"
+ ./configure --with-linux="/usr"
build: build-stamp
-build-stamp: config.status
+build-stamp: config-stamp
dh_testdir
# Building package
$(MAKE) BUILD_TYPE=release
- # make sure VBoxAddIF.sh is build too
+ # make sure VBoxAddIF.sh is built, too
(cd src/VBox/Installer/linux; $(MAKE) `echo $(CURDIR)/out/linux.*/release/bin`/VBoxAddIF.sh)
touch build-stamp
@@ -36,7 +37,6 @@
clean: unpatch
dh_testdir
dh_testroot
- rm -f build-stamp debian/$(sname).init
# Cleaning package
rm -rf out
@@ -82,42 +82,27 @@
mv debian/$(sname)/usr/lib/virtualbox/nls debian/$(sname)/usr/share/virtualbox
mv debian/$(sname)/usr/lib/virtualbox/sdk debian/$(sname)/usr/share/virtualbox
mv debian/$(sname)/usr/share/virtualbox/sdk/bin/xpidl debian/$(sname)/usr/lib/virtualbox/
- ln -s debian/$(sname)/usr/lib/virtualbox/xpidl debian/$(sname)/usr/share/virtualbox/sdk/bin
install -D -m 0755 debian/scripts/VBox.sh debian/$(sname)/usr/lib/virtualbox
mv debian/$(sname)/usr/lib/virtualbox/VBoxTunctl debian/$(sname)/usr/bin/
mv debian/$(sname)/usr/lib/virtualbox/VBoxAddIF.sh debian/$(sname)/usr/bin/VBoxTAP
- ln -s ../lib/virtualbox/VBox.sh debian/$(sname)/usr/bin/vditool
- ln -s ../lib/virtualbox/VBox.sh debian/$(sname)/usr/bin/vboxmanage
- ln -s ../lib/virtualbox/VBox.sh debian/$(sname)/usr/bin/vboxsdl
- ln -s ../lib/virtualbox/VBox.sh debian/$(sname)/usr/bin/virtualbox
- ln -s ../lib/virtualbox/VBox.sh debian/$(sname)/usr/bin/VBoxManage
- ln -s ../lib/virtualbox/VBox.sh debian/$(sname)/usr/bin/VBoxSDL
- ln -s ../lib/virtualbox/VBox.sh debian/$(sname)/usr/bin/VirtualBox
- ln -s VBoxTAP debian/$(sname)/usr/bin/VBoxAddIF
- ln -s VBoxTAP debian/$(sname)/usr/bin/VBoxDeleteIF
-
install -D -m 0644 debian/desktop/virtualbox-ose.desktop debian/$(sname)/usr/share/applications/virtualbox-ose.desktop
mv debian/$(sname)/usr/lib/virtualbox/VBox.png debian/$(sname)/usr/share/icons/virtualbox.png
install -D -m 0644 debian/pixmap/virtualbox-ose.xpm debian/$(sname)/usr/share/pixmaps/virtualbox-ose.xpm
- install -D -m 644 src/VBox/Installer/linux/vboxnet.sh debian/$(sname).init
install -D -m 644 debian/interfaces debian/$(sname)/etc/vbox
echo "# VirtualBox installation directory" > $(CURDIR)/debian/$(sname)/etc/vbox/vbox.cfg
echo "INSTALL_DIR="\"/usr/lib/virtualbox\" >> $(CURDIR)/debian/$(sname)/etc/vbox/vbox.cfg
# Install virtualbox-ose-source
- mkdir -p debian/$(psource)/usr/src/modules/
mv debian/$(sname)/usr/lib/virtualbox/src debian/$(psource)/usr/src/modules/$(sname)
# Install virtualbox-ose-guest-source
- mkdir -p debian/$(gsource)/usr/src/modules/$(gname)
mv debian/$(sname)/usr/lib/virtualbox/additions/src/vboxadd debian/$(gsource)/usr/src/modules/$(gname)
mv debian/$(sname)/usr/lib/virtualbox/additions/src/vboxvfs debian/$(gsource)/usr/src/modules/$(gname)
rm -r debian/$(sname)/usr/lib/virtualbox/additions/src
- mkdir -p debian/$(psource)/usr/src/modules/$(sname)/debian
cp debian/control debian/changelog debian/copyright debian/compat debian/$(psource)/usr/src/modules/$(sname)/debian
cp debian/$(psource).control.modules.in debian/$(psource)/usr/src/modules/$(sname)/debian/control.modules.in
cp debian/$(psource).postinst.modules.in debian/$(psource)/usr/src/modules/$(sname)/debian/postinst.modules.in
@@ -125,7 +110,6 @@
cd debian/$(psource)/usr/src && tar c modules | bzip2 -9 > $(sname).tar.bz2 && rm -rf modules
- mkdir -p debian/$(gsource)/usr/src/modules/$(gname)/debian
cp debian/control debian/changelog debian/copyright debian/compat debian/$(gsource)/usr/src/modules/$(gname)/debian
cp debian/$(gsource).control.modules.in debian/$(gsource)/usr/src/modules/$(gname)/debian/control.modules.in
cp debian/$(gsource).postinst.modules.in debian/$(gsource)/usr/src/modules/$(gname)/debian/postinst.modules.in
@@ -136,7 +120,6 @@
cd debian/$(gsource)/usr/src && tar c modules | bzip2 -9 > $(gname).tar.bz2 && rm -rf modules
# Install virtualbox guest additions
- mkdir -p debian/$(uname)/usr/lib/virtualbox
mv debian/$(sname)/usr/lib/virtualbox/additions/vboxvideo_drv_14.so debian/$(uname)/usr/lib/xorg/modules/drivers/vboxvideo_drv.so
mv debian/$(sname)/usr/lib/virtualbox/additions/vboxmouse_drv_14.so debian/$(uname)/usr/lib/xorg/modules/input/vboxmouse_drv.so
mv debian/$(sname)/usr/lib/virtualbox/additions/mountvboxsf debian/$(uname)/sbin/mount.vboxsf
@@ -182,4 +165,6 @@
dh_builddeb -i
binary: binary-arch binary-indep
-.PHONY: build clean binary-arch binary-indep binary install binary-modules kdist kdist_configure kdist_image kdist_clean
+.PHONY: patch unpatch \
+ config-stamp build clean binary-arch binary-indep binary install \
+ binary-modules kdist kdist_configure kdist_image kdist_clean
Added: trunk/debian/virtualbox-ose-guest-source.dirs
===================================================================
--- trunk/debian/virtualbox-ose-guest-source.dirs (rev 0)
+++ trunk/debian/virtualbox-ose-guest-source.dirs 2007-12-14 16:58:00 UTC (rev 134)
@@ -0,0 +1,4 @@
+usr/src/modules/virtualbox-ose-guest
+usr/src/modules/virtualbox-ose-guest/debian
+usr/src/modules/virtualbox-ose
+usr/src/modules/virtualbox-ose/debian
Modified: trunk/debian/virtualbox-ose-guest-utils.dirs
===================================================================
--- trunk/debian/virtualbox-ose-guest-utils.dirs 2007-12-10 16:05:20 UTC (rev 133)
+++ trunk/debian/virtualbox-ose-guest-utils.dirs 2007-12-14 16:58:00 UTC (rev 134)
@@ -1,6 +1,7 @@
-/usr/lib/xorg/modules/drivers
-/usr/lib/xorg/modules/input
-/usr/sbin
-/usr/bin
-/sbin
-/etc/X11/Xsession.d
+usr/lib/virtualbox
+usr/lib/xorg/modules/drivers
+usr/lib/xorg/modules/input
+usr/sbin
+usr/bin
+sbin
+etc/X11/Xsession.d
Added: trunk/debian/virtualbox-ose-source.dirs
===================================================================
--- trunk/debian/virtualbox-ose-source.dirs (rev 0)
+++ trunk/debian/virtualbox-ose-source.dirs 2007-12-14 16:58:00 UTC (rev 134)
@@ -0,0 +1,2 @@
+usr/src/modules/
+usr/src/modules/virtualbox-ose/debian
Added: trunk/debian/virtualbox-ose.init
===================================================================
--- trunk/debian/virtualbox-ose.init (rev 0)
+++ trunk/debian/virtualbox-ose.init 2007-12-14 16:58:00 UTC (rev 134)
@@ -0,0 +1,400 @@
+#! /bin/sh
+# innotek VirtualBox
+# Linux static host networking interface initialization
+#
+
+#
+# Copyright (C) 2007 innotek GmbH
+#
+# This file is part of VirtualBox Open Source Edition (OSE), as
+# available from http://www.virtualbox.org. This file is free software;
+# you can redistribute it and/or modify it under the terms of the GNU
+# General Public License as published by the Free Software Foundation,
+# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
+# distribution. VirtualBox OSE is distributed in the hope that it will
+# be useful, but WITHOUT ANY WARRANTY of any kind.
+
+# chkconfig: 35 30 60
+# description: VirtualBox permanent host networking setup
+#
+### BEGIN INIT INFO
+# Provides: vboxnet
+# Required-Start: $network
+# Required-Stop:
+# Default-Start: 3 5
+# Default-Stop:
+# Description: VirtualBox permanent host networking setup
+### END INIT INFO
+
+PATH=$PATH:/bin:/sbin:/usr/sbin
+CONFIG="/etc/vbox/interfaces"
+VARDIR="/var/run/VirtualBox"
+VARFILE="/var/run/VirtualBox/vboxnet"
+TAPDEV="/dev/net/tun"
+
+if [ -f /etc/redhat-release ]; then
+ system=redhat
+elif [ -f /etc/SuSE-release ]; then
+ system=suse
+elif [ -f /etc/gentoo-release ]; then
+ system=gentoo
+else
+ system=other
+fi
+
+if [ "$system" = "redhat" ]; then
+ . /etc/init.d/functions
+ fail_msg() {
+ echo_failure
+ echo
+ }
+
+ succ_msg() {
+ echo_success
+ echo
+ }
+
+ begin() {
+ echo -n "$1"
+ }
+fi
+
+if [ "$system" = "suse" ]; then
+ . /etc/rc.status
+ fail_msg() {
+ rc_failed 1
+ rc_status -v
+ }
+
+ succ_msg() {
+ rc_reset
+ rc_status -v
+ }
+
+ begin() {
+ echo -n "$1"
+ }
+fi
+
+if [ "$system" = "gentoo" ]; then
+ . /sbin/functions.sh
+ fail_msg() {
+ eend 1
+ }
+
+ succ_msg() {
+ eend $?
+ }
+
+ begin() {
+ ebegin $1
+ }
+
+ if [ "`which $0`" = "/sbin/rc" ]; then
+ shift
+ fi
+fi
+
+if [ "$system" = "other" ]; then
+ fail_msg() {
+ echo " ...fail!"
+ }
+
+ succ_msg() {
+ echo " ...done."
+ }
+
+ begin() {
+ echo -n $1
+ }
+fi
+
+fail() {
+ if [ "$system" = "gentoo" ]; then
+ eerror $1
+ exit 1
+ fi
+ fail_msg
+ echo "($1)"
+ exit 1
+}
+
+running() {
+ test -f "$VARFILE"
+}
+
+valid_ifname() {
+ if expr match "$1" "vbox[0-9][0-9]*$" > /dev/null 2>&1
+ then
+ return 0
+ else
+ return 1
+ fi
+}
+
+# Create all permanent TAP devices registered on the system, add them to a
+# bridge if required and keep a record of proceedings in the file
+# /var/run/VirtualBox/vboxnet. If this file already exists, assume that the
+# script has already been started and do nothing.
+start_network() {
+ begin "Starting VirtualBox host networking"
+ # If the service is already running, return successfully.
+ if [ -f "$VARFILE" ]
+ then
+ succ_msg
+ return 0
+ fi
+ # Fail if we can't create our runtime record file
+ if [ ! -d "$VARDIR" ]
+ then
+ if ! mkdir "$VARDIR" 2> /dev/null
+ then
+ fail_msg
+ return 1
+ fi
+ fi
+ if ! touch "$VARFILE" 2> /dev/null
+ then
+ fail_msg
+ return 1
+ fi
+ # If there is no configuration file, report success
+ if [ ! -f "$CONFIG" ]
+ then
+ succ_msg
+ return 0
+ fi
+ # Fail if we can't read our configuration
+ if [ ! -r "$CONFIG" ]
+ then
+ fail_msg
+ return 1
+ fi
+ # Fail if we don't have tunctl
+ if ! VBoxTunctl -h 2>&1 | grep VBoxTunctl > /dev/null
+ then
+ fail_msg
+ return 1
+ fi
+ succ_msg
+ # Read the configuration file entries line by line and create the
+ # interfaces
+ while read line
+ do
+ set ""$line
+ # If the line is a comment then ignore it
+ if ((! expr match "$1" "#" > /dev/null) && (! test -z "$1"))
+ then
+ # Check that the line is correctly formed (an interface name plus one
+ # or two non-comment entries, possibly followed by a comment).
+ if ((! expr match "$2" "#" > /dev/null) &&
+ (test -z "$4" || expr match "$4" "#" > /dev/null) &&
+ (valid_ifname "$1"))
+ then
+ # Try to create the interface
+ if VBoxTunctl -t "$1" -u "$2" > /dev/null 2>&1
+ then
+ # On SUSE Linux Enterprise Server, the interface does not
+ # appear immediately, so we loop trying to bring it up.
+ i=1
+ while [ $i -le 10 ]
+ do
+ ifconfig "$1" up 2> /dev/null
+ if ifconfig | grep "$1" > /dev/null 2>&1
+ then
+ # Add the interface to a bridge if one was specified
+ if [ ! -z "$3" ]
+ then
+ if brctl addif "$3" "$1" 2> /dev/null
+ then
+ echo "$1 $2 $3" > "$VARFILE"
+ else
+ echo "$1 $2" > "$VARFILE"
+ echo "Warning - failed to add interface $1 to the bridge $3"
+ fi
+ else
+ echo "$1 $2" > $VARFILE
+ fi
+ i=20
+ else
+ i=`expr $i + 1`
+ sleep .1
+ fi
+ done
+ if [ $i -ne 20 ]
+ then
+ echo "Warning - failed to bring up the interface $1"
+ fi
+ else
+ echo "Warning - failed to create the interface $1 for the user $2"
+ fi
+ else
+ echo "Warning - invalid line in $CONFIG:"
+ echo " $line"
+ fi
+ fi
+ done < "$CONFIG"
+ # Set /dev/net/tun to belong to the group vboxusers if it exists and does
+ # yet belong to a group.
+ if ls -g "$TAPDEV" 2>/dev/null | grep -q root
+ then
+ chgrp vboxusers "$TAPDEV"
+ chmod 0660 "$TAPDEV"
+ fi
+ return 0
+}
+
+# Shut down VirtualBox host networking and remove all permanent TAP
+# interfaces. This action will fail if some interfaces could not be removed.
+stop_network() {
+ begin "Shutting down VirtualBox host networking"
+ # If there is no runtime record file, assume that the service is not
+ # running.
+ if [ ! -f "$VARFILE" ]
+ then
+ succ_msg
+ return 0
+ fi
+ # Fail if we can't read our runtime record file or write to the
+ # folder it is located in
+ if [ ! -r "$VARFILE" -o ! -w "$VARDIR" ]
+ then
+ fail_msg
+ return 1
+ fi
+ # Fail if we don't have tunctl
+ if ! VBoxTunctl -h 2>&1 | grep VBoxTunctl > /dev/null
+ then
+ fail_msg
+ return 1
+ fi
+ # Read the runtime record file entries line by line and delete the
+ # interfaces. The format of the runtime record file is not checked for
+ # errors.
+ while read line
+ do
+ set ""$line
+ # Remove the interface from a bridge if it is part of one
+ if [ ! -z "$3" ]
+ then
+ brctl delif "$3" "$1" 2> /dev/null
+ fi
+ # Remove the interface. Roll back everything and fail if this is not
+ # possible
+ if (! ifconfig "$1" down 2> /dev/null ||
+ ! VBoxTunctl -d "$1" > /dev/null 2>&1)
+ then
+ while read line
+ do
+ set ""$line
+ VBoxTunctl -t "$1" -u "$2" > /dev/null 2>&1
+ ifconfig "$1" up 2> /dev/null
+ if [ ! -z "$3" ]
+ then
+ brctl addif "$3" "$1"
+ fi
+ done < "$VARFILE"
+ fail_msg
+ return 1
+ fi
+ done < "$VARFILE"
+ rm -f "$VARFILE" 2> /dev/null
+ succ_msg
+ return 0
+}
+
+# Shut down VirtualBox host networking and remove all permanent TAP
+# interfaces. This action will succeed even if not all interfaces could be
+# removed. It is only intended for exceptional circumstances such as
+# uninstalling VirtualBox.
+force_stop_network() {
+ begin "Shutting down VirtualBox host networking"
+ # If there is no runtime record file, assume that the service is not
+ # running.
+ if [ ! -f "$VARFILE" ]
+ then
+ succ_msg
+ return 0
+ fi
+ # Fail if we can't read our runtime record file or write to the
+ # folder it is located in
+ if [ ! -r "$VARFILE" -o ! -w "$VARDIR" ]
+ then
+ fail_msg
+ return 1
+ fi
+ # Fail if we don't have tunctl
+ if ! VBoxTunctl -h 2>&1 | grep VBoxTunctl > /dev/null
+ then
+ fail_msg
+ return 1
+ fi
+ # Read the runtime record file entries line by line and delete the
+ # interfaces. The format of the runtime record file is not checked for
+ # errors.
+ while read line
+ do
+ set ""$line
+ # Remove the interface from a bridge if it is part of one
+ if [ ! -z "$3" ]
+ then
+ brctl delif "$3" "$1" 2> /dev/null
+ fi
+ # Remove the interface.
+ ifconfig "$1" down 2> /dev/null
+ VBoxTunctl -d "$1" > /dev/null 2>&1
+ done < "$VARFILE"
+ rm -f "$VARFILE" 2> /dev/null
+ succ_msg
+ return 0
+}
+
+start() {
+ start_network
+}
+
+stop() {
+ stop_network
+}
+
+force_stop() {
+ force_stop_network
+}
+
+restart() {
+ stop_network && start_network
+}
+
+status() {
+ if running; then
+ echo "VirtualBox host networking is loaded."
+ else
+ echo "VirtualBox host networking is not loaded."
+ fi
+}
+
+case "$1" in
+start)
+ start
+ ;;
+stop)
+ stop
+ ;;
+restart)
+ restart
+ ;;
+force-reload)
+ restart
+ ;;
+force-stop)
+ force_stop
+ ;;
+status)
+ status
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop|restart|force-reload|status}"
+ exit 1
+esac
+
+exit
Added: trunk/debian/virtualbox-ose.links
===================================================================
--- trunk/debian/virtualbox-ose.links (rev 0)
+++ trunk/debian/virtualbox-ose.links 2007-12-14 16:58:00 UTC (rev 134)
@@ -0,0 +1,13 @@
+/usr/lib/virtualbox/xpidl /usr/share/virtualbox/sdk/bin/xpidl
+
+/usr/lib/virtualbox/VBox.sh /usr/bin/vditool
+/usr/lib/virtualbox/VBox.sh /usr/bin/vboxmanage
+/usr/lib/virtualbox/VBox.sh /usr/bin/vboxsdl
+/usr/lib/virtualbox/VBox.sh /usr/bin/virtualbox
+/usr/lib/virtualbox/VBox.sh /usr/bin/VBoxManage
+/usr/lib/virtualbox/VBox.sh /usr/bin/VBoxSDL
+/usr/lib/virtualbox/VBox.sh /usr/bin/VirtualBox
+
+/usr/bin/VboxTAP /usr/bin/VBoxAddIF
+/usr/bin/VboxTAP /usr/bin/VBoxDeleteIF
+
More information about the Pkg-virtualbox-commits
mailing list