rules revision 2b66a097b19f31e00af3abc508a3ff8c74ca1f8a
181e56d8b348d301d615ccf5465ae600fee2867berikabele#!/usr/bin/make -f
181e56d8b348d301d615ccf5465ae600fee2867berikabele#
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd# Copyright (C) 2006-2008 Sun Microsystems, Inc.
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd#
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd# This file is part of VirtualBox Open Source Edition (OSE), as
252b32956857ad89fc9ee708c4c6eb36097a647cerikabele# available from http://www.virtualbox.org. This file is free software;
252b32956857ad89fc9ee708c4c6eb36097a647cerikabele# you can redistribute it and/or modify it under the terms of the GNU
252b32956857ad89fc9ee708c4c6eb36097a647cerikabele# General Public License as published by the Free Software Foundation,
5a58787efeb02a1c3f06569d019ad81fd2efa06end# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
96ad5d81ee4a2cc66a4ae19893efc8aa6d06fae7jailletc# distribution. VirtualBox OSE is distributed in the hope that it will
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim# be useful, but WITHOUT ANY WARRANTY of any kind.
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim#
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen
2e545ce2450a9953665f701bb05350f0d3f26275nd#export DH_VERBOSE=1
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowenexport DH_COMPAT=4
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim# possible overrides:
5a58787efeb02a1c3f06569d019ad81fd2efa06end# OSE=1 force VBOX_OSE
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen# NOPARALLEL=1 compile with -j1
3f08db06526d6901aa08c110b5bc7dde6bc39905nd# LINUX=<dir> compile vboxdrv against Linux found in <dir>
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim# VERBOSE=1 verbose build
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim# DEBUG=1 debug build
5a58787efeb02a1c3f06569d019ad81fd2efa06end# NOSUBVER=1 disable generation of the sub-version field (which is
3f08db06526d6901aa08c110b5bc7dde6bc39905nd# either the subversion rev [if available] or the build date)
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd# NODOCS=1 don't build docs, use precompiled UserManual.pdf and
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim# VirtualBox.chm from $HOME
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim# NOMODS=1 don't build any module
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim# NOQT=1 don't build the Qt GUI
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd# HEADLESS=1 build the headless version
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd# STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim
794694a8414fd0e0cdd534906995648ff5f3532crpluempackage := virtualbox
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjungverpkg := virtualbox-ose
3b3b7fc78d1f5bfc2769903375050048ff41ff26ndcurrent := $(shell pwd)
3b3b7fc78d1f5bfc2769903375050048ff41ff26ndvboxroot := $(shell pwd)
e50df6c711553f98103f1e0802f7de8c59be7cddslivebuilddir := $(current)/debian/builddir
e50df6c711553f98103f1e0802f7de8c59be7cddslivemoddir := $(current)/debian/modules
5a58787efeb02a1c3f06569d019ad81fd2efa06endprefix := $(current)/debian/$(verpkg)
7add1372edb1ee95a2c4d1314df4c7567bda7c62jimarch := $(shell dpkg --print-architecture)
7add1372edb1ee95a2c4d1314df4c7567bda7c62jimverfile := $(builddir)/version-generated.mk
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedoohose := 1
7add1372edb1ee95a2c4d1314df4c7567bda7c62jimNOMODS ?= $(ose)
5a58787efeb02a1c3f06569d019ad81fd2efa06endNOQT ?= $(HEADLESS)
5a58787efeb02a1c3f06569d019ad81fd2efa06end
252b32956857ad89fc9ee708c4c6eb36097a647cerikabeleifneq ($(wildcard $(verfile)),)
57d0156f7bbd9ea3a72342cf9912aba61d118702rboweninclude $(verfile)
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowenver := $(VBOX_VERSION_STRING)
e50df6c711553f98103f1e0802f7de8c59be7cddslivearchdir := $(prefix)/opt/VirtualBox-$(ver)
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowenendif
91dbfe27f56a07b53ec19068fdb47581476d5c3brbowen
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowenifneq ($(STAGEDISO),)
c220c423f3f52b735e1139bfd6509c470f0680e6wrowe ifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),)
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen $(error STAGEDISO='$(STAGEDISO)/VBoxGuestAdditions.iso' not found)
e50df6c711553f98103f1e0802f7de8c59be7cddslive endif
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowenendif
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen
9022cb0c6e36ea5146f2da78780c6b4e43064445kess# Hack: Xandros is actually Debian/sarge ... :(
91dbfe27f56a07b53ec19068fdb47581476d5c3brbowenifneq ($(wildcard /etc/xandros-desktop-version),)
9022cb0c6e36ea5146f2da78780c6b4e43064445kess debrel := _xandros4.1
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowenelse
e50df6c711553f98103f1e0802f7de8c59be7cddsliveifneq ($(wildcard /etc/univention),)
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen debrel := _ucs1.3
91dbfe27f56a07b53ec19068fdb47581476d5c3brbowenelse
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim debrel := $(if $(shell which lsb_release),_$(shell lsb_release -si)_$(shell lsb_release -sc),unknown)
3f2fa24c621652779fd6706116a35b49c6dc26candendif
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowenendif
e50df6c711553f98103f1e0802f7de8c59be7cddslive
e50df6c711553f98103f1e0802f7de8c59be7cddslivedebcfgs := VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/$(verpkg)\""
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen
91dbfe27f56a07b53ec19068fdb47581476d5c3brbowen# Ubuntu dapper: gcc-4.0 does not work with recompiler, use gcc-3.4 instead
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen# Ubuntu gutsy: gcc-4.1 does not work for the webservices, use gcc-4.2 instead
252b32956857ad89fc9ee708c4c6eb36097a647cerikabeleconfigure: debian/configure-stamp
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowendebian/configure-stamp:
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen dh_testdir
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen cd $(vboxroot) && ./configure --odir=$(current)/debian $(if \
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen $(NOQT),--disable-qt,) $(if \
91dbfe27f56a07b53ec19068fdb47581476d5c3brbowen $(ose),--ose,) $(if $(LINUX),--with-linux=$(LINUX),) $(if \
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen $(filter _Ubuntu_dapper,$(debrel)),--with-gcc=gcc-3.4 --with-g++=g++-3.4,) $(if \
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen $(filter _Ubuntu_gutsy,$(debrel)),--with-gcc=gcc-4.2 --with-g++=g++-4.2,) $(if \
f3d26cfe4b5162a4dcbff933d74798b16806548alars $(filter _xandros4.1 _ucs1.3,$(debrel)),--disable-sdl-ttf,) $(if \
f3d26cfe4b5162a4dcbff933d74798b16806548alars $(HEADLESS),--build-headless,) $(if $(DEBUG),--build-debug,)
f3d26cfe4b5162a4dcbff933d74798b16806548alars touch debian/configure-stamp
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen
91dbfe27f56a07b53ec19068fdb47581476d5c3brbowenbuild: debian/configure-stamp debian/build-stamp
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowendebian/build-stamp $(verfile):
e50df6c711553f98103f1e0802f7de8c59be7cddslive dh_testdir
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen . debian/env.sh && kmk -C $(vboxroot) $(if \
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen $(VERBOSE),--print-directory,--no-print-directory) $(if \
91dbfe27f56a07b53ec19068fdb47581476d5c3brbowen $(NOPARALLEL),-j1,) $(if \
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim $(VERBOSE),KBUILD_VERBOSE=2,) $(if \
9022cb0c6e36ea5146f2da78780c6b4e43064445kess $(NODOCS),VBOX_WITH_DOCS= ,)\
5383fa753e1bcd3a04ec34ba9810d671302380f2colm $(if $(STAGEDISO),VBOX_WITHOUT_ADDITIONS=1,) \
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen AUTOCFG=$(current)/debian/AutoConfig.kmk \
e50df6c711553f98103f1e0802f7de8c59be7cddslive LOCALCFG=$(current)/debian/LocalConfig.kmk \
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen PATH_OUT=$(current)/debian/builddir \
91dbfe27f56a07b53ec19068fdb47581476d5c3brbowen VBOX_DO_STRIP= VBOX_DO_STRIP_MODULES= \
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen $(debcfgs) \
e50df6c711553f98103f1e0802f7de8c59be7cddslive all
9022cb0c6e36ea5146f2da78780c6b4e43064445kess $(if $(NODOCS),cp $(vboxroot)/prebuild/UserManual.pdf $(builddir)/bin,)
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim $(if $(NODOCS),cp $(vboxroot)/prebuild/VirtualBox.chm $(builddir)/bin,)
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim mkdir -p $(builddir)/bin/additions
9022cb0c6e36ea5146f2da78780c6b4e43064445kess $(if $(STAGEDISO),cp $(STAGEDISO)/VBoxGuestAdditions.iso $(builddir)/bin/additions,)
e50df6c711553f98103f1e0802f7de8c59be7cddslive . debian/env.sh && kmk -C $(vboxroot) $(if \
c220c423f3f52b735e1139bfd6509c470f0680e6wrowe $(VERBOSE),--print-directory,--no-print-directory) $(if \
e50df6c711553f98103f1e0802f7de8c59be7cddslive $(VERBOSE),KBUILD_VERBOSE=2,) $(if \
c220c423f3f52b735e1139bfd6509c470f0680e6wrowe $(STAGEDISO),VBOX_WITHOUT_ADDITIONS=1,) \
9022cb0c6e36ea5146f2da78780c6b4e43064445kess AUTOCFG=$(current)/debian/AutoConfig.kmk \
9022cb0c6e36ea5146f2da78780c6b4e43064445kess LOCALCFG=$(current)/debian/LocalConfig.kmk \
c220c423f3f52b735e1139bfd6509c470f0680e6wrowe PATH_OUT=$(current)/debian/builddir \
c220c423f3f52b735e1139bfd6509c470f0680e6wrowe VBOX_DO_STRIP= VBOX_DO_STRIP_MODULES= \
e50df6c711553f98103f1e0802f7de8c59be7cddslive VBOX_NO_LINUX_RUN_INSTALLER=1 \
c220c423f3f52b735e1139bfd6509c470f0680e6wrowe $(debcfgs) \
252b32956857ad89fc9ee708c4c6eb36097a647cerikabele packing
9022cb0c6e36ea5146f2da78780c6b4e43064445kess touch debian/build-stamp
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim# Build modules for every kernel we find in /lib/modules/*
e50df6c711553f98103f1e0802f7de8c59be7cddslivemodules: debian/build-stamp debian/modules-stamp
e50df6c711553f98103f1e0802f7de8c59be7cddslivedebian/modules-stamp: debian/build-stamp
c220c423f3f52b735e1139bfd6509c470f0680e6wrowe rm -rf $(moddir)
e50df6c711553f98103f1e0802f7de8c59be7cddslive mkdir $(moddir)
c220c423f3f52b735e1139bfd6509c470f0680e6wrowe make -C $(builddir)/bin/src/vboxdrv clean
91dbfe27f56a07b53ec19068fdb47581476d5c3brbowen for d in $(wildcard /lib/modules/*); do \
252b32956857ad89fc9ee708c4c6eb36097a647cerikabele if [ -L $$d/build ]; then \
9022cb0c6e36ea5146f2da78780c6b4e43064445kess make -C $(builddir)/bin/src/vboxdrv KERN_DIR=$$d/build MODULE_DIR=$$d clean && \
c220c423f3f52b735e1139bfd6509c470f0680e6wrowe make -C $(builddir)/bin/src/vboxdrv KBUILD_VERBOSE= KERN_DIR=$$d/build MODULE_DIR=$$d all && \
9022cb0c6e36ea5146f2da78780c6b4e43064445kess install -D -m 0644 -g 0 -o 0 \
9022cb0c6e36ea5146f2da78780c6b4e43064445kess $(builddir)/bin/src/vboxdrv/vboxdrv.ko $(moddir)/$$(basename $$d)/vboxdrv.ko && \
c220c423f3f52b735e1139bfd6509c470f0680e6wrowe make -C $(builddir)/bin/src/vboxnetflt KERN_DIR=$$d/build MODULE_DIR=$$d clean && \
e50df6c711553f98103f1e0802f7de8c59be7cddslive (cp $(builddir)/bin/src/vboxdrv/Module.symvers $(builddir)/bin/src/vboxnetflt || true) && \
e50df6c711553f98103f1e0802f7de8c59be7cddslive make -C $(builddir)/bin/src/vboxnetflt KBUILD_VERBOSE= KERN_DIR=$$d/build MODULE_DIR=$$d all && \
e50df6c711553f98103f1e0802f7de8c59be7cddslive install -D -m 0644 -g 0 -o 0 \
91dbfe27f56a07b53ec19068fdb47581476d5c3brbowen $(builddir)/bin/src/vboxnetflt/vboxnetflt.ko $(moddir)/$$(basename $$d)/vboxnetflt.ko; \
e50df6c711553f98103f1e0802f7de8c59be7cddslive make -C $(builddir)/bin/src/vboxnetadp KERN_DIR=$$d/build MODULE_DIR=$$d clean && \
e50df6c711553f98103f1e0802f7de8c59be7cddslive (cp $(builddir)/bin/src/vboxdrv/Module.symvers $(builddir)/bin/src/vboxnetadp || true) && \
e50df6c711553f98103f1e0802f7de8c59be7cddslive make -C $(builddir)/bin/src/vboxnetadp KBUILD_VERBOSE= KERN_DIR=$$d/build MODULE_DIR=$$d all && \
e50df6c711553f98103f1e0802f7de8c59be7cddslive install -D -m 0644 -g 0 -o 0 \
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen $(builddir)/bin/src/vboxnetadp/vboxnetadp.ko $(moddir)/$$(basename $$d)/vboxnetadp.ko; \
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim fi; \
5a58787efeb02a1c3f06569d019ad81fd2efa06end done
5a58787efeb02a1c3f06569d019ad81fd2efa06end make -C $(builddir)/bin/src/vboxdrv clean
252b32956857ad89fc9ee708c4c6eb36097a647cerikabele make -C $(builddir)/bin/src/vboxnetflt clean
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen make -C $(builddir)/bin/src/vboxnetadp clean
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen touch debian/modules-stamp
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim
6ec3b97fc9c9f163cfaae67fc448eea3f887f34dsliveclean:
91dbfe27f56a07b53ec19068fdb47581476d5c3brbowen dh_testdir
f424f8ab092d3a97ceb8ff61144fb313d467fa41slive dh_testroot
6ec3b97fc9c9f163cfaae67fc448eea3f887f34dslive rm -f debian/$(package).init debian/vboxdrv.init
6ec3b97fc9c9f163cfaae67fc448eea3f887f34dslive rm -f debian/AutoConfig.kmk debian/configure.log debian/env.sh debian/preinst
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim rm -f debian/modules-stamp debian/build-stamp debian/configure-stamp
6ec3b97fc9c9f163cfaae67fc448eea3f887f34dslive rm -rf $(builddir) $(moddir)
91dbfe27f56a07b53ec19068fdb47581476d5c3brbowen dh_clean
6ec3b97fc9c9f163cfaae67fc448eea3f887f34dslive
6ec3b97fc9c9f163cfaae67fc448eea3f887f34dsliveifeq ($(VBOX_VERSION_MAJOR),)
6ec3b97fc9c9f163cfaae67fc448eea3f887f34dslivebinary binary-arch binary-indep: build $(verfile)
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim $(MAKE) -f debian/rules binary
e50df6c711553f98103f1e0802f7de8c59be7cddsliveelse
91dbfe27f56a07b53ec19068fdb47581476d5c3brbowen# Build architecture-dependent files here.
e50df6c711553f98103f1e0802f7de8c59be7cddslivebinary binary-arch binary-indep: build $(if $(NOMODS),,modules)
e50df6c711553f98103f1e0802f7de8c59be7cddslive dh_testdir
e50df6c711553f98103f1e0802f7de8c59be7cddslive dh_testroot
b244bbf442a0aea3dc397b4d0d751f4716c5891dnd dh_clean -k
e50df6c711553f98103f1e0802f7de8c59be7cddslive dh_installdirs
91dbfe27f56a07b53ec19068fdb47581476d5c3brbowen tar -xjC $(prefix)/opt -f $(builddir)/bin/VirtualBox.tar.bz2
e50df6c711553f98103f1e0802f7de8c59be7cddslive install -d -g 0 -o 0 $(prefix)/usr/share/applications
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim install -d -g 0 -o 0 $(prefix)/usr/lib
e50df6c711553f98103f1e0802f7de8c59be7cddslive install -d -g 0 -o 0 $(prefix)/usr/bin
e50df6c711553f98103f1e0802f7de8c59be7cddslive install -d -g 0 -o 0 $(prefix)/usr/lib/$(package)
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim install -d -g 0 -o 0 $(prefix)/usr/share/$(package)
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen install -d -g 0 -o 0 $(prefix)/usr/share/doc/$(verpkg)
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen $(if $(NOQT),,mv $(archdir)/VirtualBox.desktop \
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen $(prefix)/usr/share/applications/VirtualBox.desktop)
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen install -d -g 0 -o 0 $(prefix)/usr/share/pixmaps
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim install -d -g 0 -o 0 $(prefix)/usr/share/lintian/overrides
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen sed \
91dbfe27f56a07b53ec19068fdb47581476d5c3brbowen -e 's|%VERPKG%|$(verpkg)|g' \
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen debian/lintian-override.in > \
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen $(prefix)/usr/share/lintian/overrides/$(verpkg)
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim mv $(archdir)/VBox.png \
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen $(prefix)/usr/share/pixmaps/VBox.png
91dbfe27f56a07b53ec19068fdb47581476d5c3brbowen mv $(archdir)/*.gc $(prefix)/usr/lib/$(package)
91dbfe27f56a07b53ec19068fdb47581476d5c3brbowen mv $(archdir)/*.r0 $(prefix)/usr/lib/$(package)
91dbfe27f56a07b53ec19068fdb47581476d5c3brbowen mv $(archdir)/*.rel $(prefix)/usr/lib/$(package) || true
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen mv $(archdir)/VBoxNetDHCP $(prefix)/usr/lib/$(package)
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim mv $(archdir)/VBoxNetAdpCtl $(prefix)/usr/lib/$(package)
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen mv $(archdir)/VBoxXPCOMIPCD $(prefix)/usr/lib/$(package)
91dbfe27f56a07b53ec19068fdb47581476d5c3brbowen mv $(archdir)/components $(prefix)/usr/lib/$(package)/components
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim mv $(archdir)/*.so $(prefix)/usr/lib/$(package)
e50df6c711553f98103f1e0802f7de8c59be7cddslive mv $(archdir)/*.so.4 $(prefix)/usr/lib/$(package) || true
f424f8ab092d3a97ceb8ff61144fb313d467fa41slive $(if $(NOQT),,mv $(archdir)/nls $(prefix)/usr/share/$(package))
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim mv $(archdir)/src $(prefix)/usr/share/$(package)
f424f8ab092d3a97ceb8ff61144fb313d467fa41slive rm $(archdir)/VBox.sh
e50df6c711553f98103f1e0802f7de8c59be7cddslive install -D -g 0 -o 0 -m 644 debian/VBox.sh $(prefix)/usr/bin/VBox
e50df6c711553f98103f1e0802f7de8c59be7cddslive mv $(archdir)/VBoxSysInfo.sh $(prefix)/usr/share/$(package)
e50df6c711553f98103f1e0802f7de8c59be7cddslive for i in VBoxManage VBoxSVC $(if $(HEADLESS),,VBoxSDL) \
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim $(if $(NOQT),,VirtualBox) VBoxHeadless; do \
e50df6c711553f98103f1e0802f7de8c59be7cddslive mv $(archdir)/$$i $(prefix)/usr/lib/$(package); done
9022cb0c6e36ea5146f2da78780c6b4e43064445kess if [ -f $(archdir)/vboxwebsrv ]; then \
9022cb0c6e36ea5146f2da78780c6b4e43064445kess mv $(archdir)/vboxwebsrv $(prefix)/usr/lib/$(package); \
9022cb0c6e36ea5146f2da78780c6b4e43064445kess fi
9022cb0c6e36ea5146f2da78780c6b4e43064445kess if [ -f $(archdir)/webtest ]; then \
9022cb0c6e36ea5146f2da78780c6b4e43064445kess mv $(archdir)/webtest $(prefix)/usr/lib/$(package); \
f424f8ab092d3a97ceb8ff61144fb313d467fa41slive fi
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim mv $(archdir)/VBoxTunctl $(prefix)/usr/bin
f424f8ab092d3a97ceb8ff61144fb313d467fa41slive $(if $(NOMODS),,for d in $(moddir)/*; do \
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim install -D -g 0 -o 0 -m 0644 \
252b32956857ad89fc9ee708c4c6eb36097a647cerikabele $$d/vboxdrv.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxdrv.ko; \
252b32956857ad89fc9ee708c4c6eb36097a647cerikabele install -D -g 0 -o 0 -m 0644 \
252b32956857ad89fc9ee708c4c6eb36097a647cerikabele $$d/vboxnetflt.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxnetflt.ko; \
252b32956857ad89fc9ee708c4c6eb36097a647cerikabele install -D -g 0 -o 0 -m 0644 \
252b32956857ad89fc9ee708c4c6eb36097a647cerikabele $$d/vboxnetadp.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxnetadp.ko; \
f424f8ab092d3a97ceb8ff61144fb313d467fa41slive done)
7add1372edb1ee95a2c4d1314df4c7567bda7c62jimifeq ($(ose),)
c220c423f3f52b735e1139bfd6509c470f0680e6wrowe $(if $(NOQT),,mv $(archdir)/kchmviewer $(prefix)/usr/lib/$(package))
9022cb0c6e36ea5146f2da78780c6b4e43064445kess dh_installdocs \
c220c423f3f52b735e1139bfd6509c470f0680e6wrowe $(archdir)/UserManual*.pdf $(archdir)/VirtualBox*.chm \
c220c423f3f52b735e1139bfd6509c470f0680e6wrowe LICENSE
c220c423f3f52b735e1139bfd6509c470f0680e6wrowe rm $(addprefix $(archdir)/,UserManual*.pdf VirtualBox*.chm LICENSE)
c220c423f3f52b735e1139bfd6509c470f0680e6wrowe for i in rdesktop-vrdp.tar.gz additions/VBoxGuestAdditions.iso; do \
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim mv $(archdir)/$$i $(prefix)/usr/share/$(package); done
f424f8ab092d3a97ceb8ff61144fb313d467fa41slive rmdir $(archdir)/additions
f424f8ab092d3a97ceb8ff61144fb313d467fa41slive if [ -d $(archdir)/accessible ]; then mv $(archdir)/accessible $(prefix)/usr/lib/virtualbox; fi
f424f8ab092d3a97ceb8ff61144fb313d467fa41sliveelse
f424f8ab092d3a97ceb8ff61144fb313d467fa41slive dh_installdocs
252b32956857ad89fc9ee708c4c6eb36097a647cerikabeleendif
c220c423f3f52b735e1139bfd6509c470f0680e6wrowe rmdir $(archdir)
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim rmdir $(prefix)/opt
9022cb0c6e36ea5146f2da78780c6b4e43064445kess dh_link \
f424f8ab092d3a97ceb8ff61144fb313d467fa41slive $(if $(NOQT),,usr/bin/VBox usr/bin/VirtualBox) \
b244bbf442a0aea3dc397b4d0d751f4716c5891dnd usr/bin/VBox usr/bin/VBoxManage \
f424f8ab092d3a97ceb8ff61144fb313d467fa41slive $(if $(HEADLESS),,usr/bin/VBox usr/bin/VBoxSDL) \
01aab508f035482b2594a488aa33f570538f73bdslive $(if $(ose),,usr/bin/VBox usr/bin/VBoxVRDP) \
08e80ab3f88f4db0c0da038e00434a01e7ef061end usr/bin/VBox usr/bin/VBoxHeadless \
f424f8ab092d3a97ceb8ff61144fb313d467fa41slive $(if $(ose),,usr/bin/VBox usr/bin/vboxwebsrv) \
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen usr/share/virtualbox/src/vboxdrv usr/src/vboxdrv-$(ver) \
5a58787efeb02a1c3f06569d019ad81fd2efa06end usr/share/virtualbox/src/vboxnetflt usr/src/vboxnetflt-$(ver) \
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd usr/share/virtualbox/src/vboxnetadp usr/src/vboxnetadp-$(ver)
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim dh_desktop
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim dh_installmenu
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim $(if $(NOMODS),,dh_installmodules)
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd sed \
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd -e 's|%NOLSB%|$(if $(filter _Debian_sarge ucs1.3,$(debrel)),yes,)|g' \
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim -e 's|%PACKAGE%|virtualbox|g' \
794694a8414fd0e0cdd534906995648ff5f3532crpluem src/VBox/Installer/linux/vboxdrv.sh.in > debian/vboxdrv.init
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung dh_installinit --name=vboxdrv
727872d18412fc021f03969b8641810d8896820bhumbedooh cat debian/preinst.in | sed -e 's|%VER%|$(ver)|g' > debian/preinst
0d0ba3a410038e179b695446bb149cce6264e0abnd if [ "$(debrel)" = "_Ubuntu_dapper" -o "$(debrel)" = "_Debian_sarge" ]; then \
727872d18412fc021f03969b8641810d8896820bhumbedooh cat debian/postrm.dapper > debian/postrm; fi
cc7e1025de9ac63bd4db6fe7f71c158b2cf09fe4humbedooh dh_installdebconf
0d0ba3a410038e179b695446bb149cce6264e0abnd dh_installchangelogs
cc7e1025de9ac63bd4db6fe7f71c158b2cf09fe4humbedooh dh_link
727872d18412fc021f03969b8641810d8896820bhumbedooh dh_strip --keep-debug --exclude=libVBoxQtCore.so.4 --exclude=libVBoxQtGui.so.4 --exclude=libVBoxQtNetwork.so.4 --exclude=libqtaccessiblewidgets.so
0d0ba3a410038e179b695446bb149cce6264e0abnd # manually strip our R0/GC modules, dh_strip cannot handle them
0d0ba3a410038e179b695446bb149cce6264e0abnd for f in \
0d0ba3a410038e179b695446bb149cce6264e0abnd $(prefix)/usr/lib/$(package)/*.r0 $(prefix)/usr/lib/$(package)/*.gc; do \
ac082aefa89416cbdc9a1836eaf3bed9698201c8humbedooh objcopy --only-keep-debug \
0d0ba3a410038e179b695446bb149cce6264e0abnd $$f \
0d0ba3a410038e179b695446bb149cce6264e0abnd $(prefix)/usr/lib/debug/usr/lib/$(package)/`basename $$f`; \
0d0ba3a410038e179b695446bb149cce6264e0abnd strip -S --remove-section=.comment $$f; \
727872d18412fc021f03969b8641810d8896820bhumbedooh objcopy --add-gnu-debuglink=$(prefix)/usr/lib/debug/usr/lib/$(package)/`basename $$f` $$f; \
0d0ba3a410038e179b695446bb149cce6264e0abnd done
0d0ba3a410038e179b695446bb149cce6264e0abnd mkdir -p $(current)/debian/$(verpkg)-dbg/usr/lib
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedooh mv $(current)/debian/$(verpkg)/usr/lib/debug $(current)/debian/$(verpkg)-dbg/usr/lib
205f749042ed530040a4f0080dbcb47ceae8a374rjung dh_compress -X.pdf -X.chm -X LICENSE
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen dh_fixperms
0d0ba3a410038e179b695446bb149cce6264e0abnd dh_makeshlibs
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd dh_installdeb
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd dh_perl
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd dh_shlibdeps
5a58787efeb02a1c3f06569d019ad81fd2efa06end dh_gencontrol -- \
-Valsa=$(if $(HEADLESS),,libasound2) \
-Vpulse=$(if $(HEADLESS),,libpulse0) \
-Vsdlttf=$(if $(HEADLESS),,libsdl-ttf2.0-0) \
-Vdkms=$(if $(filter _Ubuntu_gutsy _Ubuntu_hardy _Ubuntu_intrepid _Ubuntu_jaunty,$(debrel)),dkms,)
dh_md5sums
dh_builddeb
endif
.PHONY: binary modules binary-arch binary-indep clean checkroot