rules revision 965aac4e5f942cc0ff08644b8de0394e0712cd79
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# Copyright (C) 2006-2012 Oracle Corporation
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# available from http://www.virtualbox.org. This file is free software;
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# you can redistribute it and/or modify it under the terms of the GNU
54259e443abcd8197f7c3158bb7f69457ca1d1davboxsync# General Public License (GPL) as published by the Free Software
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
2581ea3f1f32d09a6e2d443661ed4b01e40bfefavboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# possible overrides:
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# OSE=1 force VBOX_OSE
79dc091db288c096b6e03888a095477ded84f503vboxsync# NOPARALLEL=1 compile with -j1
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# LINUX=<dir> compile vboxdrv against Linux found in <dir>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# VERBOSE=1 verbose build
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# DEBUG=1 debug build
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# NOSUBVER=1 disable generation of the sub-version field (which is
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# either the subversion rev [if available] or the build date)
01841c69bef459b750890a41141d55401d92f5d4vboxsync# NODOCS=1 don't build docs, use precompiled UserManual.pdf and
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# NOMODS=1 don't build any module
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# NOQT=1 don't build the Qt GUI
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# EFI=1 include the EFI binary from prebuild
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# VERSUFFIX=<suffix> set a particular package version suffix (e.g. _customer)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# HEADLESS=1 build the headless version
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# VNC=1 build VNC code
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# NOWEBSVC=1 don't build the webservice API, default for OSE
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# PKGDIR=<path> where to store the final package(s)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# BLEEDING_EDGE=xyz
79dc091db288c096b6e03888a095477ded84f503vboxsync$(error call rpm/rules from src/VBox/Installer/linux)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncifneq ($(wildcard /usr/lib/rpm/find-requires.ksyms),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# don't allow to check for kernel syms, otherwise we depend on specific kernel versions!
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync$(error /usr/lib/rpm/find-requires.ksyms must not be installed)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncifneq ($(wildcard /usr/lib/rpm/find-supplements.ksyms),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# same for openSUSE
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync$(error /usr/lib/rpm/find-supplements.ksyms must not be installed)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncifeq ($(shell if grep -q '^/usr/lib/virtualbox' /etc/permissions* 2>/dev/null; then echo yes; fi),yes)
$(error Fix /etc/permissions*)
ifeq ($(shell if grep -q '^%disttag' /usr/lib/rpm/macros.d/mandriva 2>/dev/null; then echo yes; fi),yes)
rpmrel := $(shell cat /etc/fedora-release | sed -e 's/^Fedora *release *\([1-9][0-9]*\) .*/fedora\1/')
ifeq ($(filter-out el5 el6 ol5 ol6 el7 centos5 centos6 fedora17 fedora18 fedora19 fedora20 fedora21 fedora22,$(rpmrel)),)
ifeq ($(filter-out openSUSE110 openSUSE111 openSUSE112 openSUSE113 openSUSE114 openSUSE123 sles10.1 sles11.0,$(rpmrel)),)
rpmver :=$(ver)$(if $(NOSUBVER),,$(if $(svn_revision),_$(svn_revision),)$(VERSUFFIX)$(if $(HEADLESS),_headless,)$(if $(DEBUG),_dbg,))$(if $(BLEEDING_EDGE),_$(BLEEDING_EDGE),)
instmod :=
$(if $(filter el5 ol5 centos5 sles10.1 sles11.0,$(rpmrel)),--with-qt4-dir=/home/vbox/Qt-4.7.4-stdc++6-$(arch)) \
$(doc_dir) \
sed \
-e 's|%MACROSPYTHON%|$(if $(wildcard /usr/lib/rpm/macros.python),%include /usr/lib/rpm/macros.python,)|g' \
-e 's|%LIBASOUND%|$(if $(filter lib64,$(rpmlib)),libasound.so.2()(64bit),libasound.so.2)|g' \
-e '/#include installer-common.sh/ {' \
sed \
(cd rpm; rpmbuild -tb --clean VirtualBox.tar.bz2)