Index: trunk/debian/LocalConfig.kmk
===================================================================
--- trunk/debian/LocalConfig.kmk	(revision 30000)
+++ trunk/debian/LocalConfig.kmk	(revision 31999)
@@ -5,5 +5,5 @@
 
 #
-# Copyright (C) 2006-2008 Oracle Corporation
+# Copyright (C) 2006-2010 Oracle Corporation
 #
 # This file is part of VirtualBox Open Source Edition (OSE), as
@@ -16,13 +16,7 @@
 #
 
-# shut up wine complaining about unknown locale
-EXEC_X86_WIN32             := wine
-
 # don't build testcases to save time, they are not needed for the package
 VBOX_WITH_TESTCASES        :=
 VBOX_WITH_TESTSUITE        :=
-
-
-VBOX_WITH_HARDENING        := 1
 
 # required for VBOX_WITH_RUNPATH
Index: trunk/debian/VBox.sh
===================================================================
--- trunk/debian/VBox.sh	(revision 30000)
+++ trunk/debian/VBox.sh	(revision 31999)
@@ -3,5 +3,5 @@
 # Oracle VM VirtualBox
 #
-# Copyright (C) 2006-2009 Oracle Corporation
+# Copyright (C) 2006-2010 Oracle Corporation
 #
 # This file is part of VirtualBox Open Source Edition (OSE), as
@@ -89,4 +89,7 @@
     exec "/usr/lib/virtualbox/VBoxHeadless" "$@"
     ;;
+  vboxwebsrv)
+    exec "/usr/lib/virtualbox/vboxwebsrv" "$@"
+    ;;
   *)
     echo "Unknown application - $APP"
Index: trunk/debian/lintian-override.in
===================================================================
--- trunk/debian/lintian-override.in	(revision 30000)
+++ trunk/debian/lintian-override.in	(revision 31999)
@@ -12,4 +12,5 @@
 %VERPKG%: shlib-with-non-pic-code usr/lib/virtualbox/VBoxSharedClipboard.so
 %VERPKG%: shlib-with-non-pic-code usr/lib/virtualbox/VBoxGuestPropSvc.so
+%VERPKG%: shlib-with-non-pic-code usr/lib/virtualbox/VBoxGuestControlSvc.so
 %VERPKG%: shlib-with-non-pic-code usr/lib/virtualbox/VBoxNetDHCP.so
 %VERPKG%: shlib-with-non-pic-code usr/lib/virtualbox/VBoxVRDP.so
@@ -46,4 +47,5 @@
 %VERPKG%: no-shlibs-control-file usr/lib/virtualbox/VBoxSharedClipboard.so
 %VERPKG%: no-shlibs-control-file usr/lib/virtualbox/VBoxGuestPropSvc.so
+%VERPKG%: no-shlibs-control-file usr/lib/virtualbox/VBoxGuestControlSvc.so
 %VERPKG%: no-shlibs-control-file usr/lib/virtualbox/VBoxVRDP.so
 %VERPKG%: no-shlibs-control-file usr/lib/virtualbox/VRDPAuth.so
@@ -54,4 +56,5 @@
 %VERPKG%: binary-or-shlib-defines-rpath ./usr/lib/virtualbox/VBoxDbg.so /usr/lib/virtualbox
 %VERPKG%: binary-or-shlib-defines-rpath ./usr/lib/virtualbox/VBoxGuestPropSvc.so /usr/lib/virtualbox
+%VERPKG%: binary-or-shlib-defines-rpath ./usr/lib/virtualbox/VBoxGuestControlSvc.so /usr/lib/virtualbox
 %VERPKG%: binary-or-shlib-defines-rpath ./usr/lib/virtualbox/VBoxHeadless /usr/lib/virtualbox
 %VERPKG%: binary-or-shlib-defines-rpath ./usr/lib/virtualbox/VBoxHeadless.so /usr/lib/virtualbox
Index: trunk/debian/postinst.in
===================================================================
--- trunk/debian/postinst.in	(revision 30000)
+++ trunk/debian/postinst.in	(revision 31999)
@@ -12,5 +12,5 @@
 #
 
-# we can be called with the following arguments:
+# we can be called with the following arguments (6.5 of Debian policy):
 #  configure:         (our version): installing/configuring new version
 #  abort-upgrade:     (old version): upgrading to a new version failed
@@ -19,4 +19,7 @@
 
 LOG="/var/log/vbox-install.log"
+
+# defaults
+[ -r /etc/default/virtualbox ] && . /etc/default/virtualbox
 
 if [ "$1" = "configure" ]; then
@@ -37,6 +40,6 @@
   fi
 
-  # install udev rule
-  if [ -d /etc/udev/rules.d ]; then
+  # install udev rule (disable with INSTALL_NO_UDEV=1 in /etc/default/virtualbox)
+  if [ -d /etc/udev/rules.d -a "$INSTALL_NO_UDEV" != "1" ]; then
     udev_call=""
     udev_app=`which udevadm 2> /dev/null`
@@ -58,13 +61,39 @@
     fi
     echo "KERNEL=${udev_fix}\"vboxdrv\", NAME=\"vboxdrv\", OWNER=\"root\", GROUP=\"root\", MODE=\"0600\"" \
-      > /etc/udev/rules.d/60-vboxdrv.rules
-  fi
-
-  # create users groups
-  db_input high virtualbox/group-vboxusers || true
-  db_go || true
-  addgroup --system vboxusers || true
-
-  if [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko ]; then
+      > /etc/udev/rules.d/10-vboxdrv.rules
+    if [ "$INSTALL_NO_GROUP" != "1" ]; then
+      echo "SUBSYSTEM=${udev_fix}\"usb_device\", GROUP=\"vboxusers\", MODE=\"0664\"" \
+        >> /etc/udev/rules.d/10-vboxdrv.rules
+      echo "SUBSYSTEM=${udev_fix}\"usb\", ENV{DEVTYPE}==\"usb_device\", GROUP=\"vboxusers\", MODE=\"0664\"" \
+        >> /etc/udev/rules.d/10-vboxdrv.rules
+    else
+      echo "SUBSYSTEM=${udev_fix}\"usb_device\", GROUP=\"root\", MODE=\"0664\"" \
+        >> /etc/udev/rules.d/10-vboxdrv.rules
+      echo "SUBSYSTEM=${udev_fix}\"usb\", ENV{DEVTYPE}==\"usb_device\", GROUP=\"root\", MODE=\"0664\"" \
+        >> /etc/udev/rules.d/10-vboxdrv.rules
+    fi
+  fi
+  # Remove old udev description file
+  if [ -f /etc/udev/rules.d/60-vboxdrv.rules ]; then
+      rm -f /etc/udev/rules.d/60-vboxdrv.rules 2> /dev/null
+  fi
+  # Push the permissions to the USB device nodes.  One of these should match.
+  # Rather nasty to use udevadm trigger for this, but I don't know of any
+  # better way.
+  udevadm trigger --subsystem-match=usb > /dev/null 2>&1
+  udevtrigger --subsystem-match=usb > /dev/null 2>&1
+  udevtrigger --subsystem-match=usb_device > /dev/null 2>&1
+  udevplug -Busb > /dev/null 2>&1
+
+  # create users groups (disable with INSTALL_NO_GROUP=1 in /etc/default/virtualbox)
+  if [ "$INSTALL_NO_GROUP" != "1" ]; then
+    db_input low virtualbox/group-vboxusers || true
+    db_go || true
+    addgroup --system vboxusers || true
+  fi
+
+  # try to build a kernel module (disable with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox)
+  REGISTER_DKMS=1
+  if [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko -a "$INSTALL_NO_VBOXDRV" != "1" ]; then
     db_get virtualbox/module-compilation-allowed
     if [ "$RET" = "false" ]; then
@@ -74,5 +103,5 @@
 EOF
     else
-      db_input critical virtualbox/module-compilation-allowed || true
+      db_input low virtualbox/module-compilation-allowed || true
       db_go || true
       db_get virtualbox/module-compilation-allowed
@@ -172,4 +201,11 @@
   fi
 
+  # if INSTALL_NO_VBOXDRV is set to 1, remove all shipped modules
+  if [ "$INSTALL_NO_VBOXDRV" = "1" ]; then
+    rm -f /lib/modules/*/misc/vboxdrv.ko
+    rm -f /lib/modules/*/misc/vboxnetflt.ko
+    rm -f /lib/modules/*/misc/vboxnetadp.ko
+  fi
+
 fi # $1 = "configure"
 
Index: trunk/debian/preinst.in
===================================================================
--- trunk/debian/preinst.in	(revision 30000)
+++ trunk/debian/preinst.in	(revision 31999)
@@ -12,8 +12,11 @@
 #
 
-# we can be called with the following arguments:
+# we can be called with the following arguments (6.5 of Debian policy):
 #  install:          (our version): install our version
 #  upgrade:          (our version): upgrade to our version
 #  abort-upgrade:    (old version): upgrade to a new version failed
+
+# defaults
+[ -r /etc/default/virtualbox ] && . /etc/default/virtualbox
 
 if [ "$1" = "install" -o "$1" = "upgrade" ]; then
@@ -26,5 +29,5 @@
   if pidof VBoxSVC > /dev/null 2>&1; then
     db_fset virtualbox/old-running seen false || true
-    db_input high virtualbox/old-running || true
+    db_input critical virtualbox/old-running || true
     db_go || true
     exit 1
@@ -36,5 +39,5 @@
     if [ "x$INSTALL_DIR" != "x" -a -d "$INSTALL_DIR" ]; then
       db_fset virtualbox/old-installation-found seen false || true
-      db_input high virtualbox/old-installation-found || true
+      db_input critical virtualbox/old-installation-found || true
       db_go || true
       exit 1
@@ -44,23 +47,25 @@
 
   # check for old vboxdrv modules
-  if find /lib/modules -name "vboxdrv\.*" 2>/dev/null|grep -q vboxdrv; then
-    # old modules found
-    db_get virtualbox/delete-old-modules || true
-    if [ "$RET" = "false" ]; then
-      cat << EOF
+  if [ "$INSTALL_NO_VBOXDRV" != "1" ]; then
+    if find /lib/modules -name "vboxdrv\.*" 2>/dev/null|grep -q vboxdrv; then
+      # old modules found
+      db_get virtualbox/delete-old-modules || true
+      if [ "$RET" = "false" ]; then
+        cat << EOF
 Old vboxdrv kernel modules found in
 EOF
-      find /lib/modules -name "vboxdrv\.*" 2>/dev/null|sed "s+\(.*\)+  \1+g"
-      cat << EOF
+        find /lib/modules -name "vboxdrv\.*" 2>/dev/null|sed "s+\(.*\)+  \1+g"
+        cat << EOF
 Removing of these modules denied by debconf setting
 EOF
-    else
-      db_input critical virtualbox/delete-old-modules || true
-      db_go || true
-      db_get virtualbox/delete-old-modules || true
-      if [ "$RET" = "true" ]; then
-        find /lib/modules -name "vboxdrv\.*" 2>/dev/null|xargs rm -f 2>/dev/null
-        find /lib/modules -name "vboxnetflt\.*" 2>/dev/null|xargs rm -f 2>/dev/null
-        find /lib/modules -name "vboxnetadp\.*" 2>/dev/null|xargs rm -f 2>/dev/null
+      else
+        db_input low virtualbox/delete-old-modules || true
+        db_go || true
+        db_get virtualbox/delete-old-modules || true
+        if [ "$RET" = "true" ]; then
+          find /lib/modules -name "vboxdrv\.*" 2>/dev/null|xargs rm -f 2>/dev/null
+          find /lib/modules -name "vboxnetflt\.*" 2>/dev/null|xargs rm -f 2>/dev/null
+          find /lib/modules -name "vboxnetadp\.*" 2>/dev/null|xargs rm -f 2>/dev/null
+        fi
       fi
     fi
Index: trunk/debian/rules
===================================================================
--- trunk/debian/rules	(revision 30000)
+++ trunk/debian/rules	(revision 31999)
@@ -60,17 +60,8 @@
 endif
 
-# Hack: Xandros is actually Debian/sarge ... :(
-ifneq ($(wildcard /etc/xandros-desktop-version),)
- debrel  := _xandros4.1
-else
-ifneq ($(wildcard /etc/univention),)
- debrel  := _ucs1.3
-else
- debrel  := $(if $(shell which lsb_release),_$(shell lsb_release -si)_$(shell lsb_release -sc),unknown)
-endif
-endif
+debrel  := $(if $(shell which lsb_release),_$(shell lsb_release -si)_$(shell lsb_release -sc),unknown)
 
 # shipping Linux kernel modules with bleeding-edge releases doesn't make sense
-instmod := $(if $(filter _Ubuntu_karmic _Debian_sid,$(debrel)),,1)
+instmod := $(if $(filter _Ubuntu_lucid _Debian_sid,$(debrel)),,1)
 
 # Locations of custom built Qt libraries (see below)
@@ -80,13 +71,6 @@
 cfg_flags := $(if $(NOQT),--disable-qt,) \
 	     $(if $(ose),--ose,) $(if $(LINUX),--with-linux=$(LINUX),) \
-	     $(if $(filter _Ubuntu_dapper,$(debrel)),--with-gcc=gcc-3.4 --with-g++=g++-3.4,) \
-	     $(if $(filter _Ubuntu_gutsy,$(debrel)),--with-gcc=gcc-4.2 --with-g++=g++-4.2,) \
-	     $(if $(filter _xandros4.1 _ucs1.3 _Debian_sarge _Ubuntu_dapper,$(debrel)),--build-libxml2,) \
-	     $(if $(filter _xandros4.1 _ucs1.3 _Debian_sarge _Ubuntu_dapper,$(debrel)),--build-libxslt,) \
 	     $(if $(filter _Debian_etch,$(debrel)),$(if $(ose),,--build-libcurl),) \
-	     $(if $(filter _Debian_sarge _xandros4.1 _ucs1.3,$(debrel)),--with-qt4-dir=$(qtstdc5)) \
-	     $(if $(filter _Debian_etch _Ubuntu_dapper _Ubuntu_edgy _Ubuntu_feisty _Ubuntu_gutsy _Ubuntu_hardy,$(debrel)),--with-qt4-dir=$(qtstdc6)) \
-	     $(if $(filter _xandros4.1 _ucs1.3,$(debrel)),--disable-sdl-ttf,) \
-	     $(if $(filter _Debian_sarge _Ubuntu_dapper _Ubuntu_edgy _xandros4.1 _ucs1.3,$(debrel)),--disable-pulse,) \
+	     $(if $(filter _Debian_etch _Ubuntu_hardy,$(debrel)),--with-qt4-dir=$(qtstdc6)) \
 	     $(if $(HEADLESS),--build-headless,) \
 	     $(if $(DEBUG),--build-debug,) \
@@ -105,9 +89,6 @@
 	     $(if $(STAGEDISO),VBOX_WITHOUT_ADDITIONS=1,) \
 	     $(if $(BLEEDING_EDGE),VBOX_BLEEDING_EDGE=$(BLEEDING_EDGE),) \
-	     $(if $(filter _Debian_sarge _xandros4.1 _ucs1.3,$(debrel)),VBOX_LD_as_needed= ,) \
 	     $(if $(filter _Debian_etch _Ubuntu_hardy,$(debrel)),,VBOX_WITH_SYSFS_BY_DEFAULT=1)
 
-# Ubuntu dapper: gcc-4.0 does not work with recompiler, use gcc-3.4 instead
-# Ubuntu gutsy:  gcc-4.1 does not work for the webservices, use gcc-4.2 instead
 configure: debian/configure-stamp
 debian/configure-stamp:
@@ -126,5 +107,6 @@
 	. debian/env.sh && kmk -C $(vboxroot) $(bld_flags) \
 	    VBOX_NO_LINUX_RUN_INSTALLER=1 \
-	    VBOX_PATH_ADDITIONS.linux.x86=$(builddir)/bin/additions \
+	    VBOX_LNX_ADD_ARCHIVE.x86=$(builddir)/bin/additions/VBoxGuestAdditions-x86-r$(svnrev).tar.bz2 \
+	    VBOX_LNX_ADD_ARCHIVE.amd64=$(builddir)/bin/additions/VBoxGuestAdditions-amd64-r$(svnrev).tar.bz2 \
 	    packing
 	touch debian/build-stamp
@@ -238,6 +220,7 @@
 	dh_installdocs \
 	    $(archdir)/UserManual*.pdf $(archdir)/VirtualBox*.chm \
-	    LICENSE
-	rm $(addprefix $(archdir)/,UserManual*.pdf VirtualBox*.chm LICENSE)
+	    $(addprefix $(archdir)/, $(if $(HEADLESS),,License-*.html) LICENSE)
+	rm $(addprefix $(archdir)/,UserManual*.pdf VirtualBox*.chm \
+	    LICENSE $(if $(HEADLESS),,License-*.html))
 	for i in rdesktop-vrdp.tar.gz additions/VBoxGuestAdditions.iso; do \
 	    mv $(archdir)/$$i $(prefix)/usr/share/$(package); done
@@ -263,13 +246,17 @@
 	$(if $(NOMODS),,dh_installmodules)
 	sed \
-	    -e 's|%NOLSB%|$(if $(filter _Debian_sarge ucs1.3,$(debrel)),yes,)|g' \
+	    -e 's|%NOLSB%||g' \
 	    -e 's|%DEBIAN%|yes|g' \
 	    -e 's|%PACKAGE%|virtualbox|g' \
-	    src/VBox/Installer/linux/vboxdrv.sh.in > debian/vboxdrv.init
-	dh_installinit --name=vboxdrv
+	    $(vboxroot)/src/VBox/Installer/linux/vboxdrv.sh.in > debian/vboxdrv.init
+	dh_installinit --name=vboxdrv --noscripts
+	sed \
+	    -e 's|%NOLSB%||g' \
+	    -e 's|%DEBIAN%|yes|g' \
+	    -e 's|%PACKAGE%|virtualbox|g' \
+	    $(vboxroot)/src/VBox/Installer/linux/vboxweb-service.sh.in > debian/vboxweb-service.init
+	dh_installinit --name=vboxweb-service --noscripts
 	cat debian/preinst.in | sed -e 's|%VER%|$(ver)|g' > debian/preinst
 	cat debian/postinst.in | sed -e 's|%VER%|$(ver)|g' > debian/postinst
-	if [ "$(debrel)" = "_Ubuntu_dapper" -o "$(debrel)" = "_Debian_sarge" ]; then \
-	    cat debian/postrm.dapper > debian/postrm; fi
 	dh_installdebconf
 	dh_installchangelogs
@@ -302,5 +289,5 @@
 	  -Vpulse=$(if $(HEADLESS),,libpulse0) \
 	  -Vsdlttf=$(if $(HEADLESS),,libsdl-ttf2.0-0) \
-	  -Vdkms=$(if $(filter _Ubuntu_gutsy _Ubuntu_hardy _Ubuntu_intrepid _Ubuntu_jaunty _Ubuntu_karmic,$(debrel)),dkms,)
+	  -Vdkms=$(if $(filter _Ubuntu_hardy _Ubuntu_intrepid _Ubuntu_jaunty _Ubuntu_karmic _Ubuntu_lucid,$(debrel)),dkms,)
 	dh_md5sums
 	dh_builddeb --destdir $(pkgdir)
