rules revision 24df09922f68ca6b53d3b8052e589d3b790f7c17
ee359fe1384507fed6c2274e7bfe81d288de4542Stephen Gallagher# Copyright (C) 2006-2010 Oracle Corporation
ee359fe1384507fed6c2274e7bfe81d288de4542Stephen Gallagher# This file is part of VirtualBox Open Source Edition (OSE), as
33396dc46ea52c18f47db1b5d590880806521005Sumit Bose# available from http://www.virtualbox.org. This file is free software;
703dc1eb5b050b24235a6640f271d34ea008cf98Jan Engelhardt# you can redistribute it and/or modify it under the terms of the GNU
703dc1eb5b050b24235a6640f271d34ea008cf98Jan Engelhardt# General Public License as published by the Free Software Foundation,
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
324fb26ba803a999bedc29e93c46c84f27abf5b7Sumit Bose# distribution. VirtualBox OSE is distributed in the hope that it will
324fb26ba803a999bedc29e93c46c84f27abf5b7Sumit Bose# be useful, but WITHOUT ANY WARRANTY of any kind.
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher# NOTE: if you make changes to this file, please check if the updates should
84ae5edab16ad6be5e3be956cb6fa031c1428eb5Stephen Gallagher# be also applied to the publicly visible debian/rules file.
002f84aea86371aa079b867c0ec39396b97109d3Lukas Slebodnik#export DH_VERBOSE=1
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher# possible overrides:
87d3b47abba6a40fcf809c85a2b138bc1013d9c5Jakub Hrozek# OSE=1 force VBOX_OSE
87d3b47abba6a40fcf809c85a2b138bc1013d9c5Jakub Hrozek# NOPARALLEL=1 compile with -j1
deeadf40db3a1eec64cf030e54afc4cb8612a8d5Lukas Slebodnik# LINUX=<dir> compile vboxdrv against Linux found in <dir>
ccf340e56364851f2e5b75e52d3d63701b662954Lukas Slebodnik# VERBOSE=1 verbose build
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher# DEBUG=1 debug build
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher# NOSUBVER=1 disable generation of the sub-version field (which is
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher# either the subversion rev [if available] or the build date)
84ae5edab16ad6be5e3be956cb6fa031c1428eb5Stephen Gallagher# NODOCS=1 don't build docs, use precompiled UserManual.pdf and
ee359fe1384507fed6c2274e7bfe81d288de4542Stephen Gallagher# NOMODS=1 don't build any module
cc98edd9479d4622634a1275c98058916c14059aStephen Gallagher# NOQT=1 don't build the Qt GUI
d3da1c165cdb4c1ec126a8f4b6b544ca415b9d20Pavel Březina# EFI include the EFI binary from prebuild
d3da1c165cdb4c1ec126a8f4b6b544ca415b9d20Pavel Březina# VERSUFFIX=<suffix> set a particular package version suffix (e.g. _customer)
d3da1c165cdb4c1ec126a8f4b6b544ca415b9d20Pavel Březina# HEADLESS=1 build the headless version
c481179da5d5b53ce16d8784c0bd2857ffc2f061Lukas Slebodnik# NOWEBSVC=1 don't build the webservice API, default for OSE
1183d29d87c5c7439cf2364b7d7324d4a13b6e35Stephen Gallagher# STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso
002f84aea86371aa079b867c0ec39396b97109d3Lukas Slebodnik# BLEEDING_EDGE=xyz
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagherverfile := $(builddir)/version-generated.mk
c89589fa349f38214c9cb8d9389c0fd557e5dca2Simo Sorceose := $(if $(OSE),1,$(if $(wildcard $(vboxroot)/src/VBox/RDP/server),,1))
86b61156743b7ebdc049450a6f88452890fd9a61Jakub Hrozeksvnver := $(if $(NOSUBVER),,$(if $(svn_revision),-$(svn_revision),$(shell if \
86b61156743b7ebdc049450a6f88452890fd9a61Jakub Hrozek svn info > /dev/null 2>&1; then \
86b61156743b7ebdc049450a6f88452890fd9a61Jakub Hrozek svn info|sed -e "s/^Revision: \(.*\)/-\1/;t;d"; else \
86b61156743b7ebdc049450a6f88452890fd9a61Jakub Hrozekdebver :=$(subst _ALPHA,~alpha,$(subst _BETA,~beta,$(ver)))$(svnver)$(if \
86b61156743b7ebdc049450a6f88452890fd9a61Jakub Hrozek $(BLEEDING_EDGE),-$(BLEEDING_EDGE),)$(VERSUFFIX)$(if \
1658c567191c35beaddffafdb079abe33248037bLukas Slebodnik ifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),)
1658c567191c35beaddffafdb079abe33248037bLukas Slebodnik $(error STAGEDISO='$(STAGEDISO)/VBoxGuestAdditions.iso' not found)
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagherdebrel := $(if $(shell which lsb_release),_$(shell lsb_release -si)_$(shell lsb_release -sc),unknown)
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher# shipping Linux kernel modules with bleeding-edge releases doesn't make sense
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagherinstmod := $(if $(filter _Ubuntu_lucid _Debian_sid,$(debrel)),,1)
d921c1eba437662437847279f251a0a5d8f70127Maxim debdist := $(strip $(shell grep $(debrel) $(current)/distributions_deb | cut -d'=' -f2))
d921c1eba437662437847279f251a0a5d8f70127Maxim $(error package distribution not detected (debrel=$(debrel)))
b9c8ce2bdd4045782c243605a1b999098bedcffcNoam Meltzer# Locations of custom built Qt libraries (see below)
b9c8ce2bdd4045782c243605a1b999098bedcffcNoam Meltzer $(if $(ose),--ose,) $(if $(LINUX),--with-linux=$(LINUX),) \
b9c8ce2bdd4045782c243605a1b999098bedcffcNoam Meltzer $(if $(filter _Debian_etch,$(debrel)),$(if $(ose),,--build-libcurl),) \
327127bb7fcc07f882209f029e14026de1b23c94Maxim $(if $(filter _Debian_etch _Ubuntu_hardy,$(debrel)),--with-qt4-dir=$(qtstdc6)) \
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagherbld_flags := AUTOCFG=$(current)/debian/AutoConfig.kmk \
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher LOCALCFG=$(current)/debian/LocalConfig.kmk \
bc9235cfb80bd64a3bfa959e8d26d5ad1be0bdf4Jakub Hrozek VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/$(verpkg)\"" \
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher $(if $(VERBOSE),--print-directory KBUILD_VERBOSE=2,--no-print-directory) \
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher $(if $(STAGEDISO),VBOX_WITHOUT_ADDITIONS=1,) \
4b6a0d0b3d42e5fdb457f47d9adfa5e66b160256Stephen Gallagher $(if $(BLEEDING_EDGE),VBOX_BLEEDING_EDGE=$(BLEEDING_EDGE),) \
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose $(if $(filter _Debian_etch _Ubuntu_hardy,$(debrel)),,VBOX_WITH_SYSFS_BY_DEFAULT=1)
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher cd $(vboxroot) && ./configure --odir=$(current)/debian $(cfg_flags)
772464c842968d6e544118ae1aa7c49a7cda2ad6Stephen Gallagherbuild: debian/configure-stamp debian/build-stamp
98ce3c3e85a4bb2e1822bf8ab2a1c2ab9e3dd61dJakub Hrozek . debian/env.sh && kmk -C $(vboxroot) $(bld_flags) $(if $(NOPARALLEL),-j1,) all
be65f065fef1d387281096ef095a2acef39ecc12Jakub Hrozek $(if $(NODOCS),cp $(vboxroot)/prebuild/UserManual*.pdf $(builddir)/bin,)
e124844907ed6973915e4d56f5442ecd07535a12Jakub Hrozek $(if $(NODOCS),cp $(vboxroot)/prebuild/VirtualBox*.chm $(builddir)/bin,)
f36078af138f052cd9a30360867b0ebd0805af5eJakub Hrozek $(if $(EFI),cp $(vboxroot)/prebuild/VBoxEFI32.fd $(builddir)/bin,)
34c78b745eb349eef2b0f13ef2b722632aebe619Jan Cholasta $(if $(EFI),cp $(vboxroot)/prebuild/VBoxEFI64.fd $(builddir)/bin,)
e07a94a66985b674c5df11ca466792902164c4e2George McCollister $(if $(STAGEDISO),cp $(STAGEDISO)/VBoxGuestAdditions.iso $(builddir)/bin/additions,)
77c0d1f6074059dafd2293f9c42ea0f9d60f8aadJakub Hrozek . debian/env.sh && kmk -C $(vboxroot) $(bld_flags) \
b9c8ce2bdd4045782c243605a1b999098bedcffcNoam Meltzer VBOX_LNX_ADD_ARCHIVE.x86=$(builddir)/bin/additions/VBoxGuestAdditions-x86-r$(svnrev).tar.bz2 \
b9c8ce2bdd4045782c243605a1b999098bedcffcNoam Meltzer VBOX_LNX_ADD_ARCHIVE.amd64=$(builddir)/bin/additions/VBoxGuestAdditions-amd64-r$(svnrev).tar.bz2 \
a9c287bda3fc2a1e12cef2135ade96945f11ad01Sumit Bose VBOX_PATH_ADDITIONS.linux.x86=$(builddir)/bin/additions \
bc13c352ba9c2877f1e9bc62e55ad60fc000a55dJakub Hrozek VBOX_PATH_ADDITIONS.linux.amd64=$(builddir)/bin/additions \
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher# Build modules for every kernel we find in /lib/modules/*
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallaghermodules: debian/build-stamp debian/modules-stamp
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher make -C $(builddir)/bin/src/vboxdrv KERN_DIR=$$d/build MODULE_DIR=$$d clean && \
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher make -j4 -C $(builddir)/bin/src/vboxdrv KBUILD_VERBOSE= KERN_DIR=$$d/build MODULE_DIR=$$d all \
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher $(if $(instmod),&& install -D -m 0644 -g 0 -o 0 \
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher $(builddir)/bin/src/vboxdrv/vboxdrv.ko $(moddir)/$$(basename $$d)/vboxdrv.ko); \
a5077712fc8c24e8cad08207b7b5a6603bde6a7cJakub Hrozek make -C $(builddir)/bin/src/vboxnetflt KERN_DIR=$$d/build MODULE_DIR=$$d clean && \
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher (cp $(builddir)/bin/src/vboxdrv/Module.symvers $(builddir)/bin/src/vboxnetflt || true) && \
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher make -j4 -C $(builddir)/bin/src/vboxnetflt KBUILD_VERBOSE= KERN_DIR=$$d/build MODULE_DIR=$$d all \
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher $(if $(instmod),&& install -D -m 0644 -g 0 -o 0 \
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher $(builddir)/bin/src/vboxnetflt/vboxnetflt.ko $(moddir)/$$(basename $$d)/vboxnetflt.ko); \
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher make -C $(builddir)/bin/src/vboxnetadp KERN_DIR=$$d/build MODULE_DIR=$$d clean && \
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher (cp $(builddir)/bin/src/vboxdrv/Module.symvers $(builddir)/bin/src/vboxnetadp || true) && \
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher make -j4 -C $(builddir)/bin/src/vboxnetadp KBUILD_VERBOSE= KERN_DIR=$$d/build MODULE_DIR=$$d all \
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher $(if $(instmod),&& install -D -m 0644 -g 0 -o 0 \
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher $(builddir)/bin/src/vboxnetadp/vboxnetadp.ko $(moddir)/$$(basename $$d)/vboxnetadp.ko); \
9917c138d9a270deb5820915384fbde751190c2aLukas Slebodnik make -C $(builddir)/bin/src/vboxnetadp clean
bf54fbed126ec3d459af40ea370ffadacd31c76dJakub Hrozek rm -f debian/changelog debian/preinst debian/postinst debian/prerm
9d453f1e8b28983b363b44c49b7cd701a994fd97Nikolai Kondrashov rm -f debian/$(package).init debian/vboxdrv.init debian/vboxweb-service.init
3fc158e59eebbc2f538fe0076a03928d0d4eab9fPavel Březina rm -f debian/AutoConfig.kmk debian/configure.log debian/env.sh
3fc158e59eebbc2f538fe0076a03928d0d4eab9fPavel Březina rm -f debian/modules-stamp debian/build-stamp debian/configure-stamp
3fc158e59eebbc2f538fe0076a03928d0d4eab9fPavel Březina rm -f debian/virtualbox-*.substvars debian/virtualbox*.debhelper
9dbdf62243f01f6aee41c2b5f2976c56da47f25dLukas Slebodnikbinary binary-arch binary-indep: build $(verfile)
9dbdf62243f01f6aee41c2b5f2976c56da47f25dLukas Slebodnik# Build architecture-dependent files here.
9dbdf62243f01f6aee41c2b5f2976c56da47f25dLukas Slebodnikbinary binary-arch binary-indep: build $(if $(NOMODS),,modules)
539b1be3507abdf8ac235b06eeed5011b0b5cde2Ondrej Kos tar -xjC $(prefix)/opt -f $(builddir)/bin/VirtualBox.tar.bz2
539b1be3507abdf8ac235b06eeed5011b0b5cde2Ondrej Kos install -d -g 0 -o 0 $(prefix)/usr/share/applications
574a1c20f114851071ae74112b34488c3d1aeeb3Ondrej Kos install -d -g 0 -o 0 $(prefix)/usr/lib/$(package)
574a1c20f114851071ae74112b34488c3d1aeeb3Ondrej Kos install -d -g 0 -o 0 $(prefix)/usr/share/$(package)
2a5790216f57e9bdfb2930d52860bb5300366536Jakub Hrozek install -d -g 0 -o 0 $(prefix)/usr/share/doc/$(verpkg)
e6e26182d58c05d896f72f2925426658a6dc70b5Jakub Hrozek $(if $(NOQT),,mv $(archdir)/virtualbox.desktop \
e6e26182d58c05d896f72f2925426658a6dc70b5Jakub Hrozek $(prefix)/usr/share/applications/virtualbox.desktop)
9542512d7be40f2000298c86d3d2b728f4f0f65aStephen Gallagher install -d -g 0 -o 0 $(prefix)/usr/share/pixmaps
e6e26182d58c05d896f72f2925426658a6dc70b5Jakub Hrozek install -d -g 0 -o 0 $(prefix)/usr/share/lintian/overrides
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher -e 's|%VERPKG%|$(verpkg)|g' \
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher $(prefix)/usr/share/lintian/overrides/$(verpkg)
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher mv $(archdir)/VBoxEFI32.fd $(prefix)/usr/lib/$(package)
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher mv $(archdir)/VBoxEFI64.fd $(prefix)/usr/lib/$(package)
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher mv $(archdir)/*.gc $(prefix)/usr/lib/$(package)
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher mv $(archdir)/*.r0 $(prefix)/usr/lib/$(package)
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher mv $(archdir)/*.rel $(prefix)/usr/lib/$(package) || true
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher mv $(archdir)/VBoxNetDHCP $(prefix)/usr/lib/$(package)
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher mv $(archdir)/VBoxNetAdpCtl $(prefix)/usr/lib/$(package)
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher mv $(archdir)/VBoxXPCOMIPCD $(prefix)/usr/lib/$(package)
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher mv $(archdir)/components $(prefix)/usr/lib/$(package)/components
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher mv $(archdir)/*.so $(prefix)/usr/lib/$(package)
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher mv $(archdir)/*.so.4 $(prefix)/usr/lib/$(package) || true
b50dffea929ee5cd0c59ba3c4822337cc162ff92Kamil Dudka $(if $(NOQT),,mv $(archdir)/VBoxTestOGL $(prefix)/usr/lib/$(package))
b50dffea929ee5cd0c59ba3c4822337cc162ff92Kamil Dudka $(if $(NOQT),,mv $(archdir)/nls $(prefix)/usr/share/$(package))
b50dffea929ee5cd0c59ba3c4822337cc162ff92Kamil Dudka mv $(archdir)/src $(prefix)/usr/share/$(package)
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher export VBOX_INSTALL_PATH=/usr/lib/$(package) && \
4d81fe27ced3d2e96866aeaf61661a925cb8edf1Jakub Hrozek python ./vboxapisetup.py install --root $(prefix)
4d81fe27ced3d2e96866aeaf61661a925cb8edf1Jakub Hrozek mv $(archdir)/vboxshell.py $(prefix)/usr/lib/$(package)
4d81fe27ced3d2e96866aeaf61661a925cb8edf1Jakub Hrozek install -D -g 0 -o 0 -m 644 debian/VBox.sh $(prefix)/usr/bin/VBox
4d81fe27ced3d2e96866aeaf61661a925cb8edf1Jakub Hrozek mv $(archdir)/VBoxSysInfo.sh $(prefix)/usr/share/$(package)
4d81fe27ced3d2e96866aeaf61661a925cb8edf1Jakub Hrozek for i in VBoxManage VBoxSVC $(if $(HEADLESS),,VBoxSDL) \
4d81fe27ced3d2e96866aeaf61661a925cb8edf1Jakub Hrozek mv $(archdir)/$$i $(prefix)/usr/lib/$(package); done
4d81fe27ced3d2e96866aeaf61661a925cb8edf1Jakub Hrozek if [ -f $$d/vboxdrv.ko -a -f $$d/vboxnetflt.ko -a -f $$d/vboxnetadp.ko ]; then \
4d81fe27ced3d2e96866aeaf61661a925cb8edf1Jakub Hrozek install -D -g 0 -o 0 -m 0644 \
4d81fe27ced3d2e96866aeaf61661a925cb8edf1Jakub Hrozek $$d/vboxdrv.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxdrv.ko; \
4d81fe27ced3d2e96866aeaf61661a925cb8edf1Jakub Hrozek install -D -g 0 -o 0 -m 0644 \
6f51c802311fd81a409a26763ed45b28a3234d0dJakub Hrozek $$d/vboxnetflt.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxnetflt.ko; \
4d81fe27ced3d2e96866aeaf61661a925cb8edf1Jakub Hrozek install -D -g 0 -o 0 -m 0644 \
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher $$d/vboxnetadp.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxnetadp.ko; \
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher $(if $(NOQT),,mv $(archdir)/kchmviewer $(prefix)/usr/lib/$(package))
827dd342494de18099dddd0272c1a85f10703556Lukas Slebodnik $(archdir)/UserManual*.pdf $(archdir)/VirtualBox*.chm \
827dd342494de18099dddd0272c1a85f10703556Lukas Slebodnik $(addprefix $(archdir)/, $(if $(HEADLESS),,License-*.html) LICENSE)
827dd342494de18099dddd0272c1a85f10703556Lukas Slebodnik rm $(addprefix $(archdir)/,UserManual*.pdf VirtualBox*.chm \
827dd342494de18099dddd0272c1a85f10703556Lukas Slebodnik for i in rdesktop-vrdp.tar.gz additions/VBoxGuestAdditions.iso; do \
827dd342494de18099dddd0272c1a85f10703556Lukas Slebodnik mv $(archdir)/$$i $(prefix)/usr/share/$(package); done
827dd342494de18099dddd0272c1a85f10703556Lukas Slebodnik $(if $(HEADLESS),,mv $(archdir)/rdesktop-vrdp $(prefix)/usr/bin)
4a5a18f489f4d19aa0571528a7f0c7a8d35ac83fLukas Slebodnik $(if $(HEADLESS),,mv $(archdir)/rdesktop-vrdp-keymaps $(prefix)/usr/share/$(package))
827dd342494de18099dddd0272c1a85f10703556Lukas Slebodnik if [ -d $(archdir)/accessible ]; then mv $(archdir)/accessible $(prefix)/usr/lib/virtualbox; fi
827dd342494de18099dddd0272c1a85f10703556Lukas Slebodnik for i in additions/VBoxGuestAdditions.iso; do \
827dd342494de18099dddd0272c1a85f10703556Lukas Slebodnik mv $(archdir)/$$i $(prefix)/usr/share/$(package); done
72e60fd4eabcfbcdbfe01e8c38b94052bc6c2067Jakub Hrozek $(if $(NOQT),,usr/bin/VBox usr/bin/VirtualBox) \
4a5a18f489f4d19aa0571528a7f0c7a8d35ac83fLukas Slebodnik $(if $(NOQT),,VirtualBox usr/bin/virtualbox) \
4a5a18f489f4d19aa0571528a7f0c7a8d35ac83fLukas Slebodnik $(if $(HEADLESS),,usr/bin/VBox usr/bin/VBoxSDL) \
4a5a18f489f4d19aa0571528a7f0c7a8d35ac83fLukas Slebodnik $(if $(HEADLESS),,VBoxSDL usr/bin/vboxsdl) \
4a5a18f489f4d19aa0571528a7f0c7a8d35ac83fLukas Slebodnik $(if $(ose),,usr/bin/VBox usr/bin/VBoxVRDP) \
4a5a18f489f4d19aa0571528a7f0c7a8d35ac83fLukas Slebodnik $(if $(NOWEBSVC),,usr/bin/VBox usr/bin/vboxwebsrv) \
4a5a18f489f4d19aa0571528a7f0c7a8d35ac83fLukas Slebodnik usr/share/virtualbox/src/vboxhost usr/src/vboxhost-$(ver)
827dd342494de18099dddd0272c1a85f10703556Lukas Slebodnik -e 's|%NOLSB%||g' \
827dd342494de18099dddd0272c1a85f10703556Lukas Slebodnik -e 's|%DEBIAN%|yes|g' \
827dd342494de18099dddd0272c1a85f10703556Lukas Slebodnik -e 's|%PACKAGE%|virtualbox|g' \
827dd342494de18099dddd0272c1a85f10703556Lukas Slebodnik $(vboxroot)/src/VBox/Installer/linux/vboxdrv.sh.in > debian/vboxdrv.init
827dd342494de18099dddd0272c1a85f10703556Lukas Slebodnik -e 's|%NOLSB%||g' \
4a5a18f489f4d19aa0571528a7f0c7a8d35ac83fLukas Slebodnik -e 's|%DEBIAN%|yes|g' \
4a5a18f489f4d19aa0571528a7f0c7a8d35ac83fLukas Slebodnik -e 's|%PACKAGE%|virtualbox|g' \
4a5a18f489f4d19aa0571528a7f0c7a8d35ac83fLukas Slebodnik $(vboxroot)/src/VBox/Installer/linux/vboxweb-service.sh.in > debian/vboxweb-service.init
4a5a18f489f4d19aa0571528a7f0c7a8d35ac83fLukas Slebodnik dh_installinit --name=vboxweb-service --noscripts
4a5a18f489f4d19aa0571528a7f0c7a8d35ac83fLukas Slebodnik -e 's|%DATE%|$(shell date -R)|g' \
4a5a18f489f4d19aa0571528a7f0c7a8d35ac83fLukas Slebodnik -e 's|%DEBREL%|$(subst _,~,$(debrel))|g' \
4a5a18f489f4d19aa0571528a7f0c7a8d35ac83fLukas Slebodnik -e 's|%VERPKG%|$(verpkg)|g' \
4a5a18f489f4d19aa0571528a7f0c7a8d35ac83fLukas Slebodnik cat debian/preinst.in | sed -e 's|%VER%|$(ver)|g' > debian/preinst
4a5a18f489f4d19aa0571528a7f0c7a8d35ac83fLukas Slebodnik cat debian/prerm.in | sed -e 's|%VER%|$(ver)|g' > debian/prerm
4a5a18f489f4d19aa0571528a7f0c7a8d35ac83fLukas Slebodnik cat debian/postinst.in | sed -e 's|%VER%|$(ver)|g' > debian/postinst
4a5a18f489f4d19aa0571528a7f0c7a8d35ac83fLukas Slebodnik dh_strip --keep-debug --exclude=libQtCoreVBox.so.4 --exclude=libQtGuiVBox.so.4 --exclude=libQtNetworkVBox.so.4 --exclude=libQtOpenGLVBox.so.4 --exclude=libqtaccessiblewidgets.so
4a5a18f489f4d19aa0571528a7f0c7a8d35ac83fLukas Slebodnik # manually strip our R0/GC modules, dh_strip cannot handle them
4a5a18f489f4d19aa0571528a7f0c7a8d35ac83fLukas Slebodnik $(prefix)/usr/lib/$(package)/*.r0 $(prefix)/usr/lib/$(package)/*.gc; do \
9d453f1e8b28983b363b44c49b7cd701a994fd97Nikolai Kondrashov $(prefix)/usr/lib/debug/usr/lib/$(package)/`basename $$f`; \
9d453f1e8b28983b363b44c49b7cd701a994fd97Nikolai Kondrashov strip -S --remove-section=.comment $$f; \
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher objcopy --add-gnu-debuglink=$(prefix)/usr/lib/debug/usr/lib/$(package)/`basename $$f` $$f; \
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher mkdir -p $(current)/debian/$(verpkg)-dbg/usr/lib
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher mv $(current)/debian/$(verpkg)/usr/lib/debug $(current)/debian/$(verpkg)-dbg/usr/lib
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher dh_compress -X.pdf -X.chm -X LICENSE -X.py
77c0d1f6074059dafd2293f9c42ea0f9d60f8aadJakub Hrozek # for some reason, the Qt libraries couldn't be found on newer releases (e.g. Ubuntu hardy)
77c0d1f6074059dafd2293f9c42ea0f9d60f8aadJakub Hrozek LD_LIBRARY_PATH=$(prefix)/usr/lib/virtualbox dh_shlibdeps
e07a94a66985b674c5df11ca466792902164c4e2George McCollister -Vsdlttf=$(if $(HEADLESS),,libsdl-ttf2.0-0) \
e07a94a66985b674c5df11ca466792902164c4e2George McCollister -Vdkms=$(if $(filter _Debian_etch _Debian_lenny,$(debrel)),,dkms)