File ndiswrapper.spec of Package ndiswrapper

#
# spec file for package ndiswrapper
#
# Copyright (c) 2011 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/
#



Name:           ndiswrapper
Version:        1.56
Release:        3
License:        GPLv2+
Summary:        Use Microsoft NDIS Network Drivers for WLAN Cards
Url:            http://ndiswrapper.sourceforge.net
Group:          System/Kernel
Source0:        %{name}-%{version}.tar.bz2
Source2:        README.SUSE
Source3:        preamble
Patch0:         ndiswrapper.diff
Patch1:         ndiswrapper-2.6.35.patch
Patch2:         ndiswrapper-2.6.38.patch
Patch3:         ndiswrapper-3.0.patch
BuildRequires:  kernel-source
BuildRequires:  kernel-syms
BuildRequires:  module-init-tools
Requires:       ndiswrapper-kmp
Requires:       pciutils
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExclusiveArch:  %ix86 x86_64
%suse_kernel_module_package -p %_sourcedir/preamble kdump um debug xen

%description
Some wireless LAN vendors refuse to release hardware specifications or
drivers for their products for operating systems other than Microsoft
Windows. The ndiswrapper project makes it possible to use such hardware
with Linux by means of a loadable kernel module that "wraps around"
NDIS (Windows network driver API) drivers.

%package KMP
License:        GPLv2+
Summary:        Use Microsoft NDIS Network Drivers for WLAN Cards
Group:          System/Kernel

%description KMP
Some wireless LAN vendors refuse to release hardware specifications or
drivers for their products for operating systems other than Microsoft
Windows. The ndiswrapper project makes it possible to use such hardware
with Linux by means of a loadable kernel module that "wraps around"
NDIS (Windows network driver API) drivers.

%prep
%setup -q
%patch0
%patch1
%patch2 -p2
%patch3
cp %{SOURCE2} .
mkdir obj

%build
CFLAGS="%{optflags}" make -C utils
export EXTRA_CFLAGS='-DVERSION=\"%{version}\"'
mkdir -p obj
for flavor in %flavors_to_build; do
  rm -rf obj/$flavor
  cp -r driver obj/$flavor
  make -C /usr/src/linux-obj/%_target_cpu/$flavor modules \
       M=$PWD/obj/$flavor
done

%install
install -d -m 755 %{buildroot}/sbin %{buildroot}%{_sbindir} \
    %{buildroot}%{_sysconfdir}/ndiswrapper
# Userspace stuff
install -m 755 utils/loadndisdriver %{buildroot}/sbin
install -m 755 utils/ndiswrapper %{buildroot}%{_prefix}/sbin
# Kernel module
export INSTALL_MOD_PATH=%{buildroot}
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
done

%files
%defattr(-, root, root)
%{_sysconfdir}/ndiswrapper
/sbin/loadndisdriver
%{_sbindir}/ndiswrapper
%doc README README.SUSE AUTHORS ChangeLog

%changelog
openSUSE Build Service is sponsored by