rules revision 46e6cceda24bf6c589e4cb151afefe4fffecca7b
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync#export DH_VERBOSE=1
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# possible overrides:
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# OSE=1 force VBOX_OSE
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# NOPARALLEL=1 compile with -j1 (-j2 is default)
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# LINUX=<dir> compile vboxdrv against Linux found in <dir>
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# VERBOSE=1 verbose build
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# DEBUG=1 debug build
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# NOSUBVER=1 disable generation of the sub-version field (which is
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# either the subversion rev [if available] or the build date)
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# NODOCS=1 don't build docs, use precompiled UserManual.pdf and
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# 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
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),)
da6747c2419b9cea8b5e2c576a30a5de999a8ab3vboxsync$(error STAGEDISO='$(STAGEDISO)/VBoxGuestAdditions.iso' not found)
8eb4989e815c8f374b965265ccf184d6ce17d9e8vboxsync# Hack: Xandros is actually Debian/sarge ... :(
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncdebrel := $(if $(shell which lsb_release),_$(shell lsb_release -si)_$(shell lsb_release -sc),)
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsyncdebdocs := VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/virtualbox\""
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# Ubuntu dapper: gcc-4.0 does not work with recompiler, use gcc-3.4 instead
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync 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 \
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync $(filter _xandros4.1,$(debrel)),--build-xalan,) $(if \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(filter _xandros4.1 _ucs1.3,$(debrel)),--disable-sdl-ttf,) $(if \
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync $(HEADLESS),--build-headless,) $(if $(DEBUG),--build-debug,)
13c94cb9d95cf4865646e86b944c09e1af2fe48cvboxsync $(VERBOSE),--print-directory,--no-print-directory) $(if \
bffb24521128f5183aafbef6542e7dacf20b5132vboxsync 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 \
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync 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/$(package).init debian/vboxdrv.init debian/vboxnet.init
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync rm -f debian/AutoConfig.kmk debian/configure.log debian/env.sh
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync rm -f debian/modules-stamp debian/build-stamp debian/configure-stamp
a0a9f39e8864357c2e1e61106958411240f5bf6bvboxsync# Build architecture-dependent files here.
a0a9f39e8864357c2e1e61106958411240f5bf6bvboxsyncbinary binary-arch binary-indep: build $(if $(NOMODS),,modules)
27efd9329f6a90f7cacf840031e5305f98975960vboxsync tar -xjC $(prefix)/opt -f $(builddir)/bin/VirtualBox.tar.bz2
27efd9329f6a90f7cacf840031e5305f98975960vboxsync install -d -g 0 -o 0 $(prefix)/usr/share/applications
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync install -d -g 0 -o 0 $(prefix)/usr/share/$(package)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync install -d -g 0 -o 0 $(prefix)/usr/share/doc/$(package)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(HEADLESS),,mv $(archdir)/VirtualBox.desktop \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(prefix)/usr/share/applications/VirtualBox.desktop)
c38d5dda76cee141ae524ccce2c513178be1b87cvboxsync install -D -g 0 -o 0 -m 644 debian/lintian-override \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync mv $(archdir)/VBoxREM2.rel $(prefix)/usr/lib/$(package),)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync mv $(archdir)/VBoxXPCOMIPCD $(prefix)/usr/lib/$(package)
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync mv $(archdir)/components $(prefix)/usr/lib/$(package)/components
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $(if $(HEADLESS),,mv $(archdir)/nls $(prefix)/usr/share/$(package))
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync install -D -g 0 -o 0 -m 644 debian/VBox.sh $(prefix)/usr/bin/VBox
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync mv $(archdir)/VBoxSysInfo.sh $(prefix)/usr/share/$(package)
4726db8b47db329039ce8f8e13ecd2c1f696fa60vboxsync mv $(archdir)/VBoxAddIF.sh $(prefix)/usr/bin/VBoxTAP
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync for i in VBoxManage VBoxSVC tstVMM $(if $(HEADLESS),,VBoxSDL) \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync $(if $(HEADLESS),,VirtualBox) $(if $(ose),,VBoxVRDP); do \
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync mv $(archdir)/$$i $(prefix)/usr/lib/$(package); done
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync install -D -g 0 -o 0 -m 0644 \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync $$d/vboxdrv.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxdrv.ko; done)
097b3079a919c94052ca642306232b856949c755vboxsync $(if $(HEADLESS),,mv $(archdir)/kchmviewer $(prefix)/usr/lib/$(package))
097b3079a919c94052ca642306232b856949c755vboxsync rm $(addprefix $(archdir)/,UserManual.pdf VirtualBox.chm LICENSE)
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync for i in rdesktop-vrdp.tar.gz additions/VBoxGuestAdditions.iso; do \
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync mv $(archdir)/$$i $(prefix)/usr/share/$(package); done
bffb24521128f5183aafbef6542e7dacf20b5132vboxsync $(if $(HEADLESS),,usr/bin/VBox usr/bin/VirtualBox) \
13c94cb9d95cf4865646e86b944c09e1af2fe48cvboxsync sed -e 's|%NOLSB%|$(if $(filter _Debian_sarge ucs1.3,$(debrel)),yes,)|g;' \
8eb4989e815c8f374b965265ccf184d6ce17d9e8vboxsync sed -e 's|%NOLSB%|$(if $(filter _Debian_sarge,$(debrel)),yes,)|g;' \
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync if [ "$(debrel)" = "_Ubuntu_dapper" -o "$(debrel)" = "_Debian_sarge" ]; then \
a0a9f39e8864357c2e1e61106958411240f5bf6bvboxsync # manually strip our R0/GC modules, dh_strip cannot handle them
8eb4989e815c8f374b965265ccf184d6ce17d9e8vboxsync $(prefix)/usr/lib/$(package)/*.r0 $(prefix)/usr/lib/$(package)/*.gc; do \
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync $(prefix)/usr/lib/debug/usr/lib/$(package)/`basename $$f`; \
ad34209dccf31d54e2277d732a90ce6ea4374362vboxsync objcopy --add-gnu-debuglink=$(prefix)/usr/lib/debug/usr/lib/$(package)/`basename $$f` $$f; \
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync mv $(current)/debian/$(package)/usr/lib/debug $(current)/debian/$(package)-dbg/usr/lib