rules revision f1517b3016a7e68a8edb55ea82c704af7386c9ad
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Copyright (C) 2006-2012 Oracle Corporation
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# 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
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# 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# NOMODS=1 don't build any module
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# NOQT=1 don't build the Qt GUI
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# EFI=1 include the EFI binary from prebuild
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# VERSUFFIX=<suffix> set a particular package version suffix (e.g. _customer)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# HEADLESS=1 build the headless version
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# VNC=1 build VNC code
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
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# PKGDIR=<path> where to store the final package(s)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# BLEEDING_EDGE=xyz
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte$(error call rpm/rules from src/VBox/Installer/linux)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteifneq ($(wildcard /usr/lib/rpm/find-requires.ksyms),)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# don't allow to check for kernel syms, otherwise we depend on specific kernel versions!
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte$(error /usr/lib/rpm/find-requires.ksyms must not be installed)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteifneq ($(wildcard /usr/lib/rpm/find-supplements.ksyms),)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# same for openSUSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte$(error /usr/lib/rpm/find-supplements.ksyms must not be installed)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteifeq ($(shell if grep -q '^/usr/lib/virtualbox' /etc/permissions* 2>/dev/null; then echo yes; fi),yes)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# make sure openSUSE permissions fixes don't interfere with us
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteifeq ($(shell if grep -q '^%disttag' /usr/lib/rpm/macros.d/mandriva 2>/dev/null; then echo yes; fi),yes)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortepkgdir := $(if $(PKGDIR),$(PKGDIR),$(shell cd ../../../../..; pwd))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forterpmlib := $(shell if [ `uname -m` = "x86_64" ]; then echo "lib64"; else echo "lib"; fi)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortearch := $(shell if [ `uname -m` = "x86_64" ]; then echo "amd64"; else echo "i386"; fi)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteose := $(if $(OSE),1,$(if $(wildcard $(vboxroot)/src/VBox/RDP/server),,1))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteNOWINE := $(if $(NODOCS),$(if $(STAGEDISO),1,),)$(ose)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # look for fedora
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rpmrel := $(shell cat /etc/fedora-release | sed -e 's/^Fedora *release *\([1-9][0-9]*\) .*/fedora\1/')
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(error failed to detect the release type. Add /etc/distname or hack the detection.)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rpmdist := $(strip $(shell grep $(rpmrel) $(current)/distributions_rpm | cut -d'=' -f2))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(error Cannot detect package distribution (rpmrel=$(rpmrel)))
ifeq ($(filter-out rhel4 rhel5 rhel6 ol4 ol5 ol6 centos4 centos5 centos6 fedora9 fedora11 fedora12 fedora13 fedora14 fedora15 fedora16 fedora17 turbolinux11,$(rpmrel)),)
ifeq ($(filter-out openSUSE110 openSUSE111 openSUSE112 openSUSE113 openSUSE114 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 rhel4 rhel5 rhel6 ol4 ol5 ol6 centos4 centos5 centos6 sles10.1 sles11.0 fedora13 fedora14 fedora15 fedora16 fedora17,$(rpmrel)),,install_rpm)
$(if $(filter rhel4 rhel5 ol4 ol5 centos4 centos5 sles10.1 turbolinux11,$(rpmrel)),--with-qt4-dir=/home/vbox/Qt-4.7.4-stdc++6-$(arch)) \
$(doc_dir) \
$(if $(filter rhel4 rhel5 ol4 ol5 centos4 centos5 fedora9 fedora10 sles10.1 turbolinux11,$(rpmrel)),,VBOX_WITH_SYSFS_BY_DEFAULT=1)
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 \
sed \
sed \
(cd rpm; rpmbuild -tb --clean VirtualBox.tar.bz2)