File brocade-bfa.spec of Package brocade-bfa

#
# spec file for package brocade-bfa (Version 1.1.0.2)
#
# Copyright (c) 2009 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/
#

# norootforbuild


Name:           brocade-bfa
BuildRequires:  kernel-source kernel-syms module-init-tools
ExcludeArch:    ppc ppc64 s390 s390x
License:        GPL v2 only
Group:          System/Kernel
Summary:        Brocade bfa Kernel Module Package
Version:        1.1.0.2
Release:        1.<RELEASE8>
Source0:        %name-%version.tar.gz
Source1:        LICENSE.bfa
Source2:        gpl-2.0.txt
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%suse_kernel_module_package kdump um ec2

%description
This is a Kernel Module Package for the Brocade FC HBA driver.



Authors:
--------
    Jing Huang
    Philip Oswald

%package KMP
License:        GPL v2 only
Summary:        Brocade bfa Kernel Module Package
Group:          System/Kernel

%description KMP
This is a Kernel Module Package for the Brocade FC HBA driver.



%prep
%setup
set -- *
mkdir source
mv "$@" source/
echo "bfa.ko external" > source/Module.supported
cp %_sourcedir/LICENSE.bfa source/LICENSE.bfa
mkdir obj

%build
export EXTRA_CFLAGS='-DVERSION=\"%version\"'
for flavor in %flavors_to_build; do
    rm -rf obj/$flavor
    cp -r source obj/$flavor
    make -C /usr/src/linux-obj/%_target_cpu/$flavor modules \
	M=$PWD/obj/$flavor
done

%install
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
export INSTALL_MOD_DIR=updates
for flavor in %flavors_to_build; do
    make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install \
	 M=$PWD/obj/$flavor
    install -m755 -d $RPM_BUILD_ROOT/usr/share/doc/bfa
    install -m644 $PWD/obj/$flavor/LICENSE.bfa \
            $RPM_BUILD_ROOT/usr/share/doc/bfa/LICENSE.bfa
    install -m644 %SOURCE2 $RPM_BUILD_ROOT/usr/share/doc/bfa/
done

%files
%defattr(-,root,root)
%doc /usr/share/doc/bfa

%changelog
openSUSE Build Service is sponsored by