rules revision f2ca52afeb0baed982c05e9d8591e0e4c7539dbd
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#!/usr/bin/make -f
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Copyright (C) 2006-2011 Oracle Corporation
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# This file is part of VirtualBox Open Source Edition (OSE), as
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# available from http://www.virtualbox.org. This file is free software;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# you can redistribute it and/or modify it under the terms of the GNU
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# General Public License as published by the Free Software Foundation,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# distribution. VirtualBox OSE is distributed in the hope that it will
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# be useful, but WITHOUT ANY WARRANTY of any kind.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#export DH_VERBOSE=1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteexport DH_COMPAT=4
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# possible overrides:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# OSE=1 force VBOX_OSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# NOPARALLEL=1 compile with -j1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# LINUX=<dir> compile vboxdrv against Linux found in <dir>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# VERBOSE=1 verbose build
3270659f55e0928d6edec3d26217cc29398a8149Srikanth, Ramana# DEBUG=1 debug build
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# NOSUBVER=1 disable generation of the sub-version field (which is
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# either the subversion rev [if available] or the build date)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# NODOCS=1 don't build docs, use precompiled UserManual.pdf and
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# VirtualBox.chm from $HOME
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# NOMODS=1 don't build any module
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# NOQT=1 don't build the Qt GUI
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# HEADLESS=1 build the headless version
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# NOWEBSVC=1 don't build the webservice API, default for OSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso
5c5f137104b2d56181283389fa902220f2023809Richard Lowe# BLEEDING_EDGE=xyz
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortepackage := virtualbox
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteverpkg := virtualbox-ose
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortecurrent := $(shell pwd)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevboxroot := $(shell pwd)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortepkgdir := ..
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortebuilddir := $(current)/debian/builddir
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortemoddir := $(current)/debian/modules
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteprefix := $(current)/debian/$(verpkg)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortearch := $(shell dpkg --print-architecture)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteverfile := $(builddir)/version-generated.mk
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteose := $(if $(OSE),1,$(if $(wildcard $(vboxroot)/src/VBox/RDP/server),,1))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesvnrev := 0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteNOMODS ?= $(ose)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteNOQT ?= $(HEADLESS)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteNOWEBSVC ?= $(ose)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteNOWINE := $(if $(NODOCS),$(if $(STAGEDISO),1,),)$(ose)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteifneq ($(wildcard $(verfile)),)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteinclude $(verfile)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortever := $(VBOX_VERSION_STRING)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortearchdir := $(prefix)/opt/VirtualBox-$(ver)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteendif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteifneq ($(STAGEDISO),)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(error STAGEDISO='$(STAGEDISO)/VBoxGuestAdditions.iso' not found)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteendif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortedebrel := $(if $(shell which lsb_release),_$(shell lsb_release -si)_$(shell lsb_release -sc),unknown)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# shipping Linux kernel modules with bleeding-edge releases doesn't make sense
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteinstmod := $(if $(filter _Ubuntu_lucid _Ubuntu_maverick _Ubuntu_natty _Debian_sid,$(debrel)),,1)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Location of custom built Qt libraries (see below)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteqtstdc6 := /home/vbox/Qt-4.4.3-stdc++6-$(arch)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortecfg_flags := $(if $(NOQT),--disable-qt,) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(ose),--ose,) $(if $(LINUX),--with-linux=$(LINUX),) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(filter _Debian_etch,$(debrel)),$(if $(ose),,--build-libcurl),) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(filter _Debian_etch _Ubuntu_hardy,$(debrel)),--with-qt4-dir=$(qtstdc6)) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(HEADLESS),--build-headless,) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(DEBUG),--build-debug,) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(NOWINE),,--setup-wine) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(NOWEBSVC),,--enable-webservice)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortebld_flags := AUTOCFG=$(current)/debian/AutoConfig.kmk \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte LOCALCFG=$(current)/debian/LocalConfig.kmk \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte PATH_OUT=$(current)/debian/builddir \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte VBOX_WITHOUT_EXTPACK_PUEL_PACKING=1 \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte VBOX_DO_STRIP= \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte VBOX_DO_STRIP_MODULES= \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte VBOX_WITH_MULTIVERSION_PYTHON= \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/$(verpkg)\"" \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(ose),,VBOX_WITH_DOCS_CHM=1) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte VBOX_SVN_REV=$(svnrev) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(NODOCS),VBOX_WITH_DOCS= ,)\
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(VERBOSE),--print-directory KBUILD_VERBOSE=2,--no-print-directory) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(STAGEDISO),VBOX_WITHOUT_ADDITIONS=1,) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(BLEEDING_EDGE),VBOX_BLEEDING_EDGE=$(BLEEDING_EDGE),) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(filter _Debian_etch _Ubuntu_hardy,$(debrel)),,VBOX_WITH_SYSFS_BY_DEFAULT=1)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteconfigure: debian/configure-stamp
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortedebian/configure-stamp:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_testdir
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte cd $(vboxroot) && ./configure --odir=$(current)/debian $(cfg_flags)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte touch debian/configure-stamp
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortebuild: debian/configure-stamp debian/build-stamp
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortedebian/build-stamp $(verfile):
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_testdir
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte . debian/env.sh && kmk -C $(vboxroot) $(bld_flags) $(if $(NOPARALLEL),-j1,) all
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(NODOCS),cp $(vboxroot)/prebuild/UserManual*.pdf $(builddir)/bin,)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(NODOCS),cp $(vboxroot)/prebuild/VirtualBox*.chm $(builddir)/bin,)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mkdir -p $(builddir)/bin/additions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(STAGEDISO),cp $(STAGEDISO)/VBoxGuestAdditions.iso $(builddir)/bin/additions,)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte . debian/env.sh && kmk -C $(vboxroot) $(bld_flags) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte VBOX_NO_LINUX_RUN_INSTALLER=1 \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte VBOX_LNX_ADD_ARCHIVE.x86=$(builddir)/bin/additions/VBoxGuestAdditions-x86-r$(svnrev).tar.bz2 \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte VBOX_LNX_ADD_ARCHIVE.amd64=$(builddir)/bin/additions/VBoxGuestAdditions-amd64-r$(svnrev).tar.bz2 \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte VBOX_PATH_ADDITIONS.linux.x86=$(builddir)/bin/additions \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte VBOX_PATH_ADDITIONS.linux.amd64=$(builddir)/bin/additions \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte packing
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte touch debian/build-stamp
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Build modules for every kernel we find in /lib/modules/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortemodules: debian/build-stamp debian/modules-stamp
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortedebian/modules-stamp: debian/build-stamp
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rm -rf $(moddir)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mkdir $(moddir)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte make -C $(builddir)/bin/src/vboxdrv clean
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for d in $(wildcard /lib/modules/*); do \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if [ -L $$d/build ]; then \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte make -C $(builddir)/bin/src/vboxdrv KERN_DIR=$$d/build MODULE_DIR=$$d clean && \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte make -j4 -C $(builddir)/bin/src/vboxdrv KBUILD_VERBOSE= KERN_DIR=$$d/build MODULE_DIR=$$d all \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(instmod),&& install -D -m 0644 -g 0 -o 0 \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(builddir)/bin/src/vboxdrv/vboxdrv.ko $(moddir)/$$(basename $$d)/vboxdrv.ko); \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte make -C $(builddir)/bin/src/vboxnetflt KERN_DIR=$$d/build MODULE_DIR=$$d clean && \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (cp $(builddir)/bin/src/vboxdrv/Module.symvers $(builddir)/bin/src/vboxnetflt || true) && \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte make -j4 -C $(builddir)/bin/src/vboxnetflt KBUILD_VERBOSE= KERN_DIR=$$d/build MODULE_DIR=$$d all \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(instmod),&& install -D -m 0644 -g 0 -o 0 \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(builddir)/bin/src/vboxnetflt/vboxnetflt.ko $(moddir)/$$(basename $$d)/vboxnetflt.ko); \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte make -C $(builddir)/bin/src/vboxnetadp KERN_DIR=$$d/build MODULE_DIR=$$d clean && \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (cp $(builddir)/bin/src/vboxdrv/Module.symvers $(builddir)/bin/src/vboxnetadp || true) && \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte make -j4 -C $(builddir)/bin/src/vboxnetadp KBUILD_VERBOSE= KERN_DIR=$$d/build MODULE_DIR=$$d all \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(instmod),&& install -D -m 0644 -g 0 -o 0 \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(builddir)/bin/src/vboxnetadp/vboxnetadp.ko $(moddir)/$$(basename $$d)/vboxnetadp.ko); \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fi; \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte done
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte make -C $(builddir)/bin/src/vboxdrv clean
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte make -C $(builddir)/bin/src/vboxnetflt clean
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte make -C $(builddir)/bin/src/vboxnetadp clean
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte touch debian/modules-stamp
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteclean:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_testdir
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_testroot
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rm -f debian/preinst debian/postinst debian/prerm
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rm -f debian/$(package).init debian/vboxdrv.init
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rm -f debian/vboxballoonctrl-service.init debian/vboxweb-service.init
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rm -f debian/AutoConfig.kmk debian/configure.log debian/env.sh
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rm -f debian/modules-stamp debian/build-stamp debian/configure-stamp
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rm -f debian/virtualbox-*.substvars debian/virtualbox*.debhelper
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rm -f debian/$(verpkg).mime
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rm -rf $(builddir) $(moddir)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_clean
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteifeq ($(VBOX_VERSION_MAJOR),)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortebinary binary-arch binary-indep: build $(verfile)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(MAKE) -f debian/rules binary
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteelse
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Build architecture-dependent files here.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortebinary binary-arch binary-indep: build $(if $(NOMODS),,modules)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_testdir
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_testroot
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_clean -k
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_installdirs
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte tar -xjC $(prefix)/opt -f $(builddir)/bin/VirtualBox.tar.bz2
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte install -d -g 0 -o 0 $(prefix)/usr/share/applications
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte install -d -g 0 -o 0 $(prefix)/usr/lib
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte install -d -g 0 -o 0 $(prefix)/usr/bin
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte install -d -g 0 -o 0 $(prefix)/usr/lib/$(package)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte install -d -g 0 -o 0 $(prefix)/usr/share/$(package)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte install -d -g 0 -o 0 $(prefix)/usr/share/doc/$(verpkg)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(NOQT),,mv $(archdir)/virtualbox.desktop \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(prefix)/usr/share/applications/virtualbox.desktop)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte install -d -g 0 -o 0 $(prefix)/usr/share/pixmaps
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte install -d -g 0 -o 0 $(prefix)/usr/share/icons/hicolor
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte cd $(archdir)/icons; for i in *; do \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if [ -f $$i/virtualbox.png ]; then \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte install -d -g 0 -o 0 $(prefix)/usr/share/icons/hicolor/$$i/apps; \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $$i/virtualbox.png $(prefix)/usr/share/icons/hicolor/$$i/apps; \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fi; \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte install -d -g 0 -o 0 $(prefix)/usr/share/icons/hicolor/$$i/mimetypes; \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $$i/* $(prefix)/usr/share/icons/hicolor/$$i/mimetypes || true; \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rmdir $$i; \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte done
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rmdir $(archdir)/icons
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte install -d -g 0 -o 0 $(prefix)/usr/lib/$(package)/ExtensionPacks
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $(archdir)/virtualbox.xml debian/$(verpkg).sharedmimeinfo
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte install -d -g 0 -o 0 $(prefix)/usr/share/lintian/overrides
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sed \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte -e 's|%VERPKG%|$(verpkg)|g' \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte debian/lintian-override.in > \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(prefix)/usr/share/lintian/overrides/$(verpkg)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $(archdir)/VBoxEFI32.fd $(prefix)/usr/lib/$(package)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $(archdir)/VBoxEFI64.fd $(prefix)/usr/lib/$(package)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $(archdir)/VBox.png \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(prefix)/usr/share/pixmaps/VBox.png
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $(archdir)/*.gc $(prefix)/usr/lib/$(package)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $(archdir)/*.r0 $(prefix)/usr/lib/$(package)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $(archdir)/*.rel $(prefix)/usr/lib/$(package) || true
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $(archdir)/VBoxNetDHCP $(prefix)/usr/lib/$(package)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $(archdir)/VBoxNetAdpCtl $(prefix)/usr/lib/$(package)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $(archdir)/VBoxXPCOMIPCD $(prefix)/usr/lib/$(package)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $(archdir)/components $(prefix)/usr/lib/$(package)/components
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $(archdir)/*.so $(prefix)/usr/lib/$(package)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $(archdir)/*.so.4 $(prefix)/usr/lib/$(package) || true
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(NOQT),,mv $(archdir)/VBoxTestOGL $(prefix)/usr/lib/$(package))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(NOQT),,mv $(archdir)/nls $(prefix)/usr/share/$(package))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $(archdir)/src $(prefix)/usr/share/$(package)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rm $(archdir)/VBox.sh
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte export VBOX_INSTALL_PATH=/usr/lib/$(package) && \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte cd ./debian/builddir/bin/sdk/installer && \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte python ./vboxapisetup.py install --root $(prefix)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rm -rf $(archdir)/sdk/installer
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $(archdir)/vboxshell.py $(prefix)/usr/lib/$(package)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $(archdir)/sdk $(prefix)/usr/lib/$(package)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte install -D -g 0 -o 0 -m 644 $(vboxroot)/src/VBox/Installer/linux/debian/VBox.sh $(prefix)/usr/bin/VBox
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $(archdir)/VBoxSysInfo.sh $(prefix)/usr/share/$(package)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $(archdir)/VBoxCreateUSBNode.sh $(prefix)/usr/share/$(package)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for i in VBoxManage VBoxSVC $(if $(HEADLESS),,VBoxSDL) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(NOQT),,VirtualBox) VBoxHeadless \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte VBoxExtPackHelperApp VBoxBalloonCtrl \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(NOWEBSVC),,vboxwebsrv webtest); do \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $(archdir)/$$i $(prefix)/usr/lib/$(package); done
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $(archdir)/VBoxTunctl $(prefix)/usr/bin
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(NOMODS),,for d in $(moddir)/*; do \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if [ -f $$d/vboxdrv.ko -a -f $$d/vboxnetflt.ko -a -f $$d/vboxnetadp.ko ]; then \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte install -D -g 0 -o 0 -m 0644 \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $$d/vboxdrv.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxdrv.ko; \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte install -D -g 0 -o 0 -m 0644 \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $$d/vboxnetflt.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxnetflt.ko; \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte install -D -g 0 -o 0 -m 0644 \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $$d/vboxnetadp.ko $(prefix)/lib/modules/$$(basename $$d)/misc/vboxnetadp.ko; \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fi \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte done)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteifeq ($(ose),)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(NOQT),,mv $(archdir)/kchmviewer $(prefix)/usr/lib/$(package))
3270659f55e0928d6edec3d26217cc29398a8149Srikanth, Ramana dh_installdocs \
3270659f55e0928d6edec3d26217cc29398a8149Srikanth, Ramana $(archdir)/UserManual*.pdf $(archdir)/VirtualBox*.chm \
3270659f55e0928d6edec3d26217cc29398a8149Srikanth, Ramana $(addprefix $(archdir)/, LICENSE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rm $(addprefix $(archdir)/,UserManual*.pdf VirtualBox*.chm \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte LICENSE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for i in rdesktop-vrdp.tar.gz additions/VBoxGuestAdditions.iso; do \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $(archdir)/$$i $(prefix)/usr/share/$(package); done
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(HEADLESS),,mv $(archdir)/rdesktop-vrdp $(prefix)/usr/bin)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(HEADLESS),,mv $(archdir)/rdesktop-vrdp-keymaps $(prefix)/usr/share/$(package))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if [ -d $(archdir)/accessible ]; then mv $(archdir)/accessible $(prefix)/usr/lib/virtualbox; fi
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteelse
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_installdocs \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(archdir)/UserManual*.pdf
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rm $(addprefix $(archdir)/,UserManual*.pdf)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for i in additions/VBoxGuestAdditions.iso; do \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $(archdir)/$$i $(prefix)/usr/share/$(package); done
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteendif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rmdir $(archdir)/additions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rmdir $(archdir)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rmdir $(prefix)/opt
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_link \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(NOQT),,usr/bin/VBox usr/bin/VirtualBox) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(NOQT),,usr/bin/VBox usr/bin/virtualbox) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte usr/bin/VBox usr/bin/VBoxManage \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte usr/bin/VBox usr/bin/vboxmanage \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(HEADLESS),,usr/bin/VBox usr/bin/VBoxSDL) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(HEADLESS),,usr/bin/VBox usr/bin/vboxsdl) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(ose),,usr/bin/VBox usr/bin/VBoxVRDP) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte usr/bin/VBox usr/bin/VBoxHeadless \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte usr/bin/VBox usr/bin/vboxheadless \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte usr/bin/VBox usr/bin/VBoxBalloonCtrl \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte usr/bin/VBox usr/bin/vboxballoonctrl \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(NOWEBSVC),,usr/bin/VBox usr/bin/vboxwebsrv) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte usr/share/virtualbox/src/vboxhost usr/src/vboxhost-$(ver)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_desktop
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(if $(NOMODS),,dh_installmodules)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sed \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte -e 's|%NOLSB%||g' \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte -e 's|%DEBIAN%|yes|g' \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte -e 's|%PACKAGE%|virtualbox|g' \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte -e "s|%GROUP%|$(if $(VBOX_WITHOUT_HARDENING),vboxusers,root)|g" \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(vboxroot)/src/VBox/Installer/linux/vboxdrv.sh.in > debian/vboxdrv.init
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_installinit --name=vboxdrv --noscripts
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sed \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte -e 's|%NOLSB%||g' \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte -e 's|%DEBIAN%|yes|g' \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte -e 's|%PACKAGE%|virtualbox|g' \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(vboxroot)/src/VBox/Installer/linux/vboxballoonctrl-service.sh.in > debian/vboxballoonctrl-service.init
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_installinit --name=vboxballoonctrl-service --noscripts
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sed \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte -e 's|%NOLSB%||g' \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte -e 's|%DEBIAN%|yes|g' \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte -e 's|%PACKAGE%|virtualbox|g' \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(vboxroot)/src/VBox/Installer/linux/vboxweb-service.sh.in > debian/vboxweb-service.init
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_installinit --name=vboxweb-service --noscripts
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte cat debian/preinst.in | sed -e 's|%VER%|$(ver)|g' > debian/preinst
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte cat debian/prerm.in | sed -e 's|%VER%|$(ver)|g' > debian/prerm
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte cat debian/postinst.in | sed -e 's|%VER%|$(ver)|g' > debian/postinst
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_installdebconf
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_installchangelogs
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_installmenu
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_installmime
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_link
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteifeq ($(DEBUG),)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_strip --keep-debug --exclude=libQtCoreVBox.so.4 --exclude=libQtGuiVBox.so.4 --exclude=libQtNetworkVBox.so.4 --exclude=libQtOpenGLVBox.so.4 --exclude=libqtaccessiblewidgets.so
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # manually strip our R0/GC modules, dh_strip cannot handle them
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for f in \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(prefix)/usr/lib/$(package)/*.r0 $(prefix)/usr/lib/$(package)/*.gc; do \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte objcopy --only-keep-debug \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $$f \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(prefix)/usr/lib/debug/usr/lib/$(package)/`basename $$f`; \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte strip -S --remove-section=.comment $$f; \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte objcopy --add-gnu-debuglink=$(prefix)/usr/lib/debug/usr/lib/$(package)/`basename $$f` $$f; \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte done
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteendif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mkdir -p $(current)/debian/$(verpkg)-dbg/usr/lib
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteifeq ($(DEBUG),)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mv $(current)/debian/$(verpkg)/usr/lib/debug $(current)/debian/$(verpkg)-dbg/usr/lib
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteendif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_pycentral
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_compress -X.pdf -X.chm -X LICENSE -X.py
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_fixperms
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_makeshlibs
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_installdeb
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_perl
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_shlibdeps
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_gencontrol -- \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte -Valsa=$(if $(HEADLESS),,libasound2) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte -Vpulse=$(if $(HEADLESS),,libpulse0) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte -Vsdlttf=$(if $(HEADLESS),,libsdl-ttf2.0-0) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte -Vdkms=$(if $(filter _Debian_etch _Debian_lenny,$(debrel)),,dkms)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_md5sums
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dh_builddeb --destdir $(pkgdir)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteendif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte.PHONY: binary modules binary-arch binary-indep clean checkroot
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte