rules revision 2da06c2eb59b63010b1998799c719272c0be0f99
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# Copyright (C) 2006-2012 Oracle Corporation
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# This file is part of VirtualBox Open Source Edition (OSE), as
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# available from http://www.virtualbox.org. This file is free software;
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# you can redistribute it and/or modify it under the terms of the GNU
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# General Public License (GPL) as published by the Free Software
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# Foundation, in version 2 as it comes in the "COPYING" file of the
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# possible overrides:
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# OSE=1 force VBOX_OSE
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# NOPARALLEL=1 compile with -j1
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# LINUX=<dir> compile vboxdrv against Linux found in <dir>
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# VERBOSE=1 verbose build
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# DEBUG=1 debug build
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# NOSUBVER=1 disable generation of the sub-version field (which is
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# either the subversion rev [if available] or the build date)
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# NODOCS=1 don't build docs, use precompiled UserManual.pdf and
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# NOMODS=1 don't build any module
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# NOQT=1 don't build the Qt GUI
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# EFI=1 include the EFI binary from prebuild
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# VERSUFFIX=<suffix> set a particular package version suffix (e.g. _customer)
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# HEADLESS=1 build the headless version
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# VNC=1 build VNC code
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# NOWEBSVC=1 don't build the webservice API, default for OSE
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# PKGDIR=<path> where to store the final package(s)
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana# BLEEDING_EDGE=xyz
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushana$(error call rpm/rules from src/VBox/Installer/linux)
56b2bdd1f04d465cfe4a95b88ae5cba5884154e4Gireesh Nagabhushanaifneq ($(wildcard /usr/lib/rpm/find-requires.ksyms),)
ifeq ($(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 fedora15 fedora16 fedora17 fedora18,$(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)