diff --git a/README.md b/README.md index b743ee2..6251836 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # rts_bpp +A kernel module for Realtek Card Reader RTL8402/8411/8411B Device. + diff --git a/rts_bpp.spec b/rts_bpp.spec new file mode 100644 index 0000000..2aaa4db --- /dev/null +++ b/rts_bpp.spec @@ -0,0 +1,80 @@ +Name: rts_bpp +Version: 20180120git +Release: 1mamba +Summary: A kernel module for Realtek Card Reader RTL8402/8411/8411B Device +Group: System/Kernel and hardware +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: https://github.com/Ri0n/rts_bpp.git +## GITSOURCE https://github.com/Ri0n/rts_bpp.git master +Source: https://github.com/Ri0n/rts_bpp.git/master/rts_bpp-%{version}.tar.bz2 +License: GPL +## AUTOBUILDREQ-BEGIN +## AUTOBUILDREQ-END +Requires(post):kernelheaders +Requires(post):dkms +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +A kernel module for Realtek Card Reader RTL8402/8411/8411B Device. + +%prep +%setup -q + +%build + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +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 KSRC=\"\${kernel_source_dir}\"" +CLEAN="make KSRC=\"\${kernel_source_dir}\" clean" +BUILT_MODULE_NAME=%{name} +BUILT_MODULE_LOCATION=. +DEST_MODULE_LOCATION=/kernel/drivers/staging/rts_bpp/ +REMAKE_INITRD=no +AUTOINSTALL=yes +_EOF + +%check +for d in /lib/modules/4.*/build; do + kver=`echo $d|sed "s|/lib/modules/\(.*\)/build.*|\1|"` +%ifnarch arm + [ "${kver/arm}" != "${kver}" ] && continue +%endif + [ "${kver:0:3}" == "4.0" -o "${kver:0:3}" == "4.1" ] && continue + rm -f *.ko + make KSRC="$d" + [ -e %{name}.ko ] || exit 1 +done + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%preun +# erase +if [ $1 -eq 0 ]; then + dkms remove -q -m %{name} -v %{version} --all +fi +: + +%post +if [ $1 -ge 1 ]; then + dkms add -q -m %{name} -v %{version} + dkms install -q -m %{name} -v %{version} --force +fi +: + +%files +%defattr(-,root,root) +%dir %{_prefix}/src/%{name}-%{version} +%{_prefix}/src/%{name}-%{version}/* + +%changelog +* Sat Jan 20 2018 Silvan Calarco 20180120git-1mamba +- package created using the webbuild interface