rules revision bbfc28b1a00ce00001b2ead074d47254bec3e5cf
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
8eb4989e815c8f374b965265ccf184d6ce17d9e8vboxsync# NOMODS=1 don't build any module
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 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,$(debrel)),--build-xalan,) $(if \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(filter _xandros4.1 _ucs1.3,$(debrel)),--disable-sdl-ttf,) $(if \
ad34209dccf31d54e2277d732a90ce6ea4374362vboxsync $(HEADLESS),--build-headless,) $(if $(DEBUG),--build-debug,)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(VERBOSE),--print-directory,--no-print-directory) $(if \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync VBOX_WITH_LINUX_ADDITIONS= VBOX_WITH_WIN32_ADDITIONS=,) \
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# 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
69f57565f5243a46f1df060b63d0fd830de3be04vboxsync rm -f debian/modules-stamp debian/build-stamp debian/configure-stamp
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# Build architecture-dependent files here.
8eb4989e815c8f374b965265ccf184d6ce17d9e8vboxsyncbinary binary-arch binary-indep: build $(if $(NOMODS),,modules)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync tar -xjC $(prefix)/opt -f $(builddir)/bin/VirtualBox.tar.bz2
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync install -d -g 0 -o 0 $(prefix)/usr/share/applications
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync install -d -g 0 -o 0 $(prefix)/usr/share/$(package)
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync install -d -g 0 -o 0 $(prefix)/usr/share/doc/$(package)
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 \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync mv $(prefix)/opt/VirtualBox-$(ver)/*.gc $(prefix)/usr/lib/$(package)
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync mv $(prefix)/opt/VirtualBox-$(ver)/*.r0 $(prefix)/usr/lib/$(package)
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync mv $(prefix)/opt/VirtualBox-$(ver)/VBoxREM2.rel $(prefix)/usr/lib/$(package),)
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync mv $(prefix)/opt/VirtualBox-$(ver)/VBoxXPCOMIPCD $(prefix)/usr/lib/$(package)
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync mv $(prefix)/opt/VirtualBox-$(ver)/components $(prefix)/usr/lib/$(package)/components
4726db8b47db329039ce8f8e13ecd2c1f696fa60vboxsync mv $(prefix)/opt/VirtualBox-$(ver)/*.so $(prefix)/usr/lib
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync mv $(prefix)/opt/VirtualBox-$(ver)/sdk $(prefix)/usr/share/$(package)
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync $(if $(HEADLESS),,mv $(prefix)/opt/VirtualBox-$(ver)/nls $(prefix)/usr/share/$(package))
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync mv $(prefix)/opt/VirtualBox-$(ver)/src $(prefix)/usr/share/$(package)
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
dbfd74deae3cf437ea7b2ee06a74cc65a0901eacvboxsync for i in VBoxManage VBoxSVC tstVMM $(if $(HEADLESS),,VBoxSDL) \
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync $(if $(HEADLESS),,VirtualBox) $(if $(ose),,VBoxVRDP); do \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync mv $(prefix)/opt/VirtualBox-$(ver)/$$i $(prefix)/usr/lib/$(package); done
8eb4989e815c8f374b965265ccf184d6ce17d9e8vboxsync mv $(prefix)/opt/VirtualBox-$(ver)/VBoxTunctl $(prefix)/usr/bin
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync install -D -g 0 -o 0 -m 0644 \
17a9bf5bda28580b3163cf1e2fb8b13c356b5fb0vboxsync $$d/vboxdrv.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxdrv.ko; done)
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync $(if $(HEADLESS),,mv $(prefix)/opt/VirtualBox-$(ver)/kchmviewer $(prefix)/usr/lib/$(package))
ad34209dccf31d54e2277d732a90ce6ea4374362vboxsync dh_installdocs $(addprefix $(prefix)/opt/VirtualBox-$(ver)/,\
ad34209dccf31d54e2277d732a90ce6ea4374362vboxsync rm $(addprefix $(prefix)/opt/VirtualBox-$(ver)/,UserManual.pdf VirtualBox.chm LICENSE)
8eb4989e815c8f374b965265ccf184d6ce17d9e8vboxsync for i in rdesktop-vrdp.tar.gz additions/VBoxGuestAdditions.iso; do \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync mv $(prefix)/opt/VirtualBox-$(ver)/$$i $(prefix)/usr/share/$(package); done
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync $(if $(HEADLESS),,usr/bin/VBox usr/bin/VirtualBox) \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync sed -e 's|%NOLSB%|$(if $(filter _Debian_sarge ucs1.3,$(debrel)),yes,)|g;' \
0b1397fff8b368cf5c2f3d8f5b312ed00114977dvboxsync sed -e 's|%NOLSB%|$(if $(filter _Debian_sarge,$(debrel)),yes,)|g;' \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync if [ "$(debrel)" = "_Ubuntu_dapper" -o "$(debrel)" = "_Debian_sarge" ]; then \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync # manually strip our R0/GC modules, dh_strip cannot handle them
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync $(prefix)/usr/lib/$(package)/*.r0 $(prefix)/usr/lib/$(package)/*.gc; do \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync $(prefix)/usr/lib/debug/usr/lib/$(package)/`basename $$f`; \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync objcopy --add-gnu-debuglink=$(prefix)/usr/lib/debug/usr/lib/$(package)/`basename $$f` $$f; \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync mv $(current)/debian/$(package)/usr/lib/debug $(current)/debian/$(package)-dbg/usr/lib