rules revision 4726db8b47db329039ce8f8e13ecd2c1f696fa60
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync#export DH_VERBOSE=1
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# possible overrides:
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# OSE=1 force VBOX_OSE
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# NOPARALLEL=1 compile with -j1 (-j2 is default)
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# HEADLESS=1 build the headless version
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncose := $(if $(OSE),1,$(if $(wildcard $(vboxroot)/src/VBox/Devices/USB),,1))
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync$(error STAGEDISO='$(STAGEDISO)/VBoxGuestAdditions.iso' not found)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# Hack: Xandros is actually Debian/sarge ... :(
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncdebrel := $(if $(shell which lsb_release),_$(shell lsb_release -si)_$(shell lsb_release -sc),)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# Ubuntu dapper: gcc-4.0 does not work with recompiler, use gcc-3.4 instead
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# Debian sarge: libhal-devel 0.4.7 is too old
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync cd $(vboxroot) && ./configure --odir=$(current)/debian $(if \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(ose),--ose,) $(if $(LINUX),--with-linux=$(LINUX),) $(if \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(filter _Ubuntu_dapper,$(debrel)),--with-gcc=gcc-3.4 --with-g++=g++-3.4,) $(if \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(filter _xandros4.1 _Debian_sarge,$(debrel)),--without-hal,) $(if \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(filter _xandros4.1,$(debrel)),--build-xalan,) $(if \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(filter _xandros4.1 _ucs1.3,$(debrel)),--disable-sdl-ttf,) $(if \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(VERBOSE),--print-directory,--no-print-directory) $(if \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync VBOX_WITH_LINUX_ADDITIONS= VBOX_WITH_WIN32_ADDITIONS=,) \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(HEADLESS),LocalConfig-headless.kmk,LocalConfig.kmk) \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(NODOCS),cp $(vboxroot)/prebuild/UserManual.pdf $(builddir)/bin,)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(NODOCS),cp $(vboxroot)/prebuild/VirtualBox.chm $(builddir)/bin,)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(STAGEDISO),cp $(STAGEDISO)/VBoxGuestAdditions.iso $(builddir)/bin/additions,)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(VERBOSE),--print-directory,--no-print-directory) $(if \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync VBOX_WITH_LINUX_ADDITIONS= VBOX_WITH_WIN32_ADDITIONS=,) \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(HEADLESS),LocalConfig-headless.kmk,LocalConfig.kmk) \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# Build modules for every kernel we find in /lib/modules/*
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync make -C $(builddir)/bin/src KERN_DIR=$$d/build MODULE_DIR=$$d clean all && \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(builddir)/bin/src/vboxdrv.ko $(moddir)/$$(basename $$d)/vboxdrv.ko; \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync rm -f debian/AutoConfig.kmk debian/configure.log debian/env.sh
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# Build architecture-dependent files here.
17a9bf5bda28580b3163cf1e2fb8b13c356b5fb0vboxsyncbinary binary-arch binary-indep: build $(if $(ose),,modules)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync tar -xjC $(prefix)/opt -f $(builddir)/bin/VirtualBox.tar.bz2
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync install -d -g 0 -o 0 $(prefix)/usr/share/applications
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync install -d -g 0 -o 0 $(prefix)/usr/share/virtualbox
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(HEADLESS),,mv $(prefix)/opt/VirtualBox-$(ver)/VirtualBox.desktop \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(prefix)/usr/share/applications/VirtualBox.desktop)
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync install -D -g 0 -o 0 -m 644 debian/lintian-override \
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync debian/virtualbox/usr/share/lintian/overrides/virtualbox
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync mv $(prefix)/opt/VirtualBox-$(ver)/*.gc $(prefix)/usr/lib/virtualbox
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync mv $(prefix)/opt/VirtualBox-$(ver)/*.r0 $(prefix)/usr/lib/virtualbox
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync mv $(prefix)/opt/VirtualBox-$(ver)/VBoxXPCOMIPCD $(prefix)/usr/lib/virtualbox
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync mv $(prefix)/opt/VirtualBox-$(ver)/components $(prefix)/usr/lib/virtualbox/components
4726db8b47db329039ce8f8e13ecd2c1f696fa60vboxsync mv $(prefix)/opt/VirtualBox-$(ver)/*.so $(prefix)/usr/lib
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync mv $(prefix)/opt/VirtualBox-$(ver)/sdk $(prefix)/usr/share/virtualbox
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync mv $(prefix)/opt/VirtualBox-$(ver)/nls $(prefix)/usr/share/virtualbox
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync mv $(prefix)/opt/VirtualBox-$(ver)/src $(prefix)/usr/share/virtualbox
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync install -D -g 0 -o 0 -m 644 debian/VBox.sh $(prefix)/usr/bin/VBox
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync mv $(prefix)/opt/VirtualBox-$(ver)/VBoxAddIF.sh $(prefix)/usr/bin/VBoxTAP
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync $(if $(HEADLESS),,VirtualBox) $(if $(ose),,VBoxVRDP); do \
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync mv $(prefix)/opt/VirtualBox-$(ver)/$$i $(prefix)/usr/lib/virtualbox/$$i; done
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync mv $(prefix)/opt/VirtualBox-$(ver)/VBoxSVC $(prefix)/usr/lib/virtualbox
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync mv $(prefix)/opt/VirtualBox-$(ver)/tstVMM $(prefix)/usr/lib/virtualbox
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync install -D -g 0 -o 0 -m 0644 \
17a9bf5bda28580b3163cf1e2fb8b13c356b5fb0vboxsync $$d/vboxdrv.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxdrv.ko; done)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync mv $(prefix)/opt/VirtualBox-$(ver)/VBoxTunctl $(prefix)/usr/bin
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync $(if $(HEADLESS),,usr/bin/VBox usr/bin/VirtualBox) \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync sed -e 's|%NOLSB%|$(if $(filter _Debian_sarge ucs1.3,$(debrel)),yes,)|g;' \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# sed -e 's|%NOLSB%|$(if $(filter _Debian_sarge,$(debrel)),yes,)|g;' \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# dh_installinit --name=vboxnet
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync if [ "$(debrel)" = "_Ubuntu_dapper" -o "$(debrel)" = "_Debian_sarge" ]; then \