rules revision 2c691730ab202620fe427110841aa4e0075b7cca
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# Copyright (C) 2006-2010 Oracle Corporation
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# This file is part of VirtualBox Open Source Edition (OSE), as
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# available from http://www.virtualbox.org. This file is free software;
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# you can redistribute it and/or modify it under the terms of the GNU
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# General Public License as published by the Free Software Foundation,
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# distribution. VirtualBox OSE is distributed in the hope that it will
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# be useful, but WITHOUT ANY WARRANTY of any kind.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy$(error call rpm/rules from src/VBox/Installer/linux)
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyifneq ($(wildcard /usr/lib/rpm/find-requires.ksyms),)
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# don't allow to check for kernel syms, otherwise we depend on specific kernel versions!
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy$(error /usr/lib/rpm/find-requires.ksyms must not be installed)
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyifneq ($(wildcard /usr/lib/rpm/find-supplements.ksyms),)
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# same for openSUSE
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy$(error /usr/lib/rpm/find-supplements.ksyms must not be installed)
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyifeq ($(shell if grep -q '^/usr/lib/virtualbox' /etc/permissions* 2>/dev/null; then echo yes; fi),yes)
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# make sure openSUSE permissions fixes don't interfere with us
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedypkgdir := $(if $(PKGDIR),$(PKGDIR),$(shell cd ../../../../..; pwd))
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyrpmlib := $(shell if [ `uname -m` = "x86_64" ]; then echo "lib64"; else echo "lib"; fi)
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyarch := $(shell if [ `uname -m` = "x86_64" ]; then echo "amd64"; else echo "i386"; fi)
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyverfile := $(builddir)/version-generated.mk
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedysvnrev :=$(if $(svn_revision),$(svn_revision),0)
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy # look for fedora
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy rpmrel := $(shell cat /etc/fedora-release | sed -e 's/^Fedora *release *\([1-9][0-9]*\) .*/fedora\1/')
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy $(error failed to detect the release type. Add /etc/distname or hack the detection.)
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy rpmdist := $(strip $(shell grep $(rpmrel) $(current)/distributions_rpm | cut -d'=' -f2))
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy $(error Cannot detect package distribution (rpmrel=$(rpmrel)))
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy ifeq ($(filter-out rhel4 rhel5 rhel6 fedora9 fedora11 fedora12 fedora13 fedora14 pclinuxos2007 turbolinux11,$(rpmrel)),)
e9316f7696401f3e5e263a5939031cb8d5641a88Joe Stein ifeq ($(filter-out openSUSE110 openSUSE111 openSUSE112 openSUSE113 sles10.1 sles11.0,$(rpmrel)),)
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy ifeq ($(filter-out mdv2009.1 mdv2010.0,$(rpmrel)),)
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy $(error failed to detect the .spec file (rpmrel=$(rpmrel)))
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy . rpm/env.sh && kmk -C $(vboxroot) $(bld_flags) $(verfile)
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyrpmver :=$(ver)$(if $(NOSUBVER),,$(if $(svn_revision),_$(svn_revision),)$(VERSUFFIX)$(if $(DEBUG),_dbg,))$(if $(BLEEDING_EDGE),_$(BLEEDING_EDGE),)
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyarchdir := $(current)/rpm/VirtualBox-$(ver)
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# Fedora13/14 is bleeding edge, the other jails have outdated kernel headers
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyinstmod := $(if $(filter rhel4 rhel5 rhel6 sles10.1 sles11.0 pclinuxos2007 fedora13 fedora14,$(rpmrel)),,install_rpm)
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),)
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy$(error STAGEDISO='$(STAGEDISO)/VBoxGuestAdditions.iso' not found)
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyifeq ($(wildcard /usr/share/doc/packages/bash),)
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy # Mandriva 2007.1, Redhat
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy doc_dir := VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/$(rpmname)\""
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy # Mandriva 2008.0
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy doc_dir := VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/$(verpkg)\""
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy # Novell (OpenSUSE, SLES)
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy doc_dir := VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/packages/$(verpkg)\""
$(if $(filter rhel4 rhel5 sles10.1 turbolinux11,$(rpmrel)),--with-qt4-dir=/home/vbox/Qt-4.4.3-stdc++6-$(arch)) \
$(doc_dir) \
$(if $(filter rhel4 rhel5 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' \
sed \
sed \