rules revision 03e380b03da26ad4a2309190f35ba86843d3d824
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny#!/usr/bin/make -f
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny#
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny# Copyright (C) 2006-2008 Sun Microsystems, Inc.
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny#
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny# This file is part of VirtualBox Open Source Edition (OSE), as
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny# available from http://www.virtualbox.org. This file is free software;
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny# you can redistribute it and/or modify it under the terms of the GNU
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny# General Public License as published by the Free Software Foundation,
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny# distribution. VirtualBox OSE is distributed in the hope that it will
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny# be useful, but WITHOUT ANY WARRANTY of any kind.
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny#
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny#export DH_VERBOSE=1
f26c954658dfd7461f290f0b5d924951a6db219aJan Zelenyexport DH_COMPAT=4
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny# possible overrides:
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny# OSE=1 force VBOX_OSE
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny# NOPARALLEL=1 compile with -j1
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny# LINUX=<dir> compile vboxdrv against Linux found in <dir>
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny# VERBOSE=1 verbose build
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny# DEBUG=1 debug build
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny# NOSUBVER=1 disable generation of the sub-version field (which is
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny# either the subversion rev [if available] or the build date)
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny# NODOCS=1 don't build docs, use precompiled UserManual.pdf and
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny# VirtualBox.chm from $HOME
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny# NOMODS=1 don't build any module
58d02e0d3d6d48c97fccdb2ad7212e065671ad6dStephen Gallagher# HEADLESS=1 build the headless version
fae99bfe4bfc8b4a12e9c2a0ad01b3684c22f934Simo Sorce# STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny
f26c954658dfd7461f290f0b5d924951a6db219aJan Zelenypackage := virtualbox
d81d8d3dc151ebc95cd0e3f3b14c1cdaa48980f1Sumit Boseverpkg := virtualbox-ose
d81d8d3dc151ebc95cd0e3f3b14c1cdaa48980f1Sumit Bosecurrent := $(shell pwd)
d81d8d3dc151ebc95cd0e3f3b14c1cdaa48980f1Sumit Bosevboxroot := $(shell pwd)
d81d8d3dc151ebc95cd0e3f3b14c1cdaa48980f1Sumit Bosebuilddir := $(current)/debian/builddir
d81d8d3dc151ebc95cd0e3f3b14c1cdaa48980f1Sumit Bosemoddir := $(current)/debian/modules
d81d8d3dc151ebc95cd0e3f3b14c1cdaa48980f1Sumit Boseprefix := $(current)/debian/$(verpkg)
f26c954658dfd7461f290f0b5d924951a6db219aJan Zelenyarch := $(shell dpkg --print-architecture)
f26c954658dfd7461f290f0b5d924951a6db219aJan Zelenyverfile := $(builddir)/version-generated.mk
f26c954658dfd7461f290f0b5d924951a6db219aJan Zelenyose := 1
f26c954658dfd7461f290f0b5d924951a6db219aJan ZelenyNOMODS ?= $(ose)
bfd59d1a2d0d45125e5164ef12c425690d519f61Jakub Hrozek
f26c954658dfd7461f290f0b5d924951a6db219aJan Zelenyifneq ($(wildcard $(verfile)),)
108db0e3b9e06e530364ef8228634f5e3f6bd3b5Jakub Hrozekinclude $(verfile)
f26c954658dfd7461f290f0b5d924951a6db219aJan Zelenyver := $(VBOX_VERSION_STRING)
f26c954658dfd7461f290f0b5d924951a6db219aJan Zelenyarchdir := $(prefix)/opt/VirtualBox-$(ver)
f26c954658dfd7461f290f0b5d924951a6db219aJan Zelenyendif
21d485184df986e1a123f70c689517386e51a5ceMichal Zidek
f26c954658dfd7461f290f0b5d924951a6db219aJan Zelenyifneq ($(STAGEDISO),)
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny ifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),)
684d1b48b5582a1bf7812b8c3c663592dc6dfed9Pavel Březina $(error STAGEDISO='$(STAGEDISO)/VBoxGuestAdditions.iso' not found)
75dd4b05e1dacc76dc9d5f16be31978f84a71dc5Sumit Bose endif
b56b06e199f15a8a840b36bc7cb8010e39ae761dSumit Boseendif
b9fbeb75e7a4f50f98d979a70a710f9221892483Lukas Slebodnik
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny# Hack: Xandros is actually Debian/sarge ... :(
f26c954658dfd7461f290f0b5d924951a6db219aJan Zelenyifneq ($(wildcard /etc/xandros-desktop-version),)
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny debrel := _xandros4.1
f26c954658dfd7461f290f0b5d924951a6db219aJan Zelenyelse
f26c954658dfd7461f290f0b5d924951a6db219aJan Zelenyifneq ($(wildcard /etc/univention),)
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny debrel := _ucs1.3
f26c954658dfd7461f290f0b5d924951a6db219aJan Zelenyelse
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny debrel := $(if $(shell which lsb_release),_$(shell lsb_release -si)_$(shell lsb_release -sc),unknown)
f26c954658dfd7461f290f0b5d924951a6db219aJan Zelenyendif
f26c954658dfd7461f290f0b5d924951a6db219aJan Zelenyendif
21d485184df986e1a123f70c689517386e51a5ceMichal Zidek
f26c954658dfd7461f290f0b5d924951a6db219aJan Zelenygccver := $(subst ., ,$(shell gcc -dumpversion))
f26c954658dfd7461f290f0b5d924951a6db219aJan Zelenygccvmaj := $(word 1,$(gccver))
f26c954658dfd7461f290f0b5d924951a6db219aJan Zelenygccvmin := $(word 2,$(gccver))
f26c954658dfd7461f290f0b5d924951a6db219aJan Zelenydebcfgs := VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/$(verpkg)\""
e0243c7f3638c819051b7235097a0bb2d06374fbJakub Hrozek
4c08db0fb0dda3d27b1184248ca5c800d7ce23f0Michal Zidek# Ubuntu dapper: gcc-4.0 does not work with recompiler, use gcc-3.4 instead
f26c954658dfd7461f290f0b5d924951a6db219aJan Zelenyconfigure: debian/configure-stamp
f26c954658dfd7461f290f0b5d924951a6db219aJan Zelenydebian/configure-stamp:
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny dh_testdir
e0243c7f3638c819051b7235097a0bb2d06374fbJakub Hrozek cd $(vboxroot) && ./configure --odir=$(current)/debian --disable-qt3 $(if \
83bf46f4066e3d5e838a32357c201de9bd6ecdfdNikolai Kondrashov $(ose),--ose,) $(if $(LINUX),--with-linux=$(LINUX),) $(if \
15b5d885e28afcd6c3c19f900eea2a8e00c3e6d3Sumit Bose $(filter _Ubuntu_dapper,$(debrel)),--with-gcc=gcc-3.4 --with-g++=g++-3.4,) $(if \
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov $(shell test $(gccvmaj) -eq 4 -a $(gccvmin) -gt 2 -o $(gccvmaj) -gt 4 && echo "yes"),--with-gcc=gcc-4.2 --with-g++=g++-4.2,) $(if \
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny $(filter _xandros4.1 _ucs1.3,$(debrel)),--disable-sdl-ttf,) $(if \
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny $(HEADLESS),--build-headless,) $(if $(DEBUG),--build-debug,)
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny touch debian/configure-stamp
83bf46f4066e3d5e838a32357c201de9bd6ecdfdNikolai Kondrashov
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashovbuild: debian/configure-stamp debian/build-stamp
21d485184df986e1a123f70c689517386e51a5ceMichal Zidekdebian/build-stamp $(verfile):
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny dh_testdir
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny . debian/env.sh && kmk -C $(vboxroot) $(if \
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny $(VERBOSE),--print-directory,--no-print-directory) $(if \
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny $(NOPARALLEL),-j1,) $(if \
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny $(VERBOSE),KBUILD_VERBOSE=2,) $(if \
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny $(NODOCS),VBOX_WITH_DOCS= ,)\
326f4fc3125e155ee2d484fe921aafddd6b5a49dPavel Březina $(if $(STAGEDISO),VBOX_WITHOUT_ADDITIONS=1,) \
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny AUTOCFG=$(current)/debian/AutoConfig.kmk \
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny LOCALCFG=$(current)/debian/LocalConfig.kmk \
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny PATH_OUT=$(current)/debian/builddir \
b56b06e199f15a8a840b36bc7cb8010e39ae761dSumit Bose VBOX_DO_STRIP= VBOX_DO_STRIP_MODULES= \
fdda4b659fa3be3027df91a2b053835186ec2c59Sumit Bose $(debcfgs) \
b56b06e199f15a8a840b36bc7cb8010e39ae761dSumit Bose all
b56b06e199f15a8a840b36bc7cb8010e39ae761dSumit Bose $(if $(NODOCS),cp $(vboxroot)/prebuild/UserManual.pdf $(builddir)/bin,)
21d485184df986e1a123f70c689517386e51a5ceMichal Zidek $(if $(NODOCS),cp $(vboxroot)/prebuild/VirtualBox.chm $(builddir)/bin,)
21d485184df986e1a123f70c689517386e51a5ceMichal Zidek mkdir -p $(builddir)/bin/additions
21d485184df986e1a123f70c689517386e51a5ceMichal Zidek $(if $(STAGEDISO),cp $(STAGEDISO)/VBoxGuestAdditions.iso $(builddir)/bin/additions,)
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov . debian/env.sh && kmk -C $(vboxroot) $(if \
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov $(VERBOSE),--print-directory,--no-print-directory) $(if \
21d485184df986e1a123f70c689517386e51a5ceMichal Zidek $(VERBOSE),KBUILD_VERBOSE=2,) $(if \
21d485184df986e1a123f70c689517386e51a5ceMichal Zidek $(STAGEDISO),VBOX_WITHOUT_ADDITIONS=1,) \
21d485184df986e1a123f70c689517386e51a5ceMichal Zidek AUTOCFG=$(current)/debian/AutoConfig.kmk \
21d485184df986e1a123f70c689517386e51a5ceMichal Zidek LOCALCFG=$(current)/debian/LocalConfig.kmk \
21d485184df986e1a123f70c689517386e51a5ceMichal Zidek PATH_OUT=$(current)/debian/builddir \
684d1b48b5582a1bf7812b8c3c663592dc6dfed9Pavel Březina VBOX_DO_STRIP= VBOX_DO_STRIP_MODULES= \
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny VBOX_NO_LINUX_RUN_INSTALLER=1 \
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny $(debcfgs) \
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny packing
bfd59d1a2d0d45125e5164ef12c425690d519f61Jakub Hrozek touch debian/build-stamp
bfd59d1a2d0d45125e5164ef12c425690d519f61Jakub Hrozek
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny# Build modules for every kernel we find in /lib/modules/*
bfd59d1a2d0d45125e5164ef12c425690d519f61Jakub Hrozekmodules: debian/build-stamp debian/modules-stamp
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashovdebian/modules-stamp: debian/build-stamp
21d485184df986e1a123f70c689517386e51a5ceMichal Zidek rm -rf $(moddir)
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny mkdir $(moddir)
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny make -C $(builddir)/bin/src/vboxdrv clean
bfd59d1a2d0d45125e5164ef12c425690d519f61Jakub Hrozek for d in $(wildcard /lib/modules/*); do \
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny if [ -L $$d/build ]; then \
58d02e0d3d6d48c97fccdb2ad7212e065671ad6dStephen Gallagher make -C $(builddir)/bin/src/vboxdrv KERN_DIR=$$d/build MODULE_DIR=$$d clean && \
75dd4b05e1dacc76dc9d5f16be31978f84a71dc5Sumit Bose make -C $(builddir)/bin/src/vboxdrv KBUILD_VERBOSE= KERN_DIR=$$d/build MODULE_DIR=$$d all && \
75dd4b05e1dacc76dc9d5f16be31978f84a71dc5Sumit Bose install -D -m 0644 -g 0 -o 0 \
75dd4b05e1dacc76dc9d5f16be31978f84a71dc5Sumit Bose $(builddir)/bin/src/vboxdrv/vboxdrv.ko $(moddir)/$$(basename $$d)/vboxdrv.ko && \
75dd4b05e1dacc76dc9d5f16be31978f84a71dc5Sumit Bose make -C $(builddir)/bin/src/vboxnetflt KERN_DIR=$$d/build MODULE_DIR=$$d clean && \
75dd4b05e1dacc76dc9d5f16be31978f84a71dc5Sumit Bose (cp $(builddir)/bin/src/vboxdrv/Module.symvers $(builddir)/bin/src/vboxnetflt || true) && \
75dd4b05e1dacc76dc9d5f16be31978f84a71dc5Sumit Bose make -C $(builddir)/bin/src/vboxnetflt KBUILD_VERBOSE= KERN_DIR=$$d/build MODULE_DIR=$$d all && \
58d02e0d3d6d48c97fccdb2ad7212e065671ad6dStephen Gallagher install -D -m 0644 -g 0 -o 0 \
75dd4b05e1dacc76dc9d5f16be31978f84a71dc5Sumit Bose $(builddir)/bin/src/vboxnetflt/vboxnetflt.ko $(moddir)/$$(basename $$d)/vboxnetflt.ko; \
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov fi; \
75dd4b05e1dacc76dc9d5f16be31978f84a71dc5Sumit Bose done
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov make -C $(builddir)/bin/src/vboxdrv clean
75dd4b05e1dacc76dc9d5f16be31978f84a71dc5Sumit Bose make -C $(builddir)/bin/src/vboxnetflt clean
75dd4b05e1dacc76dc9d5f16be31978f84a71dc5Sumit Bose touch debian/modules-stamp
75dd4b05e1dacc76dc9d5f16be31978f84a71dc5Sumit Bose
75dd4b05e1dacc76dc9d5f16be31978f84a71dc5Sumit Boseclean:
58d02e0d3d6d48c97fccdb2ad7212e065671ad6dStephen Gallagher dh_testdir
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov dh_testroot
58d02e0d3d6d48c97fccdb2ad7212e065671ad6dStephen Gallagher rm -f debian/$(package).init debian/vboxdrv.init
58d02e0d3d6d48c97fccdb2ad7212e065671ad6dStephen Gallagher rm -f debian/AutoConfig.kmk debian/configure.log debian/env.sh debian/preinst
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov rm -f debian/modules-stamp debian/build-stamp debian/configure-stamp
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov rm -rf $(builddir) $(moddir)
58d02e0d3d6d48c97fccdb2ad7212e065671ad6dStephen Gallagher dh_clean
58d02e0d3d6d48c97fccdb2ad7212e065671ad6dStephen Gallagher
8be5e4497e5008f7807178acdfcbf97365ec4e73Stephen Gallagherifeq ($(VBOX_VERSION_MAJOR),)
8be5e4497e5008f7807178acdfcbf97365ec4e73Stephen Gallagherbinary binary-arch binary-indep: build $(verfile)
c20a339d54b39120b4051f690ca759e6d079f177Stephen Gallagher $(MAKE) -f debian/rules binary
c20a339d54b39120b4051f690ca759e6d079f177Stephen Gallagherelse
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov# Build architecture-dependent files here.
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashovbinary binary-arch binary-indep: build $(if $(NOMODS),,modules)
c20a339d54b39120b4051f690ca759e6d079f177Stephen Gallagher dh_testdir
c20a339d54b39120b4051f690ca759e6d079f177Stephen Gallagher dh_testroot
c20a339d54b39120b4051f690ca759e6d079f177Stephen Gallagher dh_clean -k
c20a339d54b39120b4051f690ca759e6d079f177Stephen Gallagher dh_installdirs
c20a339d54b39120b4051f690ca759e6d079f177Stephen Gallagher tar -xjC $(prefix)/opt -f $(builddir)/bin/VirtualBox.tar.bz2
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov install -d -g 0 -o 0 $(prefix)/usr/share/applications
c20a339d54b39120b4051f690ca759e6d079f177Stephen Gallagher install -d -g 0 -o 0 $(prefix)/usr/lib
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov install -d -g 0 -o 0 $(prefix)/usr/bin
58d02e0d3d6d48c97fccdb2ad7212e065671ad6dStephen Gallagher install -d -g 0 -o 0 $(prefix)/usr/lib/$(package)
58d02e0d3d6d48c97fccdb2ad7212e065671ad6dStephen Gallagher install -d -g 0 -o 0 $(prefix)/usr/share/$(package)
58d02e0d3d6d48c97fccdb2ad7212e065671ad6dStephen Gallagher install -d -g 0 -o 0 $(prefix)/usr/share/doc/$(verpkg)
58d02e0d3d6d48c97fccdb2ad7212e065671ad6dStephen Gallagher $(if $(HEADLESS),,mv $(archdir)/VirtualBox.desktop \
58d02e0d3d6d48c97fccdb2ad7212e065671ad6dStephen Gallagher $(prefix)/usr/share/applications/VirtualBox.desktop)
58d02e0d3d6d48c97fccdb2ad7212e065671ad6dStephen Gallagher install -d -g 0 -o 0 $(prefix)/usr/share/pixmaps
58d02e0d3d6d48c97fccdb2ad7212e065671ad6dStephen Gallagher install -D -g 0 -o 0 -m 644 debian/lintian-override \
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov $(prefix)/usr/share/lintian/overrides/$(package)
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov mv $(archdir)/VBox.png \
bfd59d1a2d0d45125e5164ef12c425690d519f61Jakub Hrozek $(prefix)/usr/share/pixmaps/VBox.png
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov mv $(archdir)/*.gc $(prefix)/usr/lib/$(package)
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov mv $(archdir)/*.r0 $(prefix)/usr/lib/$(package)
58d02e0d3d6d48c97fccdb2ad7212e065671ad6dStephen Gallagher $(if $(filter amd64,$(arch)),\
58d02e0d3d6d48c97fccdb2ad7212e065671ad6dStephen Gallagher mv $(archdir)/VBoxREM2.rel $(prefix)/usr/lib/$(package),)
58d02e0d3d6d48c97fccdb2ad7212e065671ad6dStephen Gallagher mv $(archdir)/VBoxXPCOMIPCD $(prefix)/usr/lib/$(package)
83bf46f4066e3d5e838a32357c201de9bd6ecdfdNikolai Kondrashov mv $(archdir)/components $(prefix)/usr/lib/$(package)/components
83bf46f4066e3d5e838a32357c201de9bd6ecdfdNikolai Kondrashov mv $(archdir)/*.so $(prefix)/usr/lib/$(package)
21d485184df986e1a123f70c689517386e51a5ceMichal Zidek mv $(archdir)/*.so.4 $(prefix)/usr/lib/$(package) || true
58d02e0d3d6d48c97fccdb2ad7212e065671ad6dStephen Gallagher $(if $(HEADLESS),,mv $(archdir)/nls $(prefix)/usr/share/$(package))
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny mv $(archdir)/src $(prefix)/usr/share/$(package)
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny rm $(archdir)/VBox.sh
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny install -D -g 0 -o 0 -m 644 debian/VBox.sh $(prefix)/usr/bin/VBox
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny mv $(archdir)/VBoxSysInfo.sh $(prefix)/usr/share/$(package)
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny for i in VBoxManage VBoxSVC $(if $(HEADLESS),,VBoxSDL) \
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny $(if $(HEADLESS),,VirtualBox) $(if $(ose),,VBoxVRDP) \
83bf46f4066e3d5e838a32357c201de9bd6ecdfdNikolai Kondrashov VBoxHeadless; do \
108db0e3b9e06e530364ef8228634f5e3f6bd3b5Jakub Hrozek mv $(archdir)/$$i $(prefix)/usr/lib/$(package); done
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny mv $(archdir)/VBoxTunctl $(prefix)/usr/bin
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny $(if $(NOMODS),,for d in $(moddir)/*; do \
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny install -D -g 0 -o 0 -m 0644 \
1d93029624d708119bbf803e6647a2cbb271f001Sumit Bose $$d/vboxdrv.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxdrv.ko; \
1d93029624d708119bbf803e6647a2cbb271f001Sumit Bose install -D -g 0 -o 0 -m 0644 \
1d93029624d708119bbf803e6647a2cbb271f001Sumit Bose $$d/vboxnetflt.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxnetflt.ko; \
1d93029624d708119bbf803e6647a2cbb271f001Sumit Bose done)
1d93029624d708119bbf803e6647a2cbb271f001Sumit Boseifeq ($(ose),)
56e88cd5f3501566778b138e4934ee8e7f3fa674Lukas Slebodnik $(if $(HEADLESS),,mv $(archdir)/kchmviewer $(prefix)/usr/lib/$(package))
56e88cd5f3501566778b138e4934ee8e7f3fa674Lukas Slebodnik dh_installdocs \
56e88cd5f3501566778b138e4934ee8e7f3fa674Lukas Slebodnik $(archdir)/UserManual*.pdf $(archdir)/VirtualBox*.chm \
56e88cd5f3501566778b138e4934ee8e7f3fa674Lukas Slebodnik LICENSE
56e88cd5f3501566778b138e4934ee8e7f3fa674Lukas Slebodnik rm $(addprefix $(archdir)/,UserManual*.pdf VirtualBox*.chm LICENSE)
56e88cd5f3501566778b138e4934ee8e7f3fa674Lukas Slebodnik for i in rdesktop-vrdp.tar.gz additions/VBoxGuestAdditions.iso; do \
108db0e3b9e06e530364ef8228634f5e3f6bd3b5Jakub Hrozek mv $(archdir)/$$i $(prefix)/usr/share/$(package); done
1d93029624d708119bbf803e6647a2cbb271f001Sumit Bose rmdir $(archdir)/additions
108db0e3b9e06e530364ef8228634f5e3f6bd3b5Jakub Hrozek if [ -d $(archdir)/accessible ]; then mv $(archdir)/accessible $(prefix)/usr/lib/virtualbox; fi
108db0e3b9e06e530364ef8228634f5e3f6bd3b5Jakub Hrozekelse
108db0e3b9e06e530364ef8228634f5e3f6bd3b5Jakub Hrozek dh_installdocs
108db0e3b9e06e530364ef8228634f5e3f6bd3b5Jakub Hrozekendif
108db0e3b9e06e530364ef8228634f5e3f6bd3b5Jakub Hrozek rmdir $(archdir)
108db0e3b9e06e530364ef8228634f5e3f6bd3b5Jakub Hrozek rmdir $(prefix)/opt
108db0e3b9e06e530364ef8228634f5e3f6bd3b5Jakub Hrozek dh_link \
b9fbeb75e7a4f50f98d979a70a710f9221892483Lukas Slebodnik $(if $(HEADLESS),,usr/bin/VBox usr/bin/VirtualBox) \
b9fbeb75e7a4f50f98d979a70a710f9221892483Lukas Slebodnik usr/bin/VBox usr/bin/VBoxManage \
b9fbeb75e7a4f50f98d979a70a710f9221892483Lukas Slebodnik $(if $(HEADLESS),,usr/bin/VBox usr/bin/VBoxSDL) \
b9fbeb75e7a4f50f98d979a70a710f9221892483Lukas Slebodnik $(if $(ose),,usr/bin/VBox usr/bin/VBoxVRDP) \
b9fbeb75e7a4f50f98d979a70a710f9221892483Lukas Slebodnik usr/bin/VBox usr/bin/VBoxHeadless \
b9fbeb75e7a4f50f98d979a70a710f9221892483Lukas Slebodnik usr/share/virtualbox/src/vboxdrv usr/src/vboxdrv-$(ver) \
b9fbeb75e7a4f50f98d979a70a710f9221892483Lukas Slebodnik usr/share/virtualbox/src/vboxnetflt usr/src/vboxnetflt-$(ver)
b9fbeb75e7a4f50f98d979a70a710f9221892483Lukas Slebodnik dh_desktop
b9fbeb75e7a4f50f98d979a70a710f9221892483Lukas Slebodnik dh_installmenu
b9fbeb75e7a4f50f98d979a70a710f9221892483Lukas Slebodnik $(if $(NOMODS),,dh_installmodules)
b9fbeb75e7a4f50f98d979a70a710f9221892483Lukas Slebodnik sed \
bfd59d1a2d0d45125e5164ef12c425690d519f61Jakub Hrozek -e 's|%NOLSB%|$(if $(filter _Debian_sarge ucs1.3,$(debrel)),yes,)|g' \
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov -e 's|%PACKAGE%|virtualbox|g' \
d115f40c7a3999e3cbe705a2ff9cf0fd493f80fbMichal Zidek src/VBox/Installer/linux/vboxdrv.sh.in > debian/vboxdrv.init
108db0e3b9e06e530364ef8228634f5e3f6bd3b5Jakub Hrozek dh_installinit --name=vboxdrv
108db0e3b9e06e530364ef8228634f5e3f6bd3b5Jakub Hrozek cat debian/preinst.in | sed -e 's|%VER%|$(ver)|g' > debian/preinst
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny if [ "$(debrel)" = "_Ubuntu_dapper" -o "$(debrel)" = "_Debian_sarge" ]; then \
21d485184df986e1a123f70c689517386e51a5ceMichal Zidek cat debian/postrm.dapper > debian/postrm; fi
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny dh_installdebconf
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny dh_installchangelogs
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny dh_link
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny dh_strip --keep-debug --exclude=libVBoxQtCore.so.4 --exclude=libVBoxQtGui.so.4 --exclude=libVBoxQtNetwork.so.4 --exclude=libqtaccessiblewidgets.so
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny # manually strip our R0/GC modules, dh_strip cannot handle them
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny for f in \
83bf46f4066e3d5e838a32357c201de9bd6ecdfdNikolai Kondrashov $(prefix)/usr/lib/$(package)/*.r0 $(prefix)/usr/lib/$(package)/*.gc; do \
83bf46f4066e3d5e838a32357c201de9bd6ecdfdNikolai Kondrashov objcopy --only-keep-debug \
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny $$f \
21d485184df986e1a123f70c689517386e51a5ceMichal Zidek $(prefix)/usr/lib/debug/usr/lib/$(package)/`basename $$f`; \
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny strip -S --remove-section=.comment $$f; \
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny objcopy --add-gnu-debuglink=$(prefix)/usr/lib/debug/usr/lib/$(package)/`basename $$f` $$f; \
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny done
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny mkdir -p $(current)/debian/$(verpkg)-dbg/usr/lib
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny mv $(current)/debian/$(verpkg)/usr/lib/debug $(current)/debian/$(verpkg)-dbg/usr/lib
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov dh_compress -X.pdf -X.chm -X LICENSE
21d485184df986e1a123f70c689517386e51a5ceMichal Zidek dh_fixperms
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny dh_makeshlibs
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny dh_installdeb
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny dh_perl
21d485184df986e1a123f70c689517386e51a5ceMichal Zidek dh_shlibdeps
21d485184df986e1a123f70c689517386e51a5ceMichal Zidek dh_gencontrol -- \
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny -Valsa=$(if $(HEADLESS),,libasound2) \
21d485184df986e1a123f70c689517386e51a5ceMichal Zidek -Vpulse=$(if $(HEADLESS),,libpulse0) \
21d485184df986e1a123f70c689517386e51a5ceMichal Zidek -Vsdlttf=$(if $(HEADLESS),,libsdl-ttf2.0-0) \
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov -Vdkms=$(if $(filter _Ubuntu_gutsy _Ubuntu_hardy _Ubuntu_intrepid,$(debrel)),dkms,)
21d485184df986e1a123f70c689517386e51a5ceMichal Zidek dh_md5sums
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny dh_builddeb
e30d02c04efad31f97c35165a92105852c805d34Jakub Hrozekendif
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny.PHONY: binary modules binary-arch binary-indep clean checkroot
f26c954658dfd7461f290f0b5d924951a6db219aJan Zeleny