From 5ad568ab92044c3643c1e40fbcdd216d328b9d34 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 21:12:33 +0100 Subject: [PATCH] add %preun and %post code for dkms support [release 20170125git-2mamba;Tue Jan 31 2017] --- README.md | 2 ++ chipone_ts.spec | 70 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 chipone_ts.spec diff --git a/README.md b/README.md index e6bc8f7..47e01d9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # chipone_ts +Touchsreen kernel driver for Chuwi tablets. + diff --git a/chipone_ts.spec b/chipone_ts.spec new file mode 100644 index 0000000..16de530 --- /dev/null +++ b/chipone_ts.spec @@ -0,0 +1,70 @@ +Name: chipone_ts +Version: 20170125git +Release: 2mamba +Summary: Touchsreen kernel driver for Chuwi tablets +Group: System/Kernel and Hardware +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: https://github.com/Dax89/chuwi-dev +## GITSOURCE https://github.com/Dax89/chuwi-dev.git master +Source: https://github.com/Dax89/chuwi-dev.git/master/chuwi-dev-%{version}.tar.bz2 +License: GPL +## AUTOBUILDREQ-BEGIN +## AUTOBUILDREQ-END +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +Touchsreen kernel driver for Chuwi tablets. + +%prep +%setup -q -n chuwi-dev-%{version} + +%build + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +install -d -m0755 %{buildroot}%{_prefix}/src/%{name}-%{version} + +cp -a drivers/chipone_ts/* %{buildroot}%{_prefix}/src/%{name}-%{version}/ + +cat > %{buildroot}%{_prefix}/src/%{name}-%{version}/dkms.conf << _EOF +PACKAGE_NAME=%{name} +PACKAGE_VERSION=%{version} +MAKE="KCPPFLAGS=\"-DCONFIG_HI10=1\" KDIR=\"\${kernel_source_dir}\" make hi10" +CLEAN="make KSRC=\"\${kernel_source_dir}\" clean" +BUILT_MODULE_NAME=chipone_ts +BUILT_MODULE_LOCATION=. +DEST_MODULE_LOCATION=/kernel/drivers/input/touchscreen +REMAKE_INITRD=no +AUTOINSTALL=yes +_EOF + +%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 +* Tue Jan 31 2017 Silvan Calarco 20170125git-2mamba +- add %preun and %post code for dkms support + +* Wed Jan 25 2017 Silvan Calarco 20170125git-1mamba +- package created using the webbuild interface