rules revision c0f7d085db4a260951684448304a2aa4f46a0dd6
70025d765b044c6d8594bb965a2247a61e991a99johnny# Copyright (C) 2006-2012 Oracle Corporation
70025d765b044c6d8594bb965a2247a61e991a99johnny# This file is part of VirtualBox Open Source Edition (OSE), as
70025d765b044c6d8594bb965a2247a61e991a99johnny# available from http://www.virtualbox.org. This file is free software;
70025d765b044c6d8594bb965a2247a61e991a99johnny# you can redistribute it and/or modify it under the terms of the GNU
70025d765b044c6d8594bb965a2247a61e991a99johnny# General Public License (GPL) as published by the Free Software
70025d765b044c6d8594bb965a2247a61e991a99johnny# Foundation, in version 2 as it comes in the "COPYING" file of the
70025d765b044c6d8594bb965a2247a61e991a99johnny# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
70025d765b044c6d8594bb965a2247a61e991a99johnny# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
70025d765b044c6d8594bb965a2247a61e991a99johnny# NOTE: if you make changes to this file, please check if the updates should
70025d765b044c6d8594bb965a2247a61e991a99johnny# be also applied to the publicly visible debian/rules file.
70025d765b044c6d8594bb965a2247a61e991a99johnny#export DH_VERBOSE=1
70025d765b044c6d8594bb965a2247a61e991a99johnny# possible overrides:
70025d765b044c6d8594bb965a2247a61e991a99johnny# OSE=1 force VBOX_OSE
70025d765b044c6d8594bb965a2247a61e991a99johnny# NOPARALLEL=1 compile with -j1
70025d765b044c6d8594bb965a2247a61e991a99johnny# LINUX=<dir> compile vboxdrv against Linux found in <dir>
70025d765b044c6d8594bb965a2247a61e991a99johnny# VERBOSE=1 verbose build
70025d765b044c6d8594bb965a2247a61e991a99johnny# DEBUG=1 debug build
70025d765b044c6d8594bb965a2247a61e991a99johnny# NOSUBVER=1 disable generation of the sub-version field (which is
70025d765b044c6d8594bb965a2247a61e991a99johnny# either the subversion rev [if available] or the build date)
70025d765b044c6d8594bb965a2247a61e991a99johnny# NODOCS=1 don't build docs, use precompiled UserManual.pdf and
70025d765b044c6d8594bb965a2247a61e991a99johnny# NOMODS=1 don't build any module
70025d765b044c6d8594bb965a2247a61e991a99johnny# NOQT=1 don't build the Qt GUI
70025d765b044c6d8594bb965a2247a61e991a99johnny# EFI=1 include the EFI binary from prebuild
70025d765b044c6d8594bb965a2247a61e991a99johnny# VERSUFFIX=<suffix> set a particular package version suffix (e.g. _customer)
70025d765b044c6d8594bb965a2247a61e991a99johnny# HEADLESS=1 build the headless version
70025d765b044c6d8594bb965a2247a61e991a99johnny# VNC=1 build VNC code
70025d765b044c6d8594bb965a2247a61e991a99johnny# NOWEBSVC=1 don't build the webservice API, default for OSE
70025d765b044c6d8594bb965a2247a61e991a99johnny# STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso
70025d765b044c6d8594bb965a2247a61e991a99johnny# PKGDIR=<path> where to store the final package(s)
70025d765b044c6d8594bb965a2247a61e991a99johnny# BLEEDING_EDGE=xyz
70025d765b044c6d8594bb965a2247a61e991a99johnnypkgdir := $(if $(PKGDIR),$(PKGDIR),$(shell cd ../../../../..; pwd))
70025d765b044c6d8594bb965a2247a61e991a99johnnyose := $(if $(OSE),1,$(if $(wildcard $(vboxroot)/src/VBox/RDP/server),,1))
70025d765b044c6d8594bb965a2247a61e991a99johnnyNOWINE := $(if $(NODOCS),$(if $(STAGEDISO),1,),)$(ose)
70025d765b044c6d8594bb965a2247a61e991a99johnnysvnver := $(if $(NOSUBVER),,$(if $(svn_revision),-$(svn_revision),$(shell if \
70025d765b044c6d8594bb965a2247a61e991a99johnny svn info|sed -e "s/^Revision: \(.*\)/-\1/;t;d"; else \
70025d765b044c6d8594bb965a2247a61e991a99johnnydebver :=$(subst _ALPHA,~alpha,$(subst _BETA,~beta,$(subst _RC,~rc,$(subst _OSE,~ose,$(ver)))))$(svnver)$(if \
70025d765b044c6d8594bb965a2247a61e991a99johnny $(BLEEDING_EDGE),-$(BLEEDING_EDGE),)$(VERSUFFIX)$(if \
70025d765b044c6d8594bb965a2247a61e991a99johnny ifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),)
70025d765b044c6d8594bb965a2247a61e991a99johnny $(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
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 \
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 some reason, the Qt libraries couldn't be found on newer releases (e.g. Ubuntu hardy)
dh_gencontrol -- \