rules revision c7f55daa53d5798572d767a5f9075eead91ad490
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync#!/usr/bin/make -f
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync#
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# Copyright (C) 2006-2010 Oracle Corporation
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync#
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# available from http://www.virtualbox.org. This file is free software;
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# you can redistribute it and/or modify it under the terms of the GNU
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# General Public License as published by the Free Software Foundation,
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# distribution. VirtualBox OSE is distributed in the hope that it will
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# be useful, but WITHOUT ANY WARRANTY of any kind.
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync#
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync#export DH_VERBOSE=1
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncexport DH_COMPAT=4
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# possible overrides:
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# OSE=1 force VBOX_OSE
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# NOPARALLEL=1 compile with -j1
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# LINUX=<dir> compile vboxdrv against Linux found in <dir>
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# VERBOSE=1 verbose build
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# DEBUG=1 debug build
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# NOSUBVER=1 disable generation of the sub-version field (which is
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# either the subversion rev [if available] or the build date)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# NODOCS=1 don't build docs, use precompiled UserManual.pdf and
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# VirtualBox.chm from $HOME
8eb4989e815c8f374b965265ccf184d6ce17d9e8vboxsync# NOMODS=1 don't build any module
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# NOQT=1 don't build the Qt GUI
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# HEADLESS=1 build the headless version
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# NOWEBSVC=1 don't build the webservice API, default for OSE
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync# STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# BLEEDING_EDGE=xyz
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncpackage := virtualbox
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncverpkg := virtualbox-ose
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsynccurrent := $(shell pwd)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncvboxroot := $(shell pwd)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncpkgdir := ..
46e6cceda24bf6c589e4cb151afefe4fffecca7bvboxsyncbuilddir := $(current)/debian/builddir
8eb4989e815c8f374b965265ccf184d6ce17d9e8vboxsyncmoddir := $(current)/debian/modules
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncprefix := $(current)/debian/$(verpkg)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncarch := $(shell dpkg --print-architecture)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncverfile := $(builddir)/version-generated.mk
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncose := 1
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsyncsvnrev := 0
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncNOMODS ?= $(ose)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncNOQT ?= $(HEADLESS)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncNOWEBSVC ?= $(ose)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncNOWINE := $(if $(NODOCS),$(if $(STAGEDISO),1,),)$(ose)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncifneq ($(wildcard $(verfile)),)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncinclude $(verfile)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncver := $(VBOX_VERSION_STRING)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncarchdir := $(prefix)/opt/VirtualBox-$(ver)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncendif
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncifneq ($(STAGEDISO),)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync ifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(error STAGEDISO='$(STAGEDISO)/VBoxGuestAdditions.iso' not found)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync endif
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncendif
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncdebrel := $(if $(shell which lsb_release),_$(shell lsb_release -si)_$(shell lsb_release -sc),unknown)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync
0a724db1030736c131a45392c0ebb6bb25362917vboxsync# shipping Linux kernel modules with bleeding-edge releases doesn't make sense
0a724db1030736c131a45392c0ebb6bb25362917vboxsyncinstmod := $(if $(filter _Ubuntu_lucid _Debian_sid,$(debrel)),,1)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# Locations of custom built Qt libraries (see below)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncqtstdc5 := /home/vbox/Qt-4.4.3-stdc++5-$(arch)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncqtstdc6 := /home/vbox/Qt-4.4.3-stdc++6-$(arch)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsynccfg_flags := $(if $(NOQT),--disable-qt,) \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(ose),--ose,) $(if $(LINUX),--with-linux=$(LINUX),) \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(filter _Debian_etch,$(debrel)),$(if $(ose),,--build-libcurl),) \
ad34209dccf31d54e2277d732a90ce6ea4374362vboxsync $(if $(filter _Debian_etch _Ubuntu_hardy,$(debrel)),--with-qt4-dir=$(qtstdc6)) \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(HEADLESS),--build-headless,) \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(DEBUG),--build-debug,) \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(NOWINE),,--setup-wine) \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(NOWEBSVC),,--enable-webservice)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncbld_flags := AUTOCFG=$(current)/debian/AutoConfig.kmk \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync LOCALCFG=$(current)/debian/LocalConfig.kmk \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync PATH_OUT=$(current)/debian/builddir \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync VBOX_DO_STRIP= \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync VBOX_DO_STRIP_MODULES= \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync VBOX_WITH_MULTIVERSION_PYTHON= \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/$(verpkg)\"" \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync VBOX_SVN_REV=$(svnrev) \
ad34209dccf31d54e2277d732a90ce6ea4374362vboxsync $(if $(NODOCS),VBOX_WITH_DOCS= ,)\
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(VERBOSE),--print-directory KBUILD_VERBOSE=2,--no-print-directory) \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync $(if $(STAGEDISO),VBOX_WITHOUT_ADDITIONS=1,) \
0a724db1030736c131a45392c0ebb6bb25362917vboxsync $(if $(BLEEDING_EDGE),VBOX_BLEEDING_EDGE=$(BLEEDING_EDGE),) \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(filter _Debian_etch _Ubuntu_hardy,$(debrel)),,VBOX_WITH_SYSFS_BY_DEFAULT=1)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncconfigure: debian/configure-stamp
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncdebian/configure-stamp:
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_testdir
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync cd $(vboxroot) && ./configure --odir=$(current)/debian $(cfg_flags)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync touch debian/configure-stamp
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncbuild: debian/configure-stamp debian/build-stamp
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncdebian/build-stamp $(verfile):
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_testdir
ad34209dccf31d54e2277d732a90ce6ea4374362vboxsync . debian/env.sh && kmk -C $(vboxroot) $(bld_flags) $(if $(NOPARALLEL),-j1,) all
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(NODOCS),cp $(vboxroot)/prebuild/UserManual*.pdf $(builddir)/bin,)
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync $(if $(NODOCS),cp $(vboxroot)/prebuild/VirtualBox*.chm $(builddir)/bin,)
0a724db1030736c131a45392c0ebb6bb25362917vboxsync mkdir -p $(builddir)/bin/additions
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(STAGEDISO),cp $(STAGEDISO)/VBoxGuestAdditions.iso $(builddir)/bin/additions,)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync . debian/env.sh && kmk -C $(vboxroot) $(bld_flags) \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync VBOX_NO_LINUX_RUN_INSTALLER=1 \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync VBOX_LNX_ADD_ARCHIVE.x86=$(builddir)/bin/additions/VBoxGuestAdditions-x86-r$(svnrev).tar.bz2 \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync VBOX_LNX_ADD_ARCHIVE.amd64=$(builddir)/bin/additions/VBoxGuestAdditions-amd64-r$(svnrev).tar.bz2 \
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync packing
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync touch debian/build-stamp
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# Build modules for every kernel we find in /lib/modules/*
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncmodules: debian/build-stamp debian/modules-stamp
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncdebian/modules-stamp: debian/build-stamp
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync rm -rf $(moddir)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync mkdir $(moddir)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync make -C $(builddir)/bin/src/vboxdrv clean
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync for d in $(wildcard /lib/modules/*); do \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync if [ -L $$d/build ]; then \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync make -C $(builddir)/bin/src/vboxdrv KERN_DIR=$$d/build MODULE_DIR=$$d clean && \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync make -j4 -C $(builddir)/bin/src/vboxdrv KBUILD_VERBOSE= KERN_DIR=$$d/build MODULE_DIR=$$d all \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(instmod),&& install -D -m 0644 -g 0 -o 0 \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(builddir)/bin/src/vboxdrv/vboxdrv.ko $(moddir)/$$(basename $$d)/vboxdrv.ko); \
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync make -C $(builddir)/bin/src/vboxnetflt KERN_DIR=$$d/build MODULE_DIR=$$d clean && \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync (cp $(builddir)/bin/src/vboxdrv/Module.symvers $(builddir)/bin/src/vboxnetflt || true) && \
69f57565f5243a46f1df060b63d0fd830de3be04vboxsync make -j4 -C $(builddir)/bin/src/vboxnetflt KBUILD_VERBOSE= KERN_DIR=$$d/build MODULE_DIR=$$d all \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(instmod),&& install -D -m 0644 -g 0 -o 0 \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(builddir)/bin/src/vboxnetflt/vboxnetflt.ko $(moddir)/$$(basename $$d)/vboxnetflt.ko); \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync make -C $(builddir)/bin/src/vboxnetadp KERN_DIR=$$d/build MODULE_DIR=$$d clean && \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync (cp $(builddir)/bin/src/vboxdrv/Module.symvers $(builddir)/bin/src/vboxnetadp || true) && \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync make -j4 -C $(builddir)/bin/src/vboxnetadp KBUILD_VERBOSE= KERN_DIR=$$d/build MODULE_DIR=$$d all \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(instmod),&& install -D -m 0644 -g 0 -o 0 \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(builddir)/bin/src/vboxnetadp/vboxnetadp.ko $(moddir)/$$(basename $$d)/vboxnetadp.ko); \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync fi; \
8eb4989e815c8f374b965265ccf184d6ce17d9e8vboxsync done
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync make -C $(builddir)/bin/src/vboxdrv clean
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync make -C $(builddir)/bin/src/vboxnetflt clean
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync make -C $(builddir)/bin/src/vboxnetadp clean
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync touch debian/modules-stamp
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncclean:
4726db8b47db329039ce8f8e13ecd2c1f696fa60vboxsync dh_testdir
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_testroot
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync rm -f debian/preinst debian/postinst
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync rm -f debian/$(package).init debian/vboxdrv.init
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync rm -f debian/AutoConfig.kmk debian/configure.log debian/env.sh
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync rm -f debian/modules-stamp debian/build-stamp debian/configure-stamp
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync rm -rf $(builddir) $(moddir)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_clean
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsyncifeq ($(VBOX_VERSION_MAJOR),)
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsyncbinary binary-arch binary-indep: build $(verfile)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(MAKE) -f debian/rules binary
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsyncelse
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync# Build architecture-dependent files here.
ad34209dccf31d54e2277d732a90ce6ea4374362vboxsyncbinary binary-arch binary-indep: build $(if $(NOMODS),,modules)
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync dh_testdir
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync dh_testroot
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync dh_clean -k
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync dh_installdirs
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync tar -xjC $(prefix)/opt -f $(builddir)/bin/VirtualBox.tar.bz2
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync install -d -g 0 -o 0 $(prefix)/usr/share/applications
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync install -d -g 0 -o 0 $(prefix)/usr/lib
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync install -d -g 0 -o 0 $(prefix)/usr/bin
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync install -d -g 0 -o 0 $(prefix)/usr/lib/$(package)
7e958a4329e4f9d83f597e26c72121969091e87bvboxsync install -d -g 0 -o 0 $(prefix)/usr/share/$(package)
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync install -d -g 0 -o 0 $(prefix)/usr/share/doc/$(verpkg)
f3f687b00a9f7c98dc0b81899090bc5f659ae7bdvboxsync $(if $(NOQT),,mv $(archdir)/virtualbox.desktop \
bcc2356dccf06ea3fdd1f3e4d4e62b04e95673d0vboxsync $(prefix)/usr/share/applications/virtualbox.desktop)
bcc2356dccf06ea3fdd1f3e4d4e62b04e95673d0vboxsync install -d -g 0 -o 0 $(prefix)/usr/share/pixmaps
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync install -d -g 0 -o 0 $(prefix)/usr/share/lintian/overrides
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync sed \
8eb4989e815c8f374b965265ccf184d6ce17d9e8vboxsync -e 's|%VERPKG%|$(verpkg)|g' \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync debian/lintian-override.in > \
17a9bf5bda28580b3163cf1e2fb8b13c356b5fb0vboxsync $(prefix)/usr/share/lintian/overrides/$(verpkg)
8eb4989e815c8f374b965265ccf184d6ce17d9e8vboxsync mv $(archdir)/VBoxEFI32.fd $(prefix)/usr/lib/$(package)
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync mv $(archdir)/VBoxEFI64.fd $(prefix)/usr/lib/$(package)
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync mv $(archdir)/VBox.png \
ad34209dccf31d54e2277d732a90ce6ea4374362vboxsync $(prefix)/usr/share/pixmaps/VBox.png
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync mv $(archdir)/*.gc $(prefix)/usr/lib/$(package)
8eb4989e815c8f374b965265ccf184d6ce17d9e8vboxsync mv $(archdir)/*.r0 $(prefix)/usr/lib/$(package)
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync mv $(archdir)/*.rel $(prefix)/usr/lib/$(package) || true
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync mv $(archdir)/VBoxNetDHCP $(prefix)/usr/lib/$(package)
ad34209dccf31d54e2277d732a90ce6ea4374362vboxsync mv $(archdir)/VBoxNetAdpCtl $(prefix)/usr/lib/$(package)
ad34209dccf31d54e2277d732a90ce6ea4374362vboxsync mv $(archdir)/VBoxXPCOMIPCD $(prefix)/usr/lib/$(package)
8eb4989e815c8f374b965265ccf184d6ce17d9e8vboxsync mv $(archdir)/components $(prefix)/usr/lib/$(package)/components
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync mv $(archdir)/*.so $(prefix)/usr/lib/$(package)
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync mv $(archdir)/*.so.4 $(prefix)/usr/lib/$(package) || true
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(NOQT),,mv $(archdir)/VBoxTestOGL $(prefix)/usr/lib/$(package))
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync $(if $(NOQT),,mv $(archdir)/nls $(prefix)/usr/share/$(package))
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync mv $(archdir)/src $(prefix)/usr/share/$(package)
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync rm $(archdir)/VBox.sh
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync export VBOX_INSTALL_PATH=/usr/lib/$(package) && \
bcc2356dccf06ea3fdd1f3e4d4e62b04e95673d0vboxsync cd ./debian/builddir/bin/sdk/installer && \
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync python ./vboxapisetup.py install --root $(prefix)
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync rm -rf $(archdir)/sdk/installer
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync mv $(archdir)/vboxshell.py $(prefix)/usr/lib/$(package)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync mv $(archdir)/sdk $(prefix)/usr/lib/$(package)
8eb4989e815c8f374b965265ccf184d6ce17d9e8vboxsync install -D -g 0 -o 0 -m 644 debian/VBox.sh $(prefix)/usr/bin/VBox
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync mv $(archdir)/VBoxSysInfo.sh $(prefix)/usr/share/$(package)
bcc2356dccf06ea3fdd1f3e4d4e62b04e95673d0vboxsync for i in VBoxManage VBoxSVC $(if $(HEADLESS),,VBoxSDL) \
0b1397fff8b368cf5c2f3d8f5b312ed00114977dvboxsync $(if $(NOQT),,VirtualBox) VBoxHeadless \
bcc2356dccf06ea3fdd1f3e4d4e62b04e95673d0vboxsync $(if $(NOWEBSVC),,vboxwebsrv webtest); do \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync mv $(archdir)/$$i $(prefix)/usr/lib/$(package); done
0b1397fff8b368cf5c2f3d8f5b312ed00114977dvboxsync mv $(archdir)/VBoxTunctl $(prefix)/usr/bin
bcc2356dccf06ea3fdd1f3e4d4e62b04e95673d0vboxsync $(if $(NOMODS),,for d in $(moddir)/*; do \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync if [ -f $$d/vboxdrv.ko -a -f $$d/vboxnetflt.ko -a -f $$d/vboxnetadp.ko ]; then \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync install -D -g 0 -o 0 -m 0644 \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $$d/vboxdrv.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxdrv.ko; \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync install -D -g 0 -o 0 -m 0644 \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $$d/vboxnetflt.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxnetflt.ko; \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync install -D -g 0 -o 0 -m 0644 \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync $$d/vboxnetadp.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxnetadp.ko; \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync fi \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync done)
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsyncifeq ($(ose),)
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync $(if $(NOQT),,mv $(archdir)/kchmviewer $(prefix)/usr/lib/$(package))
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync dh_installdocs \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync $(archdir)/UserManual*.pdf $(archdir)/VirtualBox*.chm \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync $(addprefix $(archdir)/, $(if $(HEADLESS),,License-*.html) LICENSE)
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync rm $(addprefix $(archdir)/,UserManual*.pdf VirtualBox*.chm \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync LICENSE $(if $(HEADLESS),,License-*.html))
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync for i in rdesktop-vrdp.tar.gz additions/VBoxGuestAdditions.iso; do \
ad34209dccf31d54e2277d732a90ce6ea4374362vboxsync mv $(archdir)/$$i $(prefix)/usr/share/$(package); done
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync rmdir $(archdir)/additions
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync if [ -d $(archdir)/accessible ]; then mv $(archdir)/accessible $(prefix)/usr/lib/virtualbox; fi
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncelse
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_installdocs
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncendif
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync rmdir $(archdir)
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync rmdir $(prefix)/opt
702250abf86d6252cfbbff216d848d2c799548a4vboxsync dh_link \
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync $(if $(NOQT),,usr/bin/VBox usr/bin/VirtualBox) \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync usr/bin/VBox usr/bin/VBoxManage \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(HEADLESS),,usr/bin/VBox usr/bin/VBoxSDL) \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(ose),,usr/bin/VBox usr/bin/VBoxVRDP) \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync usr/bin/VBox usr/bin/VBoxHeadless \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(NOWEBSVC),,usr/bin/VBox usr/bin/vboxwebsrv) \
usr/share/virtualbox/src/vboxdrv usr/src/vboxdrv-$(ver) \
usr/share/virtualbox/src/vboxnetflt usr/src/vboxnetflt-$(ver) \
usr/share/virtualbox/src/vboxnetadp usr/src/vboxnetadp-$(ver)
dh_desktop
dh_installmenu
$(if $(NOMODS),,dh_installmodules)
sed \
-e 's|%NOLSB%||g' \
-e 's|%DEBIAN%|yes|g' \
-e 's|%PACKAGE%|virtualbox|g' \
$(vboxroot)/src/VBox/Installer/linux/vboxdrv.sh.in > debian/vboxdrv.init
dh_installinit --name=vboxdrv --noscripts
sed \
-e 's|%NOLSB%||g' \
-e 's|%DEBIAN%|yes|g' \
-e 's|%PACKAGE%|virtualbox|g' \
$(vboxroot)/src/VBox/Installer/linux/vboxweb-service.sh.in > debian/vboxweb-service.init
dh_installinit --name=vboxweb-service --noscripts
cat debian/preinst.in | sed -e 's|%VER%|$(ver)|g' > debian/preinst
cat debian/postinst.in | sed -e 's|%VER%|$(ver)|g' > debian/postinst
dh_installdebconf
dh_installchangelogs
dh_link
ifeq ($(DEBUG),)
dh_strip --keep-debug --exclude=libQtCoreVBox.so.4 --exclude=libQtGuiVBox.so.4 --exclude=libQtNetworkVBox.so.4 --exclude=libQtOpenGLVBox.so.4 --exclude=libqtaccessiblewidgets.so
# manually strip our R0/GC modules, dh_strip cannot handle them
for f in \
$(prefix)/usr/lib/$(package)/*.r0 $(prefix)/usr/lib/$(package)/*.gc; do \
objcopy --only-keep-debug \
$$f \
$(prefix)/usr/lib/debug/usr/lib/$(package)/`basename $$f`; \
strip -S --remove-section=.comment $$f; \
objcopy --add-gnu-debuglink=$(prefix)/usr/lib/debug/usr/lib/$(package)/`basename $$f` $$f; \
done
endif
mkdir -p $(current)/debian/$(verpkg)-dbg/usr/lib
ifeq ($(DEBUG),)
mv $(current)/debian/$(verpkg)/usr/lib/debug $(current)/debian/$(verpkg)-dbg/usr/lib
endif
dh_pycentral
dh_compress -X.pdf -X.chm -X LICENSE -X.py
dh_fixperms
dh_makeshlibs
dh_installdeb
dh_perl
dh_shlibdeps
dh_gencontrol -- \
-Valsa=$(if $(HEADLESS),,libasound2) \
-Vpulse=$(if $(HEADLESS),,libpulse0) \
-Vsdlttf=$(if $(HEADLESS),,libsdl-ttf2.0-0) \
-Vdkms=$(if $(filter _Ubuntu_hardy _Ubuntu_intrepid _Ubuntu_jaunty _Ubuntu_karmic _Ubuntu_lucid,$(debrel)),dkms,)
dh_md5sums
dh_builddeb --destdir $(pkgdir)
endif
.PHONY: binary modules binary-arch binary-indep clean checkroot