rules revision 3d8242e90019d302159795040e410b3d774a4b0b
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Copyright (C) 2006-2011 Oracle Corporation
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# This file is part of VirtualBox Open Source Edition (OSE), as
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# available from http://www.virtualbox.org. This file is free software;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# you can redistribute it and/or modify it under the terms of the GNU
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# General Public License as published by the Free Software Foundation,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# distribution. VirtualBox OSE is distributed in the hope that it will
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# be useful, but WITHOUT ANY WARRANTY of any kind.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# NOTE: if you make changes to this file, please check if the updates should
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# be also applied to the publicly visible debian/rules file.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#export DH_VERBOSE=1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# possible overrides:
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# OSE=1 force VBOX_OSE
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# NOPARALLEL=1 compile with -j1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# LINUX=<dir> compile vboxdrv against Linux found in <dir>
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# VERBOSE=1 verbose build
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# DEBUG=1 debug build
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# NOSUBVER=1 disable generation of the sub-version field (which is
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# either the subversion rev [if available] or the build date)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# NODOCS=1 don't build docs, use precompiled UserManual.pdf and
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# NOMODS=1 don't build any module
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# NOQT=1 don't build the Qt GUI
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# EFI include the EFI binary from prebuild
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# VERSUFFIX=<suffix> set a particular package version suffix (e.g. _customer)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# HEADLESS=1 build the headless version
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# NOWEBSVC=1 don't build the webservice API, default for OSE
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# PKGDIR=<path> where to store the final package(s)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# BLEEDING_EDGE=xyz
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinpkgdir := $(if $(PKGDIR),$(PKGDIR),$(shell cd ../../../../..; pwd))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinose := $(if $(OSE),1,$(if $(wildcard $(vboxroot)/src/VBox/RDP/server),,1))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinsvnver := $(if $(NOSUBVER),,$(if $(svn_revision),-$(svn_revision),$(shell if \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindebver :=$(subst _ALPHA,~alpha,$(subst _BETA,~beta,$(subst _OSE,~ose,$(ver))))$(svnver)$(if \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $(error STAGEDISO='$(STAGEDISO)/VBoxGuestAdditions.iso' not found)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindebrel := $(if $(shell which lsb_release),_$(shell lsb_release -si)_$(shell lsb_release -sc),unknown)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# shipping Linux kernel modules with bleeding-edge releases doesn't make sense
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chininstmod := $(if $(filter _Ubuntu_lucid _Ubuntu_maverick _Ubuntu_natty _Debian_sid,$(debrel)),,1)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin debdist := $(strip $(shell grep $(debrel) $(current)/distributions_deb | cut -d'=' -f2))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $(error package distribution not detected (debrel=$(debrel)))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Location of custom built Qt libraries (see below)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $(if $(ose),--ose,) $(if $(LINUX),--with-linux=$(LINUX),) \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $(if $(filter _Ubuntu_hardy,$(debrel)),--with-qt4-dir=$(qtstdc6)) \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/$(verpkg)\"" \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $(if $(VERBOSE),--print-directory KBUILD_VERBOSE=2,--no-print-directory) \
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-utils.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 -- \