Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > 9f1122e3cc91315900f36ea9a01e5fff > files > 7

dkms-et131x-1.2.3-2.1mdv2008.0.src.rpm

%define subrel 1

Summary:	10/100/1000 Base-T Ethernet Driver for the ET1301 and ET131x series MACs
Name:   	dkms-et131x
Version:	1.2.3
Release:	%mkrel 2
Source0:	http://downloads.sourceforge.net/et131x/et131x-%{version}.tar.gz
Source1:	dkms-et131x-vlan_group_changes.patch
Source2:	dkms-et131x-kmem_cache_t-removal.patch
Source3:	dkms-et131x-SET_MODULE_OWNER-removal.patch
Source4:	dkms-et131x-update-irq-flags.patch
Source5:	dkms-et131x-update-et131x_isr-definition.patch
Source6:	dkms-et131x-kmem_cache_create-update.patch
Patch0: 	et131x-1.2.3-mixed-decl-code-warning-fix.patch
Patch1: 	et131x-1.2.3-warning-unused-variable-fix.patch
Patch2: 	et131x-1.2.3-fix_timer.patch
Patch3: 	et131x-1.2.3-va_phy_alignment.patch
License:	BSD
Url:    	http://sourceforge.net/projects/et131x/
Group:  	System/Kernel and hardware
Requires:	dkms
Requires:	kernel-devel
Requires:	drakxtools >= 9.2-8mdk
BuildRoot:	%{_tmppath}/%{name}-buildroot

%description
10/100/1000 Base-T Ethernet Driver for the ET1301 and ET131x series
network adapters.

%prep
%setup -q -n et131x-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1

# Cleanup sources
find . -type f -exec chmod 644 {} \;
find . -type f \( -name '*.rej' -o -name '*~' -o -name '*.orig' \) -print0 | \
	xargs -0 /bin/rm -f
rm -f Kernel-Build-HOWTO.html README.doc

%build

%install
rm -rf $RPM_BUILD_ROOT

# driver source
mkdir -p $RPM_BUILD_ROOT/%{_usrsrc}/et131x-%{version}-%{release}/patches
cp -r * $RPM_BUILD_ROOT/%{_usrsrc}/et131x-%{version}-%{release}
cat > $RPM_BUILD_ROOT/%{_usrsrc}/et131x-%{version}-%{release}/dkms.conf <<EOF
PACKAGE_NAME=et131x
PACKAGE_VERSION=%{version}-%{release}
DEST_MODULE_LOCATION[0]=/kernel/drivers/net
BUILT_MODULE_NAME[0]=et131x
MAKE[0]="make KERNEL_DIR=\${kernel_source_dir}"
AUTOINSTALL=yes
PATCH[0]="dkms-et131x-vlan_group_changes.patch"
PATCH_MATCH[0]="^2\.6\.(2[1-9])|([3-9][0-9]+)|([1-9][0-9][0-9]+)"
PATCH[1]="dkms-et131x-kmem_cache_t-removal.patch"
PATCH_MATCH[1]="^2\.6\.(2[3-9])|([3-9][0-9]+)|([1-9][0-9][0-9]+)"
PATCH[2]="dkms-et131x-SET_MODULE_OWNER-removal.patch"
PATCH_MATCH[2]="^2\.6\.(2[4-9])|([3-9][0-9]+)|([1-9][0-9][0-9]+)"
PATCH[3]="dkms-et131x-update-irq-flags.patch"
PATCH_MATCH[3]="^2\.6\.(2[4-9])|([3-9][0-9]+)|([1-9][0-9][0-9]+)"
PATCH[4]="dkms-et131x-update-et131x_isr-definition.patch"
PATCH_MATCH[4]="^2\.6\.(19)|([2-9][0-9]+)|([1-9][0-9][0-9]+)"
PATCH[5]="dkms-et131x-kmem_cache_create-update.patch"
PATCH_MATCH[5]="^2\.6\.(2[3-9])|([3-9][0-9]+)|([1-9][0-9][0-9]+)"
EOF

for p in %{_sourcedir}/dkms-et131x-vlan_group_changes.patch \
         %{_sourcedir}/dkms-et131x-kmem_cache_t-removal.patch \
         %{_sourcedir}/dkms-et131x-SET_MODULE_OWNER-removal.patch \
         %{_sourcedir}/dkms-et131x-update-irq-flags.patch \
         %{_sourcedir}/dkms-et131x-update-et131x_isr-definition.patch \
         %{_sourcedir}/dkms-et131x-kmem_cache_create-update.patch;
do
	cp $p $RPM_BUILD_ROOT/%{_usrsrc}/et131x-%{version}-%{release}/patches
done

%post
/usr/sbin/dkms --rpm_safe_upgrade add -m et131x -v %version-%release
/usr/sbin/dkms --rpm_safe_upgrade build -m et131x -v %version-%release
/usr/sbin/dkms --rpm_safe_upgrade install -m et131x -v %version-%release --force
exit 0

%preun
/usr/sbin/dkms --rpm_safe_upgrade remove -m et131x -v %version-%release --all
exit 0

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(0644,root,root,0755)
%dir %{_usrsrc}/et131x-%{version}-%{release}
%{_usrsrc}/et131x-%{version}-%{release}/*


%changelog
* Thu Aug 21 2008 Herton Ronaldo Krzesinski <herton@mandriva.com.br> 1.2.3-2.1mdv2008.0
+ Revision: 274467
- Fix build with kernels up to 2.6.24 with following patches:
  dkms-et131x-kmem_cache_t-removal.patch
  dkms-et131x-vlan_group_changes.patch (replaced
    et131x-1.2.3-vlan_group_changes.patch)
  dkms-et131x-update-irq-flags.patch
  dkms-et131x-update-et131x_isr-definition.patch
  dkms-et131x-SET_MODULE_OWNER-removal.patch
  dkms-et131x-kmem_cache_create-update.patch
- Fixed general build warnings with these patches:
  et131x-1.2.3-mixed-decl-code-warning-fix.patch
  et131x-1.2.3-warning-unused-variable-fix.patch
- Added fix to "et131x.ko module takes up 20%% of cpu with ksoftirqd/0"
  (#42666). Report and suggested fix by Bill Unruh. Also address another
  reported bug in the same ticket (alignment issues with physical
  address/virtual address calculation in the driver, ticket number
  1979099 at ET131x Driver sf.net bug tracker).
- Minor fix to sources cleanup in spec.

* Tue Oct 02 2007 Olivier Blin <oblin@mandriva.com> 1.2.3-2mdv2008.0
+ Revision: 94437
- update to new version

* Thu Sep 20 2007 Herton Ronaldo Krzesinski <herton@mandriva.com.br> 1.2.3-1mdv2008.0
+ Revision: 91542
- Initial import (version 1.2.3).
- Created package structure for dkms-et131x.