# Location to install kernel module sources %global _kmod_src_root %{_usrsrc}/%{name}-%{version} Name: tuxedo-keyboard Version: 3.0.1 Release: 1%{?dist} Summary: Kernel module for enabling TUXEDO Computers laptop keyboard features License: GPLv3+ URL: https://github.com/tuxedocomputers/%{name} Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz BuildArch: noarch %description %{summary}. %package -n dkms-%{name} Summary: Kernel module source for %{name} managed by DKMS Requires(preun): dkms >= 2.3 Requires: dkms >= 2.3 Requires(post): dkms >= 2.3 # Dependencies for actually building the kmod Requires: gcc Requires: make # With RPM 4.9.0 and newer, it's possible to give transaction # hints to ensure some kind of ordering for transactions using # the OrderWithRequires statement. # More info: http://rpm.org/wiki/Releases/4.9.0#package-building # We can use this to ensure that if kernel-devel is in the same # transaction as the DKMS module upgrade, it will be installed # first before processing the kernel module, ensuring that DKMS # will be able to successfully build against the new kernel being # installed. OrderWithRequires: kernel-devel %description -n dkms-%{name} Kernel module sources for %{name} for DKMS to automatically build and install for each kernel. %prep %autosetup -p1 %build # Nothing to build %install # Install kmod sources mkdir -p %{buildroot}%{_kmod_src_root} cp -av . %{buildroot}%{_kmod_src_root} # Delete unneeded stuff rm -rf %{buildroot}%{_kmod_src_root}/{deb,src_pkg,trans_pkg_from_dkms} %preun -n dkms-%{name} if [ "$(dkms status -m %{name} -v %{version})" ]; then dkms remove -m %{name} -v %{version} --all --rpm_safe_upgrade fi %post -n dkms-%{name} if [ "$1" -ge "1" ]; then if [ -f /usr/lib/dkms/common.postinst ]; then /usr/lib/dkms/common.postinst %{name} %{version} exit $? fi fi %files -n dkms-%{name} %{_kmod_src_root}/ %doc README.md %license LICENSE %changelog * Wed Dec 23 15:07:23 EST 2020 Neal Gompa - 3.0.1-2 - Initial packaging