# openmamba 2.6 kernel module specfile # Copyright (C) 2004-2010 by Silvan Calarco # # To build for a specific target: # # rpm -ba --define="KERNEL_TARGET mamba" atheros-81.spec # # default is "mamba" # %define kernel_ver %{version} %define build_version %{kernel_ver} %define BUILD_CC %{_target_platform}-gcc %define BUILD_CXX %{_target_platform}-g++ %if "%{?KERNEL_TARGET}" == "" # build a mamba kernel by default %define KERNEL_TARGET mamba %endif %if "%{?KERNEL_VER}" == "" %define KERNEL_VER %(uname -r | sed "s|\\([0-9.]*\\).*|\\1|" ) %endif Name: atheros-81 Version: 1.0.1.9 Release: 1mamba Summary: Atheros driver for AR8121/AR8113 based PCI-E Ethernet adapter Group: System/Kernel and Hardware/Drivers Vendor: openmamba Distribution: openmamba Packager: Stefano Cotta Ramusino URL: http://partner.atheros.com/Drivers.aspx Source: http://fichiers.touslesdrivers.com/atheros/AR81Family-linux-v%{version}.tar.gz Source1: atheros-81.conf License: GPL BuildRoot: %{_tmppath}/%{name}-%{version}-root %description Linux base driver for the Atheros(R) AR8121/AR8113 based PCI-E Ethernet adapters. %package -n kernel-%{KERNEL_TARGET}-atl1e Summary: Atheros driver for AR8121/AR8113 based PCI-E Ethernet adapter Group: System/Kernel and Hardware/Drivers Requires(pre): kernel-%{KERNEL_TARGET} >= %{KERNEL_VER} Requires(pre): kernel-%{KERNEL_TARGET} <= %{KERNEL_VER}.255 %description -n kernel-%{KERNEL_TARGET}-atl1e Linux base driver for the Atheros(R) AR8121/AR8113 based PCI-E Ethernet adapters. %prep %setup -q -n %{name}-%{version} -c %{name}-%{version} %if "%{?KERNEL_TARGET}" == "" echo "No target specified, aborting." exit 1 %else echo "I'm going to build module for a %{KERNEL_TARGET} kernel..." %endif %build # # build for KERNEL_TARGET # BUILD_OPTS="CC=%{BUILD_CC} CXX=%{BUILD_CXX} %{_smp_mflags}" # # build Atheros atl1e driver module (atl1e.ko) # make -C /usr/src/linux-%{KERNEL_VER}%{?KERNEL_TARGET} M=`pwd`/src %install [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" # # install Atheros atl1e driver module (atl1e.ko) # install -D -m 0644 src/atl1e.ko \ %{buildroot}/lib/modules/%{KERNEL_VER}%{KERNEL_TARGET}/kernel/drivers/net/atl1e/atl1e.ko.new # install man page install -D -m 0644 atl1e.7 \ %{buildroot}%{_mandir}/man7/atl1e.7 # install modprobe configuration file install -D -m 0644 %{S:1} \ %{buildroot}%{_sysconfdir}/modprobe.d/atheros-81.conf %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %post -n kernel-%{KERNEL_TARGET}-atl1e # new install or upgrade mv /lib/modules/%{KERNEL_VER}%{KERNEL_TARGET}/kernel/drivers/net/atl1e/atl1e.ko \ /lib/modules/%{KERNEL_VER}%{KERNEL_TARGET}/kernel/drivers/net/atl1e/atl1e.ko.save >/dev/null 2>&1 cp /lib/modules/%{KERNEL_VER}%{KERNEL_TARGET}/kernel/drivers/net/atl1e/atl1e.ko.new \ /lib/modules/%{KERNEL_VER}%{KERNEL_TARGET}/kernel/drivers/net/atl1e/atl1e.ko >/dev/null 2>&1 /sbin/depmod -a -F /boot/System.map-%{KERNEL_VER}%{?KERNEL_TARGET} \ %{KERNEL_VER}%{?KERNEL_TARGET} >/dev/null 2>&1 : %preun -n kernel-%{KERNEL_TARGET}-atl1e mv /lib/modules/%{KERNEL_VER}%{KERNEL_TARGET}/kernel/drivers/net/atl1e/atl1e.ko.save \ /lib/modules/%{KERNEL_VER}%{KERNEL_TARGET}/kernel/drivers/net/atl1e/atl1e.ko >/dev/null 2>&1 : %postun -n kernel-%{KERNEL_TARGET}-atl1e # erase this package [ $1 -eq 0 ] && /sbin/depmod -a -F /boot/System.map-%{KERNEL_VER}%{?KERNEL_TARGET} \ %{KERNEL_VER}%{?KERNEL_TARGET} >/dev/null 2>&1 : %files -n kernel-%{KERNEL_TARGET}-atl1e %defattr(-,root,root) %{_sysconfdir}/modprobe.d/atheros-81.conf /lib/modules/%{KERNEL_VER}%{?KERNEL_TARGET}/kernel/drivers/net/atl1e/atl1e.ko.new %{_mandir}/man7/atl1e.7.gz %doc copying readme %changelog * Mon Aug 02 2010 Stefano Cotta Ramusino 1.0.1.9-1mamba - update to 1.0.1.9 * Wed Jun 30 2010 Silvan Calarco 1.0.1.6-2mamba - automatic rebuild by autodist * Sat Feb 20 2010 Stefano Cotta Ramusino 1.0.1.6-1mamba - update to 1.0.1.6 - added man page * Tue Dec 29 2009 Stefano Cotta Ramusino 1.0.0.10-1mamba - package created by autospec