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