rules revision 5d31da34788d5a82008edfa7181f3e2776462db7
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# Copyright (C) 2006-2012 Oracle Corporation
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# This file is part of VirtualBox Open Source Edition (OSE), as
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# available from http://www.virtualbox.org. This file is free software;
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# you can redistribute it and/or modify it under the terms of the GNU
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# General Public License as published by the Free Software Foundation,
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# distribution. VirtualBox OSE is distributed in the hope that it will
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# be useful, but WITHOUT ANY WARRANTY of any kind.
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# NOTE: if you make changes to this file, please check if the updates should
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# be also applied to the publicly visible debian/rules file.
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye#export DH_VERBOSE=1
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# possible overrides:
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# OSE=1 force VBOX_OSE
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# NOPARALLEL=1 compile with -j1
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# LINUX=<dir> compile vboxdrv against Linux found in <dir>
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# VERBOSE=1 verbose build
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# DEBUG=1 debug build
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# NOSUBVER=1 disable generation of the sub-version field (which is
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# either the subversion rev [if available] or the build date)
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# NODOCS=1 don't build docs, use precompiled UserManual.pdf and
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# NOMODS=1 don't build any module
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# NOQT=1 don't build the Qt GUI
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# EFI=1 include the EFI binary from prebuild
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# VERSUFFIX=<suffix> set a particular package version suffix (e.g. _customer)
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# HEADLESS=1 build the headless version
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# VNC=1 build VNC code
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# NOWEBSVC=1 don't build the webservice API, default for OSE
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# PKGDIR=<path> where to store the final package(s)
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# BLEEDING_EDGE=xyz
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbyepkgdir := $(if $(PKGDIR),$(PKGDIR),$(shell cd ../../../../..; pwd))
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbyeose := $(if $(OSE),1,$(if $(wildcard $(vboxroot)/src/VBox/RDP/server),,1))
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbyesvnrev :=$(if $(svn_revision),$(svn_revision),0)
a1318a82916028f363b3c5b52e7fd7256b632497Trond NorbyeNOWINE := $(if $(NODOCS),$(if $(STAGEDISO),1,),)$(ose)
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbyesvnver := $(if $(NOSUBVER),,$(if $(svn_revision),-$(svn_revision),$(shell if \
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye svn info > /dev/null 2>&1; then \
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye svn info|sed -e "s/^Revision: \(.*\)/-\1/;t;d"; else \
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbyedebver :=$(subst _ALPHA,~alpha,$(subst _BETA,~beta,$(subst _OSE,~ose,$(ver))))$(svnver)$(if \
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye $(BLEEDING_EDGE),-$(BLEEDING_EDGE),)$(VERSUFFIX)$(if \
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye ifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),)
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye $(error STAGEDISO='$(STAGEDISO)/VBoxGuestAdditions.iso' not found)
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbyedebrel := $(if $(shell which lsb_release),_$(shell lsb_release -si)_$(shell lsb_release -sc),unknown)
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# shipping Linux kernel modules with bleeding-edge releases doesn't make sense
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbyeinstmod := $(if $(filter _Ubuntu_lucid _Ubuntu_maverick _Ubuntu_natty _Ubuntu_oneiric _Debian_sid,$(debrel)),,1)
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye debdist := $(strip $(shell grep $(debrel) $(current)/distributions_deb | cut -d'=' -f2))
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 \
sed \
$(vboxroot)/src/VBox/Installer/linux/vboxballoonctrl-service.sh.in > debian/vboxballoonctrl-service.init
sed \
-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 \
# for some reason, the Qt libraries couldn't be found on newer releases (e.g. Ubuntu hardy)
dh_gencontrol -- \