rules revision e8e770ce5a8f375c77b6047158833b5b3d2c055e
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# Copyright (C) 2006-2012 Oracle Corporation
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# This file is part of VirtualBox Open Source Edition (OSE), as
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# available from http://www.virtualbox.org. This file is free software;
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# you can redistribute it and/or modify it under the terms of the GNU
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# General Public License (GPL) as published by the Free Software
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# Foundation, in version 2 as it comes in the "COPYING" file of the
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce#export DH_VERBOSE=1
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# possible overrides:
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# OSE=1 force VBOX_OSE
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# NOPARALLEL=1 compile with -j1
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# LINUX=<dir> compile vboxdrv against Linux found in <dir>
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# VERBOSE=1 verbose build
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# DEBUG=1 debug build
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# NOSUBVER=1 disable generation of the sub-version field (which is
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# either the subversion rev [if available] or the build date)
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# NODOCS=1 don't build docs, use precompiled UserManual.pdf and
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# NOMODS=1 don't build any module
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# NOQT=1 don't build the Qt GUI
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# EFI=1 include the EFI binary from prebuild
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# HEADLESS=1 build the headless version
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# VNC=1 build VNC code
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# NOWEBSVC=1 don't build the webservice API, default for OSE
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# PKGDIR=<path> where to store the final package(s)
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce# BLEEDING_EDGE=xyz
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorcepkgdir := $(if $(PKGDIR),$(PKGDIR),$(shell cd ..; pwd))
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorceose := $(if $(OSE),1,$(if $(wildcard $(vboxroot)/src/VBox/RDP/server),,1))
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo SorceNOWINE := $(if $(NODOCS),$(if $(STAGEDISO),1,),)$(ose)
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce ifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),)
5f216c753dbd2f2b25a011c5f705ee4f8ad924e6Simo Sorce $(error STAGEDISO='$(STAGEDISO)/VBoxGuestAdditions.iso' not found)
debrel := $(if $(shell which lsb_release),_$(shell lsb_release -si)_$(shell lsb_release -sc),unknown)
instmod := $(if $(filter _Ubuntu_lucid _Ubuntu_maverick _Ubuntu_natty _Ubuntu_oneiric _Debian_sid,$(debrel)),,1)
rm -f debian/vboxballoonctrl-service.init debian/vboxautostart-service.init debian/vboxweb-service.init
dh_clean -k
rmdir $$i; \
sed \
if [ -f $$d/vboxdrv.ko -a -f $$d/vboxnetflt.ko -a -f $$d/vboxnetadp.ko -a -f $$d/vboxpci.ko ]; then \
install -D -g 0 -o 0 -m 0644 \
install -D -g 0 -o 0 -m 0644 \
install -D -g 0 -o 0 -m 0644 \
install -D -g 0 -o 0 -m 0644 \
dh_link \
sed \
cp $(vboxroot)/src/VBox/Installer/linux/vboxballoonctrl-service.sh debian/vboxballoonctrl-service.init
-e '/#include installer-common.sh/ {' \
dh_strip --keep-debug --exclude=libQtCoreVBox.so.4 --exclude=libQtGuiVBox.so.4 --exclude=libQtNetworkVBox.so.4 --exclude=libQtOpenGLVBox.so.4 --exclude=libqtaccessiblewidgets.so
for f in \
dh_gencontrol -- \