# 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" stk11xx.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: r8101 Version: 1.023.00 Release: 5mamba Summary: Realtek driver for many RTL81* and RTL84* Ethernet chipsets Group: System/Kernel and Hardware/Drivers Vendor: openmamba Distribution: openmamba Packager: Silvan Calarco URL: http://www.realtek.com.tw Source: https://api.opensuse.org/public/source/home:Akoellh:Kernelmodules/r8101/r8101-%{version}.tar.bz2 License: GPL BuildRequires: kernel-%{KERNEL_TARGET}-headers >= %{KERNEL_VER} BuildRequires: kernel-%{KERNEL_TARGET}-headers <= %{KERNEL_VER}.255 ## AUTOBUILDREQ-BEGIN ## note: run 'autospec -u -a6 r8101' to get the list of build requirements. ## AUTOBUILDREQ-END BuildRoot: %{_tmppath}/%{name}-%{version}-root %description Realtek driver for the following chipsets: RTL8100E/RTL8101E/RTL8102E-GR/RTL8103E(L) RTL8102E(L)/RTL8101E/RTL8103T RTL8401/RTL8401P/RTL8105E RTL8402 %package -n kernel-%{KERNEL_TARGET}-%{name} Summary: Realtek driver for many RTL81* and RTL84* Ethernet chipsets Group: System/Kernel and Hardware/Drivers Requires(pre): kernel-%{KERNEL_TARGET} >= %{KERNEL_VER} Requires(pre): kernel-%{KERNEL_TARGET} <= %{KERNEL_VER}.255 ## KERNELOBSOLETES-BEGIN 3.4 Obsoletes: kernel-%{KERNEL_TARGET}-%{name} = 1.023.00-3mamba Obsoletes: kernel-%{KERNEL_TARGET}-%{name} = 1.023.00-4mamba ## KERNELOBSOLETES-END %description -n kernel-%{KERNEL_TARGET}-%{name} Realtek driver for the following chipsets: RTL8100E/RTL8101E/RTL8102E-GR/RTL8103E(L) RTL8102E(L)/RTL8101E/RTL8103T RTL8401/RTL8401P/RTL8105E RTL8402 %prep %setup -q chmod 755 src %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}" make CROSS_COMPILE=%{_target_platform}- \ BASEDIR=/lib/modules/%{KERNEL_VER}%{?KERNEL_TARGET} modules %install [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" install -D -m 0644 src/r8101.ko \ %{buildroot}/lib/modules/%{KERNEL_VER}%{?KERNEL_TARGET}/extra/drivers/net/r8101.ko %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %post -n kernel-%{KERNEL_TARGET}-%{name} if [ $1 -ge 1 ]; then /sbin/depmod -a -F /boot/System.map-%{KERNEL_VER}%{?KERNEL_TARGET} \ %{KERNEL_VER}%{?KERNEL_TARGET} >/dev/null 2>&1 fi : %postun -n kernel-%{KERNEL_TARGET}-%{name} # erase this package if [ $1 -eq 0 ]; then /sbin/depmod -a -F /boot/System.map-%{KERNEL_VER}%{?KERNEL_TARGET} \ %{KERNEL_VER}%{?KERNEL_TARGET} >/dev/null 2>&1 fi : %files -n kernel-%{KERNEL_TARGET}-%{name} %defattr(-,root,root) /lib/modules/%{KERNEL_VER}%{?KERNEL_TARGET}/extra/drivers/net/%{name}.ko %changelog * Fri Jan 04 2013 Silvan Calarco 1.023.00-5mamba - kernel 3.4 rebuild * Mon Nov 05 2012 Silvan Calarco 1.023.00-4mamba - bump release up for milestone2 update * Thu Oct 25 2012 Silvan Calarco 1.023.00-3mamba - rebuilt with 3.6 * Sat Sep 08 2012 Silvan Calarco 1.023.00-2mamba - rebuilt with kernel 3.4 * Sat Sep 08 2012 Silvan Calarco 1.023.00-1mamba - package created by autospec