File broadcom-wl.spec of Package broadcom-wl

#
# spec file for package broadcom-wl
#
# 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/
#


%define underversion 6_30_223_248
%ifarch x86_64
%define driverarch _64
%else
%define driverarch %{nil}
%endif
Name:           broadcom-wl
Version:        6.30.223.248
Release:        0
Summary:        Wireless driver for Broadcom 43xx series of chips
License:        Proprietary
Group:          System/Kernel
Url:            http://www.broadcom.com/support/802.11/linux_sta.php
Source0:        http://www.broadcom.com/docs/linux_sta/hybrid-v35%{driverarch}-nodebug-pcoem-%{underversion}.tar.gz
Source1:        README.SuSE
Source2:        broadcom-wl-blacklist
Patch0:         %{name}-6_30_223_248-linux-4.x.patch 
Patch1:         %{name}-6_30_223_248-gcc-49.patch
Patch2:			%{name}-6_30_223_248-disable-timestamps.patch
BuildRequires:  kernel-source
BuildRequires:  kernel-syms
BuildRequires:  module-init-tools
Requires:       broadcom-wl-kmp
Provides:       wl-kmod-common = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExclusiveArch:  %ix86 x86_64
%suse_kernel_module_package -p %{_sourcedir}/broadcom-wl-preamble kdump um ec2

%description
These packages contain Broadcom's IEEE 802.11a/b/g/n hybrid Linux®
device driver for use with Broadcom's BCM4311-, BCM4312-, BCM4321-,
and BCM4322-based hardware.

NOTE:           You must read the LICENSE.TXT file  before using this software.

%package KMP
Summary:        Wireless driver for Broadcom 43xx series of chips
Group:          System/Kernel

%description KMP
These packages contain Broadcom's IEEE 802.11a/b/g/n hybrid Linux®
device driver for use with Broadcom's BCM4311-, BCM4312-, BCM4321-,
and BCM4322-based hardware.

NOTE:           You must read the LICENSE.TXT file  before using this software.

%prep
%setup -q -c hybrid-v35%{driverarch}-nodebug-pcoem-%{underversion}
%patch0 -p1
%patch1 -p1
%patch2 -p1

sed -i 's/\r$//' lib/LICENSE.txt

set -- *
mkdir source
mv "$@" source/
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 %{_prefix}/src/linux-obj/%{_target_cpu}/$flavor modules \
       M=$PWD/obj/$flavor V=1
done

%install
# blacklist
mkdir -p %{buildroot}%{_sysconfdir}/modprobe.d/
mkdir -p %{buildroot}%{_docdir}/%{name}/
install -p -m0644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/modprobe.d/
install -p -m0644 %{SOURCE1} %{buildroot}%{_docdir}/%{name}/
install -p -m0644 source/lib/LICENSE.txt %{buildroot}%{_docdir}/%{name}/

%if 0%{?suse_version} >= 1120
mv %{buildroot}/%{_sysconfdir}/modprobe.d/broadcom-wl-blacklist %{buildroot}/%{_sysconfdir}/modprobe.d/50-broadcom-wl-blacklist.conf
%endif

# Kernel module
export INSTALL_MOD_PATH=%{buildroot}
export INSTALL_MOD_DIR=updates
for flavor in %{flavors_to_build}; do
     make -C %{_prefix}/src/linux-obj/%{_target_cpu}/$flavor modules_install \
        M=$PWD/obj/$flavor
done

%files
%defattr(-,root,root)
%doc %dir %{_docdir}/%{name}
%doc %{_docdir}/%{name}/LICENSE.txt
%doc %{_docdir}/%{name}/README.SuSE
%if 0%{?suse_version} >= 1120
%config(noreplace) %{_sysconfdir}/modprobe.d/50-broadcom-wl-blacklist.conf
%else
%config(noreplace) %{_sysconfdir}/modprobe.d/broadcom-wl-blacklist
%endif

%changelog
openSUSE Build Service is sponsored by