5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync#!/usr/bin/make -f
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync#
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync# Copyright (C) 2006-2012 Oracle Corporation
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync#
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# available from http://www.virtualbox.org. This file is free software;
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# you can redistribute it and/or modify it under the terms of the GNU
d63de4508a08b11f57c307a15eda3cd95485bf2cvboxsync# General Public License (GPL) as published by the Free Software
d63de4508a08b11f57c307a15eda3cd95485bf2cvboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
d63de4508a08b11f57c307a15eda3cd95485bf2cvboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
d63de4508a08b11f57c307a15eda3cd95485bf2cvboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync#
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync#
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# NOTE: if you make changes to this file, please check if the updates should
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# be also applied to the publicly visible debian/rules file.
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync#
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync#export DH_VERBOSE=1
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncexport DH_COMPAT=4
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# possible overrides:
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# OSE=1 force VBOX_OSE
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# NOPARALLEL=1 compile with -j1
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# LINUX=<dir> compile vboxdrv against Linux found in <dir>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# VERBOSE=1 verbose build
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# DEBUG=1 debug build
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# NOSUBVER=1 disable generation of the sub-version field (which is
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# either the subversion rev [if available] or the build date)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# NODOCS=1 don't build docs, use precompiled UserManual.pdf and
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# VirtualBox.chm from $HOME
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# NOMODS=1 don't build any module
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# NOQT=1 don't build the Qt GUI
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync# EFI=1 include the EFI binary from prebuild
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# VERSUFFIX=<suffix> set a particular package version suffix (e.g. _customer)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# HEADLESS=1 build the headless version
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync# VNC=1 build VNC code
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# NOWEBSVC=1 don't build the webservice API, default for OSE
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso
2c691730ab202620fe427110841aa4e0075b7ccavboxsync# PKGDIR=<path> where to store the final package(s)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# BLEEDING_EDGE=xyz
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncpackage := virtualbox
026b9946ff309252dd02571723a24ac899529244vboxsyncverpkg := virtualbox-5.0
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsynccurrent := $(shell pwd)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncvboxroot := $(shell cd ../../../..; pwd)
2c691730ab202620fe427110841aa4e0075b7ccavboxsyncpkgdir := $(if $(PKGDIR),$(PKGDIR),$(shell cd ../../../../..; pwd))
e8e770ce5a8f375c77b6047158833b5b3d2c055evboxsyncbuilddir := $(vboxroot)/out/debian/builddir
e8e770ce5a8f375c77b6047158833b5b3d2c055evboxsyncmoddir := $(vboxroot)/out/debian/modules
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncprefix := $(current)/debian/$(verpkg)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncarch := $(shell dpkg --print-architecture)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncverfile := $(builddir)/version-generated.mk
d02610fd604cc8ab4cccf7e3fa510c06cb728ff2vboxsyncose := $(if $(OSE),1,$(if $(wildcard $(vboxroot)/src/VBox/RDP/server),,1))
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync-include $(vboxroot)/SVN_REVISION
b1212d1cdc6c9396aa851ef0a5388edce69806advboxsyncsvnrev :=$(if $(svn_revision),$(svn_revision),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncNOMODS ?= $(ose)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncNOQT ?= $(HEADLESS)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncNOWEBSVC ?= $(ose)
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsyncNOWINE := $(if $(NODOCS),$(if $(STAGEDISO),1,),)$(ose)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncifneq ($(wildcard $(verfile)),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncinclude $(verfile)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncver := $(VBOX_VERSION_STRING)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncsvnver := $(if $(NOSUBVER),,$(if $(svn_revision),-$(svn_revision),$(shell if \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync svn info > /dev/null 2>&1; then \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync svn info|sed -e "s/^Revision: \(.*\)/-\1/;t;d"; else \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync date +"-%Y%m%d"; fi)))
f03d2f859a6661088b765809ff4feb39bdd7a311vboxsyncdebver :=$(subst _ALPHA,~alpha,$(subst _BETA,~beta,$(subst _RC,~rc,$(subst _OSE,~ose,$(ver)))))$(svnver)$(if \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(BLEEDING_EDGE),-$(BLEEDING_EDGE),)$(VERSUFFIX)$(if \
f2ca52afeb0baed982c05e9d8591e0e4c7539dbdvboxsync $(HEADLESS),~headless,)$(if $(DEBUG),~dbg,)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncarchdir := $(prefix)/opt/VirtualBox-$(ver)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncendif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncifneq ($(STAGEDISO),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync ifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(error STAGEDISO='$(STAGEDISO)/VBoxGuestAdditions.iso' not found)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync endif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncendif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncdebrel := $(if $(shell which lsb_release),_$(shell lsb_release -si)_$(shell lsb_release -sc),unknown)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# shipping Linux kernel modules with bleeding-edge releases doesn't make sense
3baadeafd9922582dad9b32431362e6296417dd8vboxsyncinstmod := $(if $(filter _Ubuntu_lucid _Ubuntu_maverick _Ubuntu_natty _Ubuntu_oneiric _Debian_sid,$(debrel)),,1)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncifneq ($(MAKECMDGOALS),clean)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync debdist := $(strip $(shell grep $(debrel) $(current)/distributions_deb | cut -d'=' -f2))
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync ifeq ($(debdist),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(error package distribution not detected (debrel=$(debrel)))
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync endif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncendif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
f2ca52afeb0baed982c05e9d8591e0e4c7539dbdvboxsync# Location of custom built Qt libraries (see below)
49c9958a74e4a297fb7ec141ee764e872430f4bavboxsyncqtstdc6 := /home/vbox/Qt-4.7.4-stdc++6-$(arch)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsynccfg_flags := $(if $(NOQT),--disable-qt,) \
08879243dd70cdd8c01c3a5941c82c96c45a7e32vboxsync $(if $(filter _Debian_squeeze,$(debrel)),--build-libvpx,) \
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync $(if $(ose),--ose,) $(if $(LINUX),--with-linux=$(LINUX),) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(HEADLESS),--build-headless,) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(DEBUG),--build-debug,) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(NOWINE),,--setup-wine) \
080867566ec24e954aac5664d20a8fb364be2ed1vboxsync $(if $(NOWEBSVC),,$(if $(ose),--enable-webservice,)) \
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync $(if $(VNC),--enable-vnc,) \
0bd6dc6980372bcbc72756dfd401df65640b13a7vboxsync --disable-extpack
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncbld_flags := AUTOCFG=$(current)/debian/AutoConfig.kmk \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync LOCALCFG=$(current)/debian/LocalConfig.kmk \
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync PATH_OUT=$(builddir) \
c215a948010614887014a258c1751602d8bf7781vboxsync VBOX_WITHOUT_EXTPACK_PUEL_PACKING=1 \
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync VBOX_WITHOUT_EXTPACK_VNC_PACKING=1 \
a55e600e6aa5a0ba3c6e6da0f5840dc98271b0dcvboxsync $(if $(filter _Debian_squeeze _Ubuntu_lucid,$(debrel)),,VBOX_WITH_VMSVGA3D=1) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync VBOX_DO_STRIP= \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync VBOX_WITH_MULTIVERSION_PYTHON= \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/$(verpkg)\"" \
7c205843b5f25329b7bac4cb41e4c55a21c7aafevboxsync $(if $(ose),,VBOX_WITH_DOCS_CHM=1) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync VBOX_PACKAGE_DIST=$(debdist) \
b1212d1cdc6c9396aa851ef0a5388edce69806advboxsync $(if $(svnrev),VBOX_SVN_REV=$(svnrev),) \
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync $(if $(NODOCS),VBOX_WITH_DOCS= ,) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(VERBOSE),--print-directory KBUILD_VERBOSE=2,--no-print-directory) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(STAGEDISO),VBOX_WITHOUT_ADDITIONS=1,) \
08879243dd70cdd8c01c3a5941c82c96c45a7e32vboxsync $(if $(BLEEDING_EDGE),VBOX_BLEEDING_EDGE=$(BLEEDING_EDGE),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncconfigure: debian/configure-stamp
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncdebian/configure-stamp:
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_testdir
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync cd $(vboxroot) && ./configure --odir=$(current)/debian $(cfg_flags)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync touch debian/configure-stamp
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncbuild: debian/configure-stamp debian/build-stamp
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncdebian/build-stamp $(verfile):
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_testdir
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync . debian/env.sh && kmk -C $(vboxroot) $(bld_flags) $(if $(NOPARALLEL),-j1,) all
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(NODOCS),cp $(vboxroot)/prebuild/UserManual*.pdf $(builddir)/bin,)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(NODOCS),cp $(vboxroot)/prebuild/VirtualBox*.chm $(builddir)/bin,)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(EFI),cp $(vboxroot)/prebuild/VBoxEFI32.fd $(builddir)/bin,)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(EFI),cp $(vboxroot)/prebuild/VBoxEFI64.fd $(builddir)/bin,)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync mkdir -p $(builddir)/bin/additions
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(STAGEDISO),cp $(STAGEDISO)/VBoxGuestAdditions.iso $(builddir)/bin/additions,)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync . debian/env.sh && kmk -C $(vboxroot) $(bld_flags) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync VBOX_NO_LINUX_RUN_INSTALLER=1 \
b1212d1cdc6c9396aa851ef0a5388edce69806advboxsync VBOX_LNX_ADD_ARCHIVE.x86=$(builddir)/bin/additions/VBoxGuestAdditions-x86.tar.bz2 \
b1212d1cdc6c9396aa851ef0a5388edce69806advboxsync VBOX_LNX_ADD_ARCHIVE.amd64=$(builddir)/bin/additions/VBoxGuestAdditions-amd64.tar.bz2 \
24713061a674af34286ac48ad1433329cdd404f2vboxsync VBOX_PATH_ADDITIONS.linux.x86=$(builddir)/bin/additions \
24713061a674af34286ac48ad1433329cdd404f2vboxsync VBOX_PATH_ADDITIONS.linux.amd64=$(builddir)/bin/additions \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync packing
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync touch debian/build-stamp
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# Build modules for every kernel we find in /lib/modules/*
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncmodules: debian/build-stamp debian/modules-stamp
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncdebian/modules-stamp: debian/build-stamp
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rm -rf $(moddir)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync mkdir $(moddir)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync make -C $(builddir)/bin/src/vboxdrv clean
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync for d in $(wildcard /lib/modules/*); do \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync if [ -L $$d/build ]; then \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync make -C $(builddir)/bin/src/vboxdrv KERN_DIR=$$d/build MODULE_DIR=$$d clean && \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync make -j4 -C $(builddir)/bin/src/vboxdrv KBUILD_VERBOSE= KERN_DIR=$$d/build MODULE_DIR=$$d all \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(instmod),&& install -D -m 0644 -g 0 -o 0 \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(builddir)/bin/src/vboxdrv/vboxdrv.ko $(moddir)/$$(basename $$d)/vboxdrv.ko); \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync make -C $(builddir)/bin/src/vboxnetflt KERN_DIR=$$d/build MODULE_DIR=$$d clean && \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync (cp $(builddir)/bin/src/vboxdrv/Module.symvers $(builddir)/bin/src/vboxnetflt || true) && \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync make -j4 -C $(builddir)/bin/src/vboxnetflt KBUILD_VERBOSE= KERN_DIR=$$d/build MODULE_DIR=$$d all \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(instmod),&& install -D -m 0644 -g 0 -o 0 \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(builddir)/bin/src/vboxnetflt/vboxnetflt.ko $(moddir)/$$(basename $$d)/vboxnetflt.ko); \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync make -C $(builddir)/bin/src/vboxnetadp KERN_DIR=$$d/build MODULE_DIR=$$d clean && \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync (cp $(builddir)/bin/src/vboxdrv/Module.symvers $(builddir)/bin/src/vboxnetadp || true) && \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync make -j4 -C $(builddir)/bin/src/vboxnetadp KBUILD_VERBOSE= KERN_DIR=$$d/build MODULE_DIR=$$d all \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(instmod),&& install -D -m 0644 -g 0 -o 0 \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(builddir)/bin/src/vboxnetadp/vboxnetadp.ko $(moddir)/$$(basename $$d)/vboxnetadp.ko); \
9704f1d0180960069e2c4eb8fe2ddee350910e5dvboxsync make -C $(builddir)/bin/src/vboxpci KERN_DIR=$$d/build MODULE_DIR=$$d clean && \
9704f1d0180960069e2c4eb8fe2ddee350910e5dvboxsync (cp $(builddir)/bin/src/vboxdrv/Module.symvers $(builddir)/bin/src/vboxpci || true) && \
9704f1d0180960069e2c4eb8fe2ddee350910e5dvboxsync make -j4 -C $(builddir)/bin/src/vboxpci KBUILD_VERBOSE= KERN_DIR=$$d/build MODULE_DIR=$$d all \
9704f1d0180960069e2c4eb8fe2ddee350910e5dvboxsync $(if $(instmod),&& install -D -m 0644 -g 0 -o 0 \
9704f1d0180960069e2c4eb8fe2ddee350910e5dvboxsync $(builddir)/bin/src/vboxpci/vboxpci.ko $(moddir)/$$(basename $$d)/vboxpci.ko); \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync fi; \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync done
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync make -C $(builddir)/bin/src/vboxdrv clean
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync make -C $(builddir)/bin/src/vboxnetflt clean
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync make -C $(builddir)/bin/src/vboxnetadp clean
9704f1d0180960069e2c4eb8fe2ddee350910e5dvboxsync make -C $(builddir)/bin/src/vboxpci clean
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync touch debian/modules-stamp
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncclean:
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_testdir
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_testroot
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync rm -f debian/changelog
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync rm -f debian/preinst debian/postinst debian/prerm
17d67aeb3722c094c6493a3e9a9d0cdfb9453ecdvboxsync rm -f debian/$(package).init debian/vboxdrv.init
87c50c527af59e43745475c4b8ac907c5f9bc204vboxsync rm -f debian/vboxballoonctrl-service.init debian/vboxautostart-service.init debian/vboxweb-service.init
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rm -f debian/AutoConfig.kmk debian/configure.log debian/env.sh
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rm -f debian/modules-stamp debian/build-stamp debian/configure-stamp
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rm -f debian/virtualbox-*.substvars debian/virtualbox*.debhelper
c6adb272ec43d5eaadb1493cb2bf45f2f8adf588vboxsync rm -f debian/$(verpkg).mime
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rm -rf $(builddir) $(moddir)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rm -rf debian/wine.*
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_clean
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncifeq ($(VBOX_VERSION_MAJOR),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncbinary binary-arch binary-indep: build $(verfile)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(MAKE) -f debian/rules binary
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncelse
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# Build architecture-dependent files here.
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncbinary binary-arch binary-indep: build $(if $(NOMODS),,modules)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_testdir
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_testroot
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_clean -k
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_installdirs
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync tar -xjC $(prefix)/opt -f $(builddir)/bin/VirtualBox.tar.bz2
9d96c11f5e0d0a674be9a3ac26357aba66f24c15vboxsync $(if $(NOQT),,mv $(archdir)/virtualbox.xml debian/$(verpkg).sharedmimeinfo)
61c35c2bbfa3caf6ca8b21f6c11f45c5a796581fvboxsync $(archdir)/scripts/install.sh --package $(package) --root $(prefix) \
61c35c2bbfa3caf6ca8b21f6c11f45c5a796581fvboxsync --prefix /usr $(if $(NOQT),--no-qt) $(if $(ose),--ose) \
61c35c2bbfa3caf6ca8b21f6c11f45c5a796581fvboxsync $(if $(HEADLESS),--headless) $(if $(NOWEBSVC),--no-web-service) \
61c35c2bbfa3caf6ca8b21f6c11f45c5a796581fvboxsync --install-folder /lib/$(package) --no-helpers
61c35c2bbfa3caf6ca8b21f6c11f45c5a796581fvboxsync install -d -g 0 -o 0 $(prefix)/usr/share/doc/$(verpkg)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync install -d -g 0 -o 0 $(prefix)/usr/share/lintian/overrides
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync sed \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%VERPKG%|$(verpkg)|g' \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync debian/lintian-override.in > \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(prefix)/usr/share/lintian/overrides/$(verpkg)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(NOMODS),,for d in $(moddir)/*; do \
9704f1d0180960069e2c4eb8fe2ddee350910e5dvboxsync if [ -f $$d/vboxdrv.ko -a -f $$d/vboxnetflt.ko -a -f $$d/vboxnetadp.ko -a -f $$d/vboxpci.ko ]; then \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync install -D -g 0 -o 0 -m 0644 \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $$d/vboxdrv.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxdrv.ko; \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync install -D -g 0 -o 0 -m 0644 \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $$d/vboxnetflt.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxnetflt.ko; \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync install -D -g 0 -o 0 -m 0644 \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $$d/vboxnetadp.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxnetadp.ko; \
9704f1d0180960069e2c4eb8fe2ddee350910e5dvboxsync install -D -g 0 -o 0 -m 0644 \
9704f1d0180960069e2c4eb8fe2ddee350910e5dvboxsync $$d/vboxpci.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxpci.ko; \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync fi \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync done)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncifeq ($(ose),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_installdocs \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(archdir)/UserManual*.pdf $(archdir)/VirtualBox*.chm \
90bfe7905f962c9c30f653670ac7fdadbd8f27cdvboxsync $(addprefix $(archdir)/, LICENSE)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rm $(addprefix $(archdir)/,UserManual*.pdf VirtualBox*.chm \
90bfe7905f962c9c30f653670ac7fdadbd8f27cdvboxsync LICENSE)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncelse
d02610fd604cc8ab4cccf7e3fa510c06cb728ff2vboxsync dh_installdocs \
d02610fd604cc8ab4cccf7e3fa510c06cb728ff2vboxsync $(archdir)/UserManual*.pdf
d02610fd604cc8ab4cccf7e3fa510c06cb728ff2vboxsync rm $(addprefix $(archdir)/,UserManual*.pdf)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncendif
61c35c2bbfa3caf6ca8b21f6c11f45c5a796581fvboxsync mv $(archdir) $(prefix)/usr/lib/$(package)
a48f6e21f8737ef47d30d716171ae2bcb10c3382vboxsync ln -s ../VBoxVMM.so $(prefix)/usr/lib/$(package)/components/VBoxVMM.so
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rmdir $(prefix)/opt
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_desktop
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(NOMODS),,dh_installmodules)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync sed \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%NOLSB%||g' \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%DEBIAN%|yes|g' \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%PACKAGE%|virtualbox|g' \
73b48d036adc9de8ba80796a9f9daf1ad5c8b6b7vboxsync -e "s|%VERSION%|$(VBOX_VERSION_STRING)|g" \
b723b174d7132ab6bbff3abcd83c92530065f7davboxsync -e "s|%GROUP%|$(if $(VBOX_WITHOUT_HARDENING),vboxusers,root)|g" \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(vboxroot)/src/VBox/Installer/linux/vboxdrv.sh.in > debian/vboxdrv.init
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_installinit --name=vboxdrv --noscripts
fe7115bba580b609cb1a233f8e08947d0ee0af8dvboxsync cp $(vboxroot)/src/VBox/Installer/linux/vboxballoonctrl-service.sh debian/vboxballoonctrl-service.init
17d67aeb3722c094c6493a3e9a9d0cdfb9453ecdvboxsync dh_installinit --name=vboxballoonctrl-service --noscripts
fe7115bba580b609cb1a233f8e08947d0ee0af8dvboxsync cp $(vboxroot)/src/VBox/Installer/linux/vboxautostart-service.sh debian/vboxautostart-service.init
87c50c527af59e43745475c4b8ac907c5f9bc204vboxsync dh_installinit --name=vboxautostart-service --noscripts
fe7115bba580b609cb1a233f8e08947d0ee0af8dvboxsync cp $(vboxroot)/src/VBox/Installer/linux/vboxweb-service.sh debian/vboxweb-service.init
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_installinit --name=vboxweb-service --noscripts
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync sed -e 's|%VER%|$(debver)|g' \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%DATE%|$(shell date -R)|g' \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%DEBREL%|$(subst _,~,$(debrel))|g' \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%VERPKG%|$(verpkg)|g' \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync debian/changelog.in > debian/changelog
4d5da2bfd5523ad009912e6e0cfb8bf480160e32vboxsync sed -e 's|%VER%|$(ver)|g' \
4d5da2bfd5523ad009912e6e0cfb8bf480160e32vboxsync debian/preinst.in > debian/preinst
4d5da2bfd5523ad009912e6e0cfb8bf480160e32vboxsync sed -e 's|%VER%|$(ver)|g' \
4d5da2bfd5523ad009912e6e0cfb8bf480160e32vboxsync debian/prerm.in > debian/prerm
4d5da2bfd5523ad009912e6e0cfb8bf480160e32vboxsync sed -e 's|%VER%|$(ver)|g' \
f1acc1e99894e016bd1a6ee65c56b3fc064fa4ebvboxsync -e '/#include installer-common.sh/ {' \
f1acc1e99894e016bd1a6ee65c56b3fc064fa4ebvboxsync -e "r $(vboxroot)/src/VBox/Installer/linux/installer-common.sh" \
09ed5ee011f3a6cd9d4742216ad3bb7dbf855641vboxsync -e 'd' \
09ed5ee011f3a6cd9d4742216ad3bb7dbf855641vboxsync -e '}' \
4d5da2bfd5523ad009912e6e0cfb8bf480160e32vboxsync debian/postinst.in > debian/postinst
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_installdebconf
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_installchangelogs
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_installmenu
c6adb272ec43d5eaadb1493cb2bf45f2f8adf588vboxsync dh_installmime
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_link
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncifeq ($(DEBUG),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_strip --keep-debug --exclude=libQtCoreVBox.so.4 --exclude=libQtGuiVBox.so.4 --exclude=libQtNetworkVBox.so.4 --exclude=libQtOpenGLVBox.so.4 --exclude=libqtaccessiblewidgets.so
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncendif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync mkdir -p $(current)/debian/$(verpkg)-dbg/usr/lib
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncifeq ($(DEBUG),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync mv $(current)/debian/$(verpkg)/usr/lib/debug $(current)/debian/$(verpkg)-dbg/usr/lib
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncendif
f8cec848855143b787264c5456f9015e576b59d8vboxsync $(if $(filter _Ubuntu_hardy _Ubuntu_lucid,$(debrel)),dh_pycentral,dh_python2)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_compress -X.pdf -X.chm -X LICENSE -X.py
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_fixperms
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_makeshlibs
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_installdeb
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_perl
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync # for some reason, the Qt libraries couldn't be found on newer releases (e.g. Ubuntu hardy)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync LD_LIBRARY_PATH=$(prefix)/usr/lib/virtualbox dh_shlibdeps
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_gencontrol -- \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -Valsa=$(if $(HEADLESS),,libasound2) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -Vpulse=$(if $(HEADLESS),,libpulse0) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -Vsdlttf=$(if $(HEADLESS),,libsdl-ttf2.0-0) \
faa254427e497bb7ee255b22581f40112025e92bvboxsync -Vdkms=$(if $(filter _Debian_lenny,$(debrel)),,dkms)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync dh_md5sums
5d31da34788d5a82008edfa7181f3e2776462db7vboxsync dh_builddeb --destdir $(pkgdir) -- \
08879243dd70cdd8c01c3a5941c82c96c45a7e32vboxsync $(if $(filter _Ubuntu_lucid,$(debrel)),,-Zxz)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncendif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync.PHONY: binary modules binary-arch binary-indep clean checkroot