rules revision e2a0570d35035f00c593417795f2e37b1d4a3242
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync#!/usr/bin/make -f
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync#
0887a65d2e1f7d938381bed11e859caed56cb47evboxsync# 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
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync# 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
bffb24521128f5183aafbef6542e7dacf20b5132vboxsync# NOQT=1 don't build the Qt GUI
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# HEADLESS=1 build the headless version
1deb4de12fed2ad1932401517862e6b5dc5466a3vboxsync# NOWEBSVC=1 don't build the webservice API, default for OSE
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso
3e66da17d5b68a6f1a06c60e88a7c9967b0ab2a4vboxsync# BLEEDING_EDGE=xyz
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync
da6747c2419b9cea8b5e2c576a30a5de999a8ab3vboxsyncpackage := virtualbox
da6747c2419b9cea8b5e2c576a30a5de999a8ab3vboxsyncverpkg := virtualbox-ose
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsynccurrent := $(shell pwd)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncvboxroot := $(shell pwd)
1deb4de12fed2ad1932401517862e6b5dc5466a3vboxsyncpkgdir := ..
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncbuilddir := $(current)/debian/builddir
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncmoddir := $(current)/debian/modules
da6747c2419b9cea8b5e2c576a30a5de999a8ab3vboxsyncprefix := $(current)/debian/$(verpkg)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncarch := $(shell dpkg --print-architecture)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncverfile := $(builddir)/version-generated.mk
46e6cceda24bf6c589e4cb151afefe4fffecca7bvboxsyncose := 1
8eb4989e815c8f374b965265ccf184d6ce17d9e8vboxsyncNOMODS ?= $(ose)
bffb24521128f5183aafbef6542e7dacf20b5132vboxsyncNOQT ?= $(HEADLESS)
1deb4de12fed2ad1932401517862e6b5dc5466a3vboxsyncNOWEBSVC ?= $(ose)
e1f397485a50a958c625b4d709c052aa2687a4fbvboxsyncNOWINE := $(if $(NODOCS),$(if $(STAGEDISO),1,),)$(ose)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncifneq ($(wildcard $(verfile)),)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncinclude $(verfile)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncver := $(VBOX_VERSION_STRING)
1deb4de12fed2ad1932401517862e6b5dc5466a3vboxsyncarchdir := $(prefix)/opt/VirtualBox-$(ver)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncendif
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncifneq ($(STAGEDISO),)
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync ifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),)
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync $(error STAGEDISO='$(STAGEDISO)/VBoxGuestAdditions.iso' not found)
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync endif
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncendif
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# Hack: Xandros is actually Debian/sarge ... :(
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncifneq ($(wildcard /etc/xandros-desktop-version),)
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync debrel := _xandros4.1
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncelse
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncifneq ($(wildcard /etc/univention),)
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync debrel := _ucs1.3
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncelse
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync debrel := $(if $(shell which lsb_release),_$(shell lsb_release -si)_$(shell lsb_release -sc),unknown)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncendif
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncendif
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync# shipping Linux kernel modules with bleeding-edge releases doesn't make sense
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsyncinstmod := $(if $(filter _Ubuntu_karmic _Debian_sid,$(debrel)),,1)
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync
1deb4de12fed2ad1932401517862e6b5dc5466a3vboxsync# Locations of custom built Qt libraries (see below)
b47e1a23753df9fbe88c88071067d34dbefcdedbvboxsyncqtstdc5 := /home/vbox/Qt-4.4.3-stdc++5-$(arch)
b47e1a23753df9fbe88c88071067d34dbefcdedbvboxsyncqtstdc6 := /home/vbox/Qt-4.4.3-stdc++6-$(arch)
1deb4de12fed2ad1932401517862e6b5dc5466a3vboxsync
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsynccfg_flags := $(if $(NOQT),--disable-qt,) \
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync $(if $(ose),--ose,) $(if $(LINUX),--with-linux=$(LINUX),) \
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync $(if $(filter _Ubuntu_dapper,$(debrel)),--with-gcc=gcc-3.4 --with-g++=g++-3.4,) \
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync $(if $(filter _Ubuntu_gutsy,$(debrel)),--with-gcc=gcc-4.2 --with-g++=g++-4.2,) \
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync $(if $(filter _xandros4.1 _ucs1.3 _Debian_sarge _Ubuntu_dapper,$(debrel)),--build-libxml2,) \
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync $(if $(filter _xandros4.1 _ucs1.3 _Debian_sarge _Ubuntu_dapper,$(debrel)),--build-libxslt,) \
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync $(if $(filter _Debian_etch,$(debrel)),$(if $(ose),,--build-libcurl),) \
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync $(if $(filter _Debian_sarge _xandros4.1 _ucs1.3,$(debrel)),--with-qt4-dir=$(qtstdc5)) \
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync $(if $(filter _Debian_etch _Ubuntu_dapper _Ubuntu_edgy _Ubuntu_feisty _Ubuntu_gutsy _Ubuntu_hardy,$(debrel)),--with-qt4-dir=$(qtstdc6)) \
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync $(if $(filter _xandros4.1 _ucs1.3,$(debrel)),--disable-sdl-ttf,) \
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync $(if $(filter _Debian_sarge _Ubuntu_dapper _Ubuntu_edgy _xandros4.1 _ucs1.3,$(debrel)),--disable-pulse,) \
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync $(if $(HEADLESS),--build-headless,) \
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync $(if $(DEBUG),--build-debug,) \
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync $(if $(NOWINE),,--setup-wine) \
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync $(if $(NOWEBSVC),,--enable-webservice)
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsyncbld_flags := AUTOCFG=$(current)/debian/AutoConfig.kmk \
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync LOCALCFG=$(current)/debian/LocalConfig.kmk \
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync PATH_OUT=$(current)/debian/builddir \
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync VBOX_DO_STRIP= \
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync VBOX_DO_STRIP_MODULES= \
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync VBOX_WITH_MULTIVERSION_PYTHON= \
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/$(verpkg)\"" \
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync $(if $(NODOCS),VBOX_WITH_DOCS= ,)\
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync $(if $(VERBOSE),--print-directory KBUILD_VERBOSE=2,--no-print-directory) \
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync $(if $(STAGEDISO),VBOX_WITHOUT_ADDITIONS=1,) \
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync $(if $(BLEEDING_EDGE),VBOX_BLEEDING_EDGE=$(BLEEDING_EDGE),) \
9448344dffd6329c43c735ae1ed5f45995e445e6vboxsync $(if $(filter _Debian_sarge _xandros4.1 _ucs1.3,$(debrel)),VBOX_LD_as_needed= ,) \
9448344dffd6329c43c735ae1ed5f45995e445e6vboxsync $(if $(filter _Debian_etch _Ubuntu_hardy,$(debrel)),,VBOX_WITH_SYSFS_BY_DEFAULT=1)
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# Ubuntu dapper: gcc-4.0 does not work with recompiler, use gcc-3.4 instead
13c94cb9d95cf4865646e86b944c09e1af2fe48cvboxsync# Ubuntu gutsy: gcc-4.1 does not work for the webservices, use gcc-4.2 instead
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncconfigure: debian/configure-stamp
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncdebian/configure-stamp:
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_testdir
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync 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
9448344dffd6329c43c735ae1ed5f45995e445e6vboxsync . debian/env.sh && kmk -C $(vboxroot) $(bld_flags) $(if $(NOPARALLEL),-j1,) all
1deb4de12fed2ad1932401517862e6b5dc5466a3vboxsync $(if $(NODOCS),cp $(vboxroot)/prebuild/UserManual*.pdf $(builddir)/bin,)
1deb4de12fed2ad1932401517862e6b5dc5466a3vboxsync $(if $(NODOCS),cp $(vboxroot)/prebuild/VirtualBox*.chm $(builddir)/bin,)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync mkdir -p $(builddir)/bin/additions
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(STAGEDISO),cp $(STAGEDISO)/VBoxGuestAdditions.iso $(builddir)/bin/additions,)
9448344dffd6329c43c735ae1ed5f45995e445e6vboxsync . debian/env.sh && kmk -C $(vboxroot) $(bld_flags) \
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync VBOX_NO_LINUX_RUN_INSTALLER=1 \
1deb4de12fed2ad1932401517862e6b5dc5466a3vboxsync VBOX_PATH_ADDITIONS.linux.x86=$(builddir)/bin/additions \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync 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
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsyncdebian/modules-stamp: debian/build-stamp
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync rm -rf $(moddir)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync mkdir $(moddir)
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync make -C $(builddir)/bin/src/vboxdrv clean
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync for d in $(wildcard /lib/modules/*); do \
27efd9329f6a90f7cacf840031e5305f98975960vboxsync if [ -L $$d/build ]; then \
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync make -C $(builddir)/bin/src/vboxdrv KERN_DIR=$$d/build MODULE_DIR=$$d clean && \
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync make -j4 -C $(builddir)/bin/src/vboxdrv KBUILD_VERBOSE= KERN_DIR=$$d/build MODULE_DIR=$$d all \
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync $(if $(instmod),&& install -D -m 0644 -g 0 -o 0 \
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync $(builddir)/bin/src/vboxdrv/vboxdrv.ko $(moddir)/$$(basename $$d)/vboxdrv.ko); \
a0a9f39e8864357c2e1e61106958411240f5bf6bvboxsync make -C $(builddir)/bin/src/vboxnetflt KERN_DIR=$$d/build MODULE_DIR=$$d clean && \
a0a9f39e8864357c2e1e61106958411240f5bf6bvboxsync (cp $(builddir)/bin/src/vboxdrv/Module.symvers $(builddir)/bin/src/vboxnetflt || true) && \
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync make -j4 -C $(builddir)/bin/src/vboxnetflt KBUILD_VERBOSE= KERN_DIR=$$d/build MODULE_DIR=$$d all \
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync $(if $(instmod),&& install -D -m 0644 -g 0 -o 0 \
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync $(builddir)/bin/src/vboxnetflt/vboxnetflt.ko $(moddir)/$$(basename $$d)/vboxnetflt.ko); \
2b66a097b19f31e00af3abc508a3ff8c74ca1f8avboxsync make -C $(builddir)/bin/src/vboxnetadp KERN_DIR=$$d/build MODULE_DIR=$$d clean && \
2b66a097b19f31e00af3abc508a3ff8c74ca1f8avboxsync (cp $(builddir)/bin/src/vboxdrv/Module.symvers $(builddir)/bin/src/vboxnetadp || true) && \
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync make -j4 -C $(builddir)/bin/src/vboxnetadp KBUILD_VERBOSE= KERN_DIR=$$d/build MODULE_DIR=$$d all \
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync $(if $(instmod),&& install -D -m 0644 -g 0 -o 0 \
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync $(builddir)/bin/src/vboxnetadp/vboxnetadp.ko $(moddir)/$$(basename $$d)/vboxnetadp.ko); \
27efd9329f6a90f7cacf840031e5305f98975960vboxsync fi; \
27efd9329f6a90f7cacf840031e5305f98975960vboxsync done
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync make -C $(builddir)/bin/src/vboxdrv clean
a0a9f39e8864357c2e1e61106958411240f5bf6bvboxsync make -C $(builddir)/bin/src/vboxnetflt clean
2b66a097b19f31e00af3abc508a3ff8c74ca1f8avboxsync make -C $(builddir)/bin/src/vboxnetadp clean
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync touch debian/modules-stamp
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncclean:
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_testdir
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_testroot
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync rm -f debian/preinst debian/postinst
03e380b03da26ad4a2309190f35ba86843d3d824vboxsync rm -f debian/$(package).init debian/vboxdrv.init
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync rm -f debian/AutoConfig.kmk debian/configure.log debian/env.sh
69f57565f5243a46f1df060b63d0fd830de3be04vboxsync rm -f debian/modules-stamp debian/build-stamp debian/configure-stamp
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync rm -rf $(builddir) $(moddir)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_clean
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncifeq ($(VBOX_VERSION_MAJOR),)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncbinary binary-arch binary-indep: build $(verfile)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(MAKE) -f debian/rules binary
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncelse
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# Build architecture-dependent files here.
8eb4989e815c8f374b965265ccf184d6ce17d9e8vboxsyncbinary binary-arch binary-indep: build $(if $(NOMODS),,modules)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_testdir
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_testroot
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_clean -k
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_installdirs
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync tar -xjC $(prefix)/opt -f $(builddir)/bin/VirtualBox.tar.bz2
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync install -d -g 0 -o 0 $(prefix)/usr/share/applications
4726db8b47db329039ce8f8e13ecd2c1f696fa60vboxsync install -d -g 0 -o 0 $(prefix)/usr/lib
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync install -d -g 0 -o 0 $(prefix)/usr/bin
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync install -d -g 0 -o 0 $(prefix)/usr/lib/$(package)
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync install -d -g 0 -o 0 $(prefix)/usr/share/$(package)
da6747c2419b9cea8b5e2c576a30a5de999a8ab3vboxsync install -d -g 0 -o 0 $(prefix)/usr/share/doc/$(verpkg)
10aa2d962b3a99120bb34c055fd5ba35da31bbb1vboxsync $(if $(NOQT),,mv $(archdir)/virtualbox.desktop \
10aa2d962b3a99120bb34c055fd5ba35da31bbb1vboxsync $(prefix)/usr/share/applications/virtualbox.desktop)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync install -d -g 0 -o 0 $(prefix)/usr/share/pixmaps
097b3079a919c94052ca642306232b856949c755vboxsync install -d -g 0 -o 0 $(prefix)/usr/share/lintian/overrides
097b3079a919c94052ca642306232b856949c755vboxsync sed \
097b3079a919c94052ca642306232b856949c755vboxsync -e 's|%VERPKG%|$(verpkg)|g' \
097b3079a919c94052ca642306232b856949c755vboxsync debian/lintian-override.in > \
097b3079a919c94052ca642306232b856949c755vboxsync $(prefix)/usr/share/lintian/overrides/$(verpkg)
cb1c9aee152f51cd97c07794ca4e0441b2444b0cvboxsync mv $(archdir)/VBoxEFI32.fd $(prefix)/usr/lib/$(package)
cb1c9aee152f51cd97c07794ca4e0441b2444b0cvboxsync mv $(archdir)/VBoxEFI64.fd $(prefix)/usr/lib/$(package)
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync mv $(archdir)/VBox.png \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(prefix)/usr/share/pixmaps/VBox.png
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync mv $(archdir)/*.gc $(prefix)/usr/lib/$(package)
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync mv $(archdir)/*.r0 $(prefix)/usr/lib/$(package)
6e2490fe643cb292ee8e37f9e1d7171e9315129cvboxsync mv $(archdir)/*.rel $(prefix)/usr/lib/$(package) || true
917d66601860f75830cb684385ba7b4d73458bcavboxsync mv $(archdir)/VBoxNetDHCP $(prefix)/usr/lib/$(package)
917d66601860f75830cb684385ba7b4d73458bcavboxsync mv $(archdir)/VBoxNetAdpCtl $(prefix)/usr/lib/$(package)
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync mv $(archdir)/VBoxXPCOMIPCD $(prefix)/usr/lib/$(package)
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync mv $(archdir)/components $(prefix)/usr/lib/$(package)/components
e2a0570d35035f00c593417795f2e37b1d4a3242vboxsync mv $(archdir)/*.so $(prefix)/usr/lib/$(package)
e2a0570d35035f00c593417795f2e37b1d4a3242vboxsync mv $(archdir)/*.so.4 $(prefix)/usr/lib/$(package) || true
9c3bee32a5fb0decbd644a998a3d37035bb9800dvboxsync $(if $(NOQT),,mv $(archdir)/VBoxTestOGL $(prefix)/usr/lib/$(package))
bffb24521128f5183aafbef6542e7dacf20b5132vboxsync $(if $(NOQT),,mv $(archdir)/nls $(prefix)/usr/share/$(package))
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync mv $(archdir)/src $(prefix)/usr/share/$(package)
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync rm $(archdir)/VBox.sh
aaae4f8728f4fbd3ef97b8798350ddc6abbc79f0vboxsync export VBOX_INSTALL_PATH=/usr/lib/$(package) && \
c7267e77a1f8b99136cc3dd57f7c381103edc4e5vboxsync cd ./debian/builddir/bin/sdk/installer && \
c7267e77a1f8b99136cc3dd57f7c381103edc4e5vboxsync python ./vboxapisetup.py install --root $(prefix)
c7267e77a1f8b99136cc3dd57f7c381103edc4e5vboxsync rm -rf $(archdir)/sdk/installer
b32ffdb7bf463438d3ca07e4089957284c9908c7vboxsync mv $(archdir)/vboxshell.py $(prefix)/usr/lib/$(package)
aaae4f8728f4fbd3ef97b8798350ddc6abbc79f0vboxsync mv $(archdir)/sdk $(prefix)/usr/lib/$(package)
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync install -D -g 0 -o 0 -m 644 debian/VBox.sh $(prefix)/usr/bin/VBox
7e958a4329e4f9d83f597e26c72121969091e87bvboxsync mv $(archdir)/VBoxSysInfo.sh $(prefix)/usr/share/$(package)
f3f687b00a9f7c98dc0b81899090bc5f659ae7bdvboxsync for i in VBoxManage VBoxSVC $(if $(HEADLESS),,VBoxSDL) \
1deb4de12fed2ad1932401517862e6b5dc5466a3vboxsync $(if $(NOQT),,VirtualBox) VBoxHeadless \
1deb4de12fed2ad1932401517862e6b5dc5466a3vboxsync $(if $(NOWEBSVC),,vboxwebsrv webtest); do \
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync mv $(archdir)/$$i $(prefix)/usr/lib/$(package); done
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync mv $(archdir)/VBoxTunctl $(prefix)/usr/bin
8eb4989e815c8f374b965265ccf184d6ce17d9e8vboxsync $(if $(NOMODS),,for d in $(moddir)/*; do \
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync if [ -f $$d/vboxdrv.ko -a -f $$d/vboxnetflt.ko -a -f $$d/vboxnetadp.ko ]; then \
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync install -D -g 0 -o 0 -m 0644 \
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync $$d/vboxdrv.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxdrv.ko; \
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync install -D -g 0 -o 0 -m 0644 \
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync $$d/vboxnetflt.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxnetflt.ko; \
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync install -D -g 0 -o 0 -m 0644 \
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync $$d/vboxnetadp.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxnetadp.ko; \
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync fi \
a0a9f39e8864357c2e1e61106958411240f5bf6bvboxsync done)
8eb4989e815c8f374b965265ccf184d6ce17d9e8vboxsyncifeq ($(ose),)
bffb24521128f5183aafbef6542e7dacf20b5132vboxsync $(if $(NOQT),,mv $(archdir)/kchmviewer $(prefix)/usr/lib/$(package))
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync dh_installdocs \
a0a9f39e8864357c2e1e61106958411240f5bf6bvboxsync $(archdir)/UserManual*.pdf $(archdir)/VirtualBox*.chm \
a0a9f39e8864357c2e1e61106958411240f5bf6bvboxsync LICENSE
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync rm $(addprefix $(archdir)/,UserManual*.pdf VirtualBox*.chm LICENSE)
8eb4989e815c8f374b965265ccf184d6ce17d9e8vboxsync for i in rdesktop-vrdp.tar.gz additions/VBoxGuestAdditions.iso; do \
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync mv $(archdir)/$$i $(prefix)/usr/share/$(package); done
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync rmdir $(archdir)/additions
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync if [ -d $(archdir)/accessible ]; then mv $(archdir)/accessible $(prefix)/usr/lib/virtualbox; fi
ad34209dccf31d54e2277d732a90ce6ea4374362vboxsyncelse
ad34209dccf31d54e2277d732a90ce6ea4374362vboxsync dh_installdocs
8eb4989e815c8f374b965265ccf184d6ce17d9e8vboxsyncendif
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync rmdir $(archdir)
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync rmdir $(prefix)/opt
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_link \
bffb24521128f5183aafbef6542e7dacf20b5132vboxsync $(if $(NOQT),,usr/bin/VBox usr/bin/VirtualBox) \
a0a9f39e8864357c2e1e61106958411240f5bf6bvboxsync usr/bin/VBox usr/bin/VBoxManage \
a0a9f39e8864357c2e1e61106958411240f5bf6bvboxsync $(if $(HEADLESS),,usr/bin/VBox usr/bin/VBoxSDL) \
a0a9f39e8864357c2e1e61106958411240f5bf6bvboxsync $(if $(ose),,usr/bin/VBox usr/bin/VBoxVRDP) \
a0a9f39e8864357c2e1e61106958411240f5bf6bvboxsync usr/bin/VBox usr/bin/VBoxHeadless \
61ad2dd000a26df2101176cc74bd531bb18020devboxsync $(if $(NOWEBSVC),,usr/bin/VBox usr/bin/vboxwebsrv) \
a0a9f39e8864357c2e1e61106958411240f5bf6bvboxsync usr/share/virtualbox/src/vboxdrv usr/src/vboxdrv-$(ver) \
2b66a097b19f31e00af3abc508a3ff8c74ca1f8avboxsync usr/share/virtualbox/src/vboxnetflt usr/src/vboxnetflt-$(ver) \
2b66a097b19f31e00af3abc508a3ff8c74ca1f8avboxsync usr/share/virtualbox/src/vboxnetadp usr/src/vboxnetadp-$(ver)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_desktop
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_installmenu
8eb4989e815c8f374b965265ccf184d6ce17d9e8vboxsync $(if $(NOMODS),,dh_installmodules)
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync sed \
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync -e 's|%NOLSB%|$(if $(filter _Debian_sarge ucs1.3,$(debrel)),yes,)|g' \
ed5e4f6195dae44fd45ec21052b1931eb8c5d313vboxsync -e 's|%DEBIAN%|yes|g' \
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync -e 's|%PACKAGE%|virtualbox|g' \
5b802b5e11fed6e163afca32e9118d2599d312fbvboxsync src/VBox/Installer/linux/vboxdrv.sh.in > debian/vboxdrv.init
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_installinit --name=vboxdrv
bcc2356dccf06ea3fdd1f3e4d4e62b04e95673d0vboxsync cat debian/preinst.in | sed -e 's|%VER%|$(ver)|g' > debian/preinst
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync cat debian/postinst.in | sed -e 's|%VER%|$(ver)|g' > debian/postinst
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync if [ "$(debrel)" = "_Ubuntu_dapper" -o "$(debrel)" = "_Debian_sarge" ]; then \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync cat debian/postrm.dapper > debian/postrm; fi
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_installdebconf
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_installchangelogs
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_link
1deb4de12fed2ad1932401517862e6b5dc5466a3vboxsyncifeq ($(DEBUG),)
2e79d47d2d6374acf3e3c06f2bb803b149c960acvboxsync dh_strip --keep-debug --exclude=libQtCoreVBox.so.4 --exclude=libQtGuiVBox.so.4 --exclude=libQtNetworkVBox.so.4 --exclude=libQtOpenGLVBox.so.4 --exclude=libqtaccessiblewidgets.so
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync # manually strip our R0/GC modules, dh_strip cannot handle them
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync for f in \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync $(prefix)/usr/lib/$(package)/*.r0 $(prefix)/usr/lib/$(package)/*.gc; do \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync objcopy --only-keep-debug \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync $$f \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync $(prefix)/usr/lib/debug/usr/lib/$(package)/`basename $$f`; \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync strip -S --remove-section=.comment $$f; \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync objcopy --add-gnu-debuglink=$(prefix)/usr/lib/debug/usr/lib/$(package)/`basename $$f` $$f; \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync done
1deb4de12fed2ad1932401517862e6b5dc5466a3vboxsyncendif
da6747c2419b9cea8b5e2c576a30a5de999a8ab3vboxsync mkdir -p $(current)/debian/$(verpkg)-dbg/usr/lib
1deb4de12fed2ad1932401517862e6b5dc5466a3vboxsyncifeq ($(DEBUG),)
da6747c2419b9cea8b5e2c576a30a5de999a8ab3vboxsync mv $(current)/debian/$(verpkg)/usr/lib/debug $(current)/debian/$(verpkg)-dbg/usr/lib
1deb4de12fed2ad1932401517862e6b5dc5466a3vboxsyncendif
c7267e77a1f8b99136cc3dd57f7c381103edc4e5vboxsync dh_pycentral
c7267e77a1f8b99136cc3dd57f7c381103edc4e5vboxsync dh_compress -X.pdf -X.chm -X LICENSE -X.py
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_fixperms
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_makeshlibs
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_installdeb
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_perl
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_shlibdeps
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync dh_gencontrol -- \
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync -Valsa=$(if $(HEADLESS),,libasound2) \
702250abf86d6252cfbbff216d848d2c799548a4vboxsync -Vpulse=$(if $(HEADLESS),,libpulse0) \
27efd9329f6a90f7cacf840031e5305f98975960vboxsync -Vsdlttf=$(if $(HEADLESS),,libsdl-ttf2.0-0) \
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync -Vdkms=$(if $(filter _Ubuntu_gutsy _Ubuntu_hardy _Ubuntu_intrepid _Ubuntu_jaunty _Ubuntu_karmic,$(debrel)),dkms,)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync dh_md5sums
1deb4de12fed2ad1932401517862e6b5dc5466a3vboxsync dh_builddeb --destdir $(pkgdir)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncendif
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync.PHONY: binary modules binary-arch binary-indep clean checkroot