File oracleasm.spec of Package oracleasm

#
# spec file for package oracleasm
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# nodebuginfo


# needssslcertforbuild

Name:           oracleasm
Url:            http://oss.oracle.com/projects/oracleasm/
Version:        2.0.8
Release:        0
Summary:        Kernel driver backing the Generic Linux ASM Library
License:        GPL-2.0
Group:          System/Kernel
Source1:        Module.supported
Patch0:         ASMLib_SLE12.txt
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       oracleasm-kmp
BuildRequires:  kernel-syms
BuildRequires:  module-init-tools
%ifarch %ix86 x86_64
#BuildRequires:  kernel-syms-rt
%endif
%suse_kernel_module_package kdump um

%description
This package provides kernel module for ASMLib. You need oracleasmlib
and oracleasm-support package to use this.



Authors:
--------
    Joel Becker <joel.becker@oracle.com>

%package KMP
Summary:        Kernel driver backing the Generic Linux ASM Library
Group:          System/Kernel

%description KMP
This package provides KMP modules for oracleasm. You need oracleasmlib
and oracleasm-support package to use this.



%prep
%define subdir drivers/block/oracleasm
%setup -cT
%patch0 -p1
cp %_sourcedir/Module.supported %subdir/Module.supported
set -- *
mkdir source
mv "$@" source/
mkdir obj

%build
export CONFIG_ORACLEASM=m
for flavor in %flavors_to_build; do
	rm -rf obj/$flavor
	cp -r source obj/$flavor
	make %{?_smp_mflags} -C /usr/src/linux-obj/%_target_cpu/$flavor \
		M=$PWD/obj/$flavor/%subdir \
		KCPPFLAGS="-I$PWD/obj/$flavor/include" \
		modules
done

%install
export CONFIG_ORACLEASM=m
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
export INSTALL_MOD_DIR=updates
export BRP_PESIGN_FILES="*.ko /lib/firmware"
for flavor in %flavors_to_build; do
	make -C /usr/src/linux-obj/%_target_cpu/$flavor \
		modules_install M=$PWD/obj/$flavor/%subdir
done

%changelog