rules revision e00d701bbdc8f27f25cc232d9e507622a731b390
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# Copyright (C) 2006-2010 Oracle Corporation
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# available from http://www.virtualbox.org. This file is free software;
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# you can redistribute it and/or modify it under the terms of the GNU
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# General Public License as published by the Free Software Foundation,
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# distribution. VirtualBox OSE is distributed in the hope that it will
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# be useful, but WITHOUT ANY WARRANTY of any kind.
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# NOTE: if you make changes to this file, please check if the updates should
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# be also applied to the publicly visible debian/rules file.
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync#export DH_VERBOSE=1
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# possible overrides:
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# OSE=1 force VBOX_OSE
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# NOPARALLEL=1 compile with -j1
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# LINUX=<dir> compile vboxdrv against Linux found in <dir>
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# VERBOSE=1 verbose build
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# DEBUG=1 debug build
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# NOSUBVER=1 disable generation of the sub-version field (which is
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# either the subversion rev [if available] or the build date)
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# NODOCS=1 don't build docs, use precompiled UserManual.pdf and
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# NOMODS=1 don't build any module
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# NOQT=1 don't build the Qt GUI
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# EFI include the EFI binary from prebuild
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# VERSUFFIX=<suffix> set a particular package version suffix (e.g. _customer)
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# HEADLESS=1 build the headless version
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# NOWEBSVC=1 don't build the webservice API, default for OSE
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# BLEEDING_EDGE=xyz
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsyncose := $(if $(OSE),1,$(if $(wildcard $(vboxroot)/src/VBox/RDP/server),,1))
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsyncsvnver := $(if $(NOSUBVER),,$(if $(svn_revision),-$(svn_revision),$(shell if \
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync svn info|sed -e "s/^Revision: \(.*\)/-\1/;t;d"; else \
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsyncdebver :=$(subst _ALPHA,~alpha,$(subst _BETA,~beta,$(ver)))$(svnver)$(if \
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync $(BLEEDING_EDGE),-$(BLEEDING_EDGE),)$(VERSUFFIX)$(if \
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync ifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),)
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync $(error STAGEDISO='$(STAGEDISO)/VBoxGuestAdditions.iso' not found)
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsyncdebrel := $(if $(shell which lsb_release),_$(shell lsb_release -si)_$(shell lsb_release -sc),unknown)
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# shipping Linux kernel modules with bleeding-edge releases doesn't make sense
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsyncinstmod := $(if $(filter _Ubuntu_lucid _Debian_sid,$(debrel)),,1)
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync debdist := $(strip $(shell grep $(debrel) $(current)/distributions_deb | cut -d'=' -f2))
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync $(error package distribution not detected (debrel=$(debrel)))
b8014c3bbb8a0f9d16e82278eabba771cbfd9b2evboxsync# Locations of custom built Qt libraries (see below)
dh_clean -k
rmdir $$i; \
sed \
if [ -f $$d/vboxdrv.ko -a -f $$d/vboxnetflt.ko -a -f $$d/vboxnetadp.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 \
dh_link \
sed \
sed \
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 -- \