rules revision 3baadeafd9922582dad9b32431362e6296417dd8
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamford# Copyright (C) 2006-2011 Oracle Corporation
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamford# This file is part of VirtualBox Open Source Edition (OSE), as
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamford# available from http://www.virtualbox.org. This file is free software;
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamford# you can redistribute it and/or modify it under the terms of the GNU
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamford# General Public License as published by the Free Software Foundation,
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamford# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamford# distribution. VirtualBox OSE is distributed in the hope that it will
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamford# be useful, but WITHOUT ANY WARRANTY of any kind.
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamford$(error call rpm/rules from src/VBox/Installer/linux)
582e60f5478cf04cad2b208c3e8013fef3617942Jaco Joosteifneq ($(wildcard /usr/lib/rpm/find-requires.ksyms),)
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamford# don't allow to check for kernel syms, otherwise we depend on specific kernel versions!
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamford$(error /usr/lib/rpm/find-requires.ksyms must not be installed)
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamfordifneq ($(wildcard /usr/lib/rpm/find-supplements.ksyms),)
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamford# same for openSUSE
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamford$(error /usr/lib/rpm/find-supplements.ksyms must not be installed)
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamfordifeq ($(shell if grep -q '^/usr/lib/virtualbox' /etc/permissions* 2>/dev/null; then echo yes; fi),yes)
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamford# make sure openSUSE permissions fixes don't interfere with us
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamfordpkgdir := $(if $(PKGDIR),$(PKGDIR),$(shell cd ../../../../..; pwd))
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamfordrpmlib := $(shell if [ `uname -m` = "x86_64" ]; then echo "lib64"; else echo "lib"; fi)
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamfordarch := $(shell if [ `uname -m` = "x86_64" ]; then echo "amd64"; else echo "i386"; fi)
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamfordsvnrev :=$(if $(svn_revision),$(svn_revision),0)
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamford # look for fedora
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamford rpmrel := $(shell cat /etc/fedora-release | sed -e 's/^Fedora *release *\([1-9][0-9]*\) .*/fedora\1/')
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamford $(error failed to detect the release type. Add /etc/distname or hack the detection.)
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamford rpmdist := $(strip $(shell grep $(rpmrel) $(current)/distributions_rpm | cut -d'=' -f2))
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamford $(error Cannot detect package distribution (rpmrel=$(rpmrel)))
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamford ifeq ($(filter-out rhel4 rhel5 rhel6 ol4 ol5 ol6 centos4 centos5 centos6 fedora9 fedora11 fedora12 fedora13 fedora14 fedora15 fedora16 turbolinux11,$(rpmrel)),)
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamford ifeq ($(filter-out openSUSE110 openSUSE111 openSUSE112 openSUSE113 openSUSE114 sles10.1 sles11.0,$(rpmrel)),)
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamford ifeq ($(filter-out mdv2009.1 mdv2010.0,$(rpmrel)),)
e2c90f7e6a7cd643ed88d1870224e3b91daa8724Tony Bamford $(error failed to detect the .spec file (rpmrel=$(rpmrel)))
rpmver :=$(ver)$(if $(NOSUBVER),,$(if $(svn_revision),_$(svn_revision),)$(VERSUFFIX)$(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,$(rpmrel)),,install_rpm)
$(if $(filter rhel4 rhel5 ol4 ol5 centos4 centos5 sles10.1 turbolinux11,$(rpmrel)),--with-qt4-dir=/home/vbox/Qt-4.4.3-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-utils.sh/ {' \
sed \
sed \
sed \