## %%define build_kmod %{?_with_kmod:1}%{!?_with_kmod:0}
%define build_kmod 1
%define kmod	kernel-module
%define name	ipw3945
%define ver	1.2.2
%define rel	1%{?_dist_release}
%define kversion %(echo `uname -r`)
%define kver    %(echo `uname -r` | sed -e 's/-/_/g')

Summary:        Intel PRO/Wireless 3945ABG driver
Summary(ja):    Intel PRO/Wireless 3945ABG ドライバ
Name:		%{name}
Version:	%{ver}
Release: 	%{rel}
Source0:	http://prdownloads.sourceforge.net/ipw3945/%{name}-%{version}.tgz
Patch0:		ipw3945-1.2.2-2.6.24.patch
License:	GPL2/BSD
Group:		System Environment/Base
URL:		http://ipw3945.sourceforge.net/

BuildRequires:	kernel-devel

BuildRoot:	%{_tmppath}/%{name}-%{version}-root

%description
Linux kernel driver for Intel PRO/Wireless 3945ABG Network controller.


%package -n %{kmod}-%{name}
Summary:        Linux kernel module for Intel PRO/Wireless 3945ABG drivers (for kerne-%{kversion})
Summary(ja):    Intel PRO/Wireless 3945ABG 用の Linux カーネルモジュール (kernel-%{kversion}用)
Version:	%{ver}_%{kver}
License:	GPL
Group:		System Environment/Kernel
Requires:	kernel = %{kversion}
Requires:	ipw3945-firmware >= 1.14, ipw3945d >= 1.7.22

%description -n %{kmod}-%{name}
This package contains kernel drivers for the Intel PRO/Wireless 3945ABG.

This package is created for kernel-%{kversion}.

%description -l ja -n %{kmod}-%{name}
このパッケージには Intel PRO/Wireless 3945ABG 用のカーネルドライバが含まれてい
ます。

このパッケージは kernel-%{kversion} 用に作成されています。


%prep
%setup -q
%patch0 -p1 -b .2624
perl -pi -e's,/sbin/depmod,:,g' Makefile

%build
%__make

%install
%__rm -rf ${RPM_BUILD_ROOT}
%makeinstall KMISC=%{buildroot}/lib/modules/%{kversion}/kernel/drivers/net/wireless/

%clean
%__rm -rf ${RPM_BUILD_ROOT}

%post -n %{kmod}-%{name}
/sbin/depmod -a

%files -n %{kmod}-%{name}
/lib/modules/%{kversion}/kernel/drivers/net/wireless/*

%changelog
* Wed Mar 26 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 1.2.2-1
- new upstream release

* Tue Oct 30 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 1.2.0-0vl3
- fix Summary and Description.

* Sun May 13 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 1.2.0-0vl2
- fix typo in Group:

* Mon Apr 02 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 1.2.0-0vl1
- initial build for Vine Linux
