rules revision e42e8ed08e4b2bd2ebb1b160fea921788e1a54a5
#
# Copyright (C) 2006-2012 Oracle Corporation
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
# possible overrides:
# OSE=1 force VBOX_OSE
# NOPARALLEL=1 compile with -j1
# LINUX=<dir> compile vboxdrv against Linux found in <dir>
# VERBOSE=1 verbose build
# DEBUG=1 debug build
# NOSUBVER=1 disable generation of the sub-version field (which is
# either the subversion rev [if available] or the build date)
# NODOCS=1 don't build docs, use precompiled UserManual.pdf and
# VirtualBox.chm from $HOME
# NOMODS=1 don't build any module
# NOQT=1 don't build the Qt GUI
# EFI=1 include the EFI binary from prebuild
# VERSUFFIX=<suffix> set a particular package version suffix (e.g. _customer)
# HEADLESS=1 build the headless version
# VNC=1 build VNC code
# NOWEBSVC=1 don't build the webservice API, default for OSE
# STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso
# PKGDIR=<path> where to store the final package(s)
# BLEEDING_EDGE=xyz
# don't allow to check for kernel syms, otherwise we depend on specific kernel versions!
# same for openSUSE
ifeq ($(shell if grep -q '^/usr/lib/virtualbox' /etc/permissions* 2>/dev/null; then echo yes; fi),yes)
# make sure openSUSE permissions fixes don't interfere with us
$(error Fix /etc/permissions*)
ifeq ($(shell if grep -q '^%disttag' /usr/lib/rpm/macros.d/mandriva 2>/dev/null; then echo yes; fi),yes)
# look for fedora
rpmrel := $(shell cat /etc/fedora-release | sed -e 's/^Fedora *release *\([1-9][0-9]*\) .*/fedora\1/')
ifeq ($(filter-out el4 el5 el6 ol4 ol5 ol6 centos4 centos5 centos6 fedora9 fedora11 fedora12 fedora13 fedora14 fedora15 fedora16 fedora17 fedora18 turbolinux11,$(rpmrel)),)
ifeq ($(filter-out openSUSE110 openSUSE111 openSUSE112 openSUSE113 openSUSE114 sles10.1 sles11.0,$(rpmrel)),)
# contrary to debian we need the verfile earlier to get the correct rpmname into the bld_flags
ver := $(VBOX_VERSION_STRING)
rpmver :=$(ver)$(if $(NOSUBVER),,$(if $(svn_revision),_$(svn_revision),)$(VERSUFFIX)$(if $(HEADLESS),_headless,)$(if $(DEBUG),_dbg,))$(if $(BLEEDING_EDGE),_$(BLEEDING_EDGE),)
# Fedora13/14 is bleeding edge, the other jails have outdated kernel headers
instmod := $(if $(filter el4 el5 el6 ol4 ol5 ol6 centos4 centos5 centos6 sles10.1 sles11.0 mdv2010.0 fedora13 fedora14 fedora15 fedora16 fedora17 fedora18,$(rpmrel)),,install_rpm)
# Mandriva 2007.1, Redhat
else
# Mandriva 2008.0
else
# Novell (OpenSUSE, SLES)
$(if $(filter el4 el5 ol4 ol5 centos4 centos5 mdv2010.0 sles10.1 sles11.0 turbolinux11,$(rpmrel)),--with-qt4-dir=/home/vbox/Qt-4.7.4-stdc++6-$(arch)) \
$(doc_dir) \
VBOX_PACKAGE_DIST=$(rpmdist) \
VBOX_SVN_REV=$(svnrev) \
$(if $(filter el4 el5 ol4 ol5 centos4 centos5 fedora9 fedora10 sles10.1 turbolinux11,$(rpmrel)),,VBOX_WITH_SYSFS_BY_DEFAULT=1)
else
sed \
-e 's|%VER%|$(ver)|g' \
-e 's|%NAME%|$(verpkg)|g' \
-e 's|%BUILDVER%|$(rpmver)|g' \
-e 's|%BUILDREL%|$(rpmrel)|g' \
-e 's|%LIB%|$(rpmlib)|g' \
-e 's|%OSE%|$(if $(ose),is_ose,not_ose)|g' \
-e 's|%SPEC%|$(rpmspec)|g' \
-e 's|%MACROSPYTHON%|$(if $(wildcard /usr/lib/rpm/macros.python),%include /usr/lib/rpm/macros.python,)|g' \
-e 's|%INSTMOD%|$(instmod)|g' \
-e 's|%LIBASOUND%|$(if $(filter lib64,$(rpmlib)),libasound.so.2()(64bit),libasound.so.2)|g' \
-e 's|%INITSCRIPTS%|$(if $(filter fedora,$(rpmspec)),initscripts,)|g' \
-e '/#include installer-common.sh/ {' \
-e 'd' \
-e '}' \
sed \
-e 's|%NOLSB%|yes|g' \
-e 's|%DEBIAN%||g' \
-e 's|%PACKAGE%|virtualbox|g' \
(cd rpm; rpmbuild -tb --clean VirtualBox.tar.bz2)