switched to dkms [release 2.1.0-13mamba;Tue Jul 01 2014]

This commit is contained in:
Silvan Calarco 2024-01-05 18:09:08 +01:00
parent 706b3cb3a6
commit f72684108d

View File

@ -1,30 +1,6 @@
# 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: stk11xx
Version: 2.1.0
Release: 12mamba
Release: 13mamba
Summary: Syntek Semicon DC-1125 Driver
Group: System/Kernel and Hardware/Drivers
Vendor: openmamba
@ -35,79 +11,67 @@ Source: http://downloads.sourceforge.net/sourceforge/syntekdriver/stk11xx
Patch0: %{name}-2.1.0-kernel-2.6.37.patch
Patch1: %{name}-2.1.0-kernel-2.6.38.patch
License: GPL
BuildRequires: ctags
Obsoletes: kernel-mamba-64GB-stk11xx
Obsoletes: kernel-mamba-64GB-rt-stk11xx
Obsoletes: kernel-mamba-stk11xx
Obsoletes: kernel-mamba-rt-stk11xx
## AUTOBUILDREQ-BEGIN
## AUTOBUILDREQ-END
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
Linux/Unix driver development for Syntek Semicon USB2.0 Video device DC-1125, like the one that is found in Asus A6K laptops. The device can be recognized by the usb id 174f:a311 and maybe also be a standalone unit (not integrated).
%package -n kernel-%{KERNEL_TARGET}-stk11xx
Summary: Syntek Semicon DC-1125 Driver
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}-stk11xx = 2.1.0-9mamba
Obsoletes: kernel-%{KERNEL_TARGET}-stk11xx = 2.1.0-10mamba
## KERNELOBSOLETES-END
%description -n kernel-%{KERNEL_TARGET}-stk11xx
Linux/Unix driver development for Syntek Semicon USB2.0 Video device DC-1125, like the one that is found in Asus A6K laptops. The device can be recognized by the usb id 174f:a311 and maybe also be a standalone unit (not integrated).
%prep
%setup -q
%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
%build
#
# build for KERNEL_TARGET
#
BUILD_OPTS="CC=%{BUILD_CC} CXX=%{BUILD_CXX} %{_smp_mflags}"
make CROSS_COMPILE=%{_target_platform}- -f Makefile.standalone clean \
KVER=%{KERNEL_VER}%{?KERNEL_TARGET} \
KDIR=%{_prefix}/src/linux-%{KERNEL_VER}%{?KERNEL_TARGET}
make CROSS_COMPILE=%{_target_platform}- -f Makefile.standalone driver \
${BUILD_OPTS} \
KVER=%{KERNEL_VER}%{?KERNEL_TARGET} \
KDIR=%{_prefix}/src/linux-%{KERNEL_VER}%{?KERNEL_TARGET}
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
install -D -m 0644 stk11xx.ko \
%{buildroot}/lib/modules/%{KERNEL_VER}%{?KERNEL_TARGET}/kernel/drivers/usb/media/stk11xx.ko
# dkms
install -d -m0755 %{buildroot}%{_prefix}/src/%{name}-%{version}
cp -a * %{buildroot}%{_prefix}/src/%{name}-%{version}/
cat > %{buildroot}%{_prefix}/src/%{name}-%{version}/dkms.conf << _EOF
PACKAGE_NAME=%{name}
PACKAGE_VERSION=%{version}
MAKE="make -f Makefile.standalone driver KVER=\${kernelver} KDIR=\${kernel_source_dir}"
CLEAN="make -f Makefile.standalone clean KVER=\${kernelver} KDIR=\${kernel_source_dir}"
BUILT_MODULE_NAME=\${PACKAGE_NAME}
BUILT_MODULE_LOCATION=.
DEST_MODULE_LOCATION=/extra/drivers/usb/media/
REMAKE_INITRD=no
AUTOINSTALL=yes
_EOF
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post -n kernel-%{KERNEL_TARGET}-stk11xx
# new install or upgrade
mv /lib/modules/%{KERNEL_VER}%{KERNEL_TARGET}/kernel/drivers/net/atl1e/atl1e.ko \
/sbin/depmod -a -F /boot/System.map-%{KERNEL_VER}%{?KERNEL_TARGET} \
%{KERNEL_VER}%{?KERNEL_TARGET} >/dev/null 2>&1
%preun
dkms remove -q -m %{name} -v %{version} --all --rpm_safe_upgrade
:
%postun -n kernel-%{KERNEL_TARGET}-stk11xx
# 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
%posttrans
if [ $1 -ge 1 ]; then
# clean any legacy alternatives symlink
dkms remove -q -m %{name} -v %{version} --all --rpm_safe_upgrade
dkms add -q -m %{name} -v %{version}
dkms install -q -m %{name} -v %{version}
fi
:
%files -n kernel-%{KERNEL_TARGET}-stk11xx
%files
%defattr(-,root,root)
/lib/modules/%{KERNEL_VER}%{?KERNEL_TARGET}/kernel/drivers/usb/media/stk11xx.ko
#%doc copying readme
%dir %{_prefix}/src/%{name}-%{version}
%{_prefix}/src/%{name}-%{version}/*
%changelog
* Tue Jul 01 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.0-13mamba
- switched to dkms
* Sun Sep 15 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.0-12mamba
- kernel 3.10 rebuild