# 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" cm2020.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: cm2020 Version: 2.4.0beta1.svn20080426 Release: 12mamba Summary: Driver for the Omnikey Cardman 2020 USB smart card reader Group: System/Kernel and Hardware/Drivers Vendor: openmamba Distribution: openmamba Packager: Silvan Calarco URL: http://svn.gula.es/cm2020 # svn co http://svn.gula.es/cm2020 Source: http://svn.gula.es/cm2020/cm2020-%{version}.tar.bz2 Patch0: %{name}-2.4.0beta1.svn20080426-kernel-2.6.37.patch Patch1: %{name}-2.4.0beta1.svn20080426-kernel-2.6.39.patch License: GPL BuildRoot: %{_tmppath}/%{name}-%{version}-root %description Driver for the Omnikey Cardman 2020 USB smart card reader. %package -n kernel-%{KERNEL_TARGET}-cm2020 Summary: Driver for the Omnikey Cardman 2020 USB smart card reader 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}-cm2020 = 2.4.0beta1.svn20080426-9mamba Obsoletes: kernel-%{KERNEL_TARGET}-cm2020 = 2.4.0beta1.svn20080426-10mamba ## KERNELOBSOLETES-END %description -n kernel-%{KERNEL_TARGET}-cm2020 Driver for the Omnikey Cardman 2020 USB smart card reader. %prep %setup -q -n %{name} %patch0 -p1 %patch1 -p1 %if "%{?KERNEL_TARGET}" == "" echo "No target specified, aborting." exit 1 %else echo "I'm going to build module for a %{KERNEL_TARGET} kernel..." %endif cd src/cm2020 mv makefile.26 Makefile %build # # build for KERNEL_TARGET # BUILD_OPTS="CC=%{BUILD_CC} CXX=%{BUILD_CXX} %{_smp_mflags}" # build cm2020 module make CROSS_COMPILE=%{_target_platform}- -C src/cm2020 \ ${BUILD_OPTS} \ KVER=%{KERNEL_VER}%{?KERNEL_TARGET} \ KDIR=%{_prefix}/src/linux-%{KERNEL_VER}%{?KERNEL_TARGET} %install [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" # install cm2020 module install -D -m 0644 \ src/cm2020/cardman.ko \ %{buildroot}/lib/modules/%{KERNEL_VER}%{?KERNEL_TARGET}/extra/cardman.ko %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %post -n kernel-%{KERNEL_TARGET}-cm2020 # new install or upgrade /sbin/depmod -a -F /boot/System.map-%{KERNEL_VER}%{?KERNEL_TARGET} \ %{KERNEL_VER}%{?KERNEL_TARGET} >/dev/null 2>&1 : %postun -n kernel-%{KERNEL_TARGET}-cm2020 # 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}-cm2020 %defattr(-,root,root) /lib/modules/%{KERNEL_VER}%{?KERNEL_TARGET}/extra/cardman.ko %doc COPYING README %changelog * Sun Sep 15 2013 Silvan Calarco 2.4.0beta1.svn20080426-12mamba - kernel 3.10 rebuild * Fri Jan 04 2013 Silvan Calarco 2.4.0beta1.svn20080426-11mamba - kernel 3.4 rebuild * Mon Nov 05 2012 Silvan Calarco 2.4.0beta1.svn20080426-10mamba - bump release up for milestone2 update * Sat Oct 27 2012 Silvan Calarco 2.4.0beta1.svn20080426-9mamba - kernel 3.6 rebuild * Sat Jun 30 2012 Silvan Calarco 2.4.0beta1.svn20080426-8mamba - automatic update by autodist * Sun Feb 12 2012 Silvan Calarco 2.4.0beta1.svn20080426-7mamba - automatic update by autodist * Wed Jan 25 2012 Silvan Calarco 2.4.0beta1.svn20080426-6mamba - automatic update by autodist * Sun Sep 04 2011 Silvan Calarco 2.4.0beta1.svn20080426-5mamba - automatic update by autodist * Fri Aug 19 2011 Silvan Calarco 2.4.0beta1.svn20080426-4mamba - automatic update by autodist * Wed Apr 20 2011 Silvan Calarco 2.4.0beta1.svn20080426-3mamba - kernel 2.6.38 rebuild * Mon Feb 07 2011 Silvan Calarco 2.4.0beta1.svn20080426-2mamba - automatic update by autodist * Fri Dec 17 2010 Silvan Calarco 2.4.0beta1.svn20080426-1mamba - package created out of kernel-extramodules