rules revision 46888b0c9f72cc9089f1a92b0476a1e8d637efce
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Copyright (C) 2006-2012 Oracle Corporation
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater# This file is part of VirtualBox Open Source Edition (OSE), as
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# available from http://www.virtualbox.org. This file is free software;
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# you can redistribute it and/or modify it under the terms of the GNU
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# General Public License (GPL) as published by the Free Software
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Foundation, in version 2 as it comes in the "COPYING" file of the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#export DH_VERBOSE=1
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater# possible overrides:
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# OSE=1 force VBOX_OSE
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# NOPARALLEL=1 compile with -j1
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# LINUX=<dir> compile vboxdrv against Linux found in <dir>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# VERBOSE=1 verbose build
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews# DEBUG=1 debug build
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# NOSUBVER=1 disable generation of the sub-version field (which is
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# either the subversion rev [if available] or the build date)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# NODOCS=1 don't build docs, use precompiled UserManual.pdf and
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# NOMODS=1 don't build any module
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# NOQT=1 don't build the Qt GUI
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# EFI=1 include the EFI binary from prebuild
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# HEADLESS=1 build the headless version
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# VNC=1 build VNC code
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# NOWEBSVC=1 don't build the webservice API, default for OSE
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# PKGDIR=<path> where to store the final package(s)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# BLEEDING_EDGE=xyz
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewspkgdir := $(if $(PKGDIR),$(PKGDIR),$(shell cd ..; pwd))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsose := $(if $(OSE),1,$(if $(wildcard $(vboxroot)/src/VBox/RDP/server),,1))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsNOWINE := $(if $(NODOCS),$(if $(STAGEDISO),1,),)$(ose)
922312472e2e05ebc64993d465999c5351b83036Automatic Updater ifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),)
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont $(error STAGEDISO='$(STAGEDISO)/VBoxGuestAdditions.iso' not found)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdebrel := $(if $(shell which lsb_release),_$(shell lsb_release -si)_$(shell lsb_release -sc),unknown)
2cbb4ab75757fbb656997a82c14ca07db37d481aAutomatic Updater# shipping Linux kernel modules with bleeding-edge releases doesn't make sense
2cbb4ab75757fbb656997a82c14ca07db37d481aAutomatic Updaterinstmod := $(if $(filter _Ubuntu_lucid _Ubuntu_maverick _Ubuntu_natty _Ubuntu_oneiric _Debian_sid,$(debrel)),,1)
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# Location of custom built Qt libraries (see below)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(if $(filter _Debian_squeeze,$(debrel)),--build-libvpx,) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(if $(ose),--ose,) $(if $(LINUX),--with-linux=$(LINUX),) \
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews $(if $(NOWEBSVC),,$(if $(ose),--enable-webservice,)) \
0c6ada0a814f3c5417daa1654129bc2af56ed504Automatic Updaterbld_flags := AUTOCFG=$(current)/debian/AutoConfig.kmk \
0c6ada0a814f3c5417daa1654129bc2af56ed504Automatic Updater LOCALCFG=$(current)/debian/LocalConfig.kmk \
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/$(verpkg)\"" \
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater $(if $(VERBOSE),--print-directory KBUILD_VERBOSE=2,--no-print-directory) \
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater $(if $(STAGEDISO),VBOX_WITHOUT_ADDITIONS=1,) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(if $(BLEEDING_EDGE),VBOX_BLEEDING_EDGE=$(BLEEDING_EDGE),)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews cd $(vboxroot) && ./configure --odir=$(current)/debian $(cfg_flags)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsbuild: debian/configure-stamp debian/build-stamp
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews . debian/env.sh && kmk -C $(vboxroot) $(bld_flags) $(if $(NOPARALLEL),-j1,) all
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(if $(NODOCS),cp $(vboxroot)/prebuild/UserManual*.pdf $(builddir)/bin,)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(if $(NODOCS),cp $(vboxroot)/prebuild/VirtualBox*.chm $(builddir)/bin,)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(if $(EFI),cp $(vboxroot)/prebuild/VBoxEFI32.fd $(builddir)/bin,)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(if $(EFI),cp $(vboxroot)/prebuild/VBoxEFI64.fd $(builddir)/bin,)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(if $(STAGEDISO),cp $(STAGEDISO)/VBoxGuestAdditions.iso $(builddir)/bin/additions,)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews . debian/env.sh && kmk -C $(vboxroot) $(bld_flags) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews VBOX_LNX_ADD_ARCHIVE.x86=$(builddir)/bin/additions/VBoxGuestAdditions-x86.tar.bz2 \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews VBOX_LNX_ADD_ARCHIVE.amd64=$(builddir)/bin/additions/VBoxGuestAdditions-amd64.tar.bz2 \
rm -f debian/vboxballoonctrl-service.init debian/vboxautostart-service.init debian/vboxweb-service.init
dh_clean -k
sed \
if [ -f $$d/vboxdrv.ko -a -f $$d/vboxnetflt.ko -a -f $$d/vboxnetadp.ko -a -f $$d/vboxpci.ko ]; then \
install -D -g 0 -o 0 -m 0644 \
install -D -g 0 -o 0 -m 0644 \
install -D -g 0 -o 0 -m 0644 \
install -D -g 0 -o 0 -m 0644 \
sed \
cp $(vboxroot)/src/VBox/Installer/linux/vboxballoonctrl-service.sh debian/vboxballoonctrl-service.init
-e '/#include installer-common.sh/ {' \
dh_strip --keep-debug --exclude=libQtCoreVBox.so.4 --exclude=libQtGuiVBox.so.4 --exclude=libQtNetworkVBox.so.4 --exclude=libQtOpenGLVBox.so.4 --exclude=libqtaccessiblewidgets.so
dh_gencontrol -- \