diff --git a/deploy/build_packages/build_rpm_LLL.sh b/deploy/build_packages/build_rpm_LLL.sh index d3d833b..02e2b8b 100755 --- a/deploy/build_packages/build_rpm_LLL.sh +++ b/deploy/build_packages/build_rpm_LLL.sh @@ -24,7 +24,7 @@ cp -r ${REPODIR}/kernel_module lenovolegionlinux-kmod-${TAG}-x86_64 #Dkms change version sudo sed -i "s/DKMS_VERSION/${TAG}/g" ./lenovolegionlinux-kmod-${TAG}-x86_64/dkms.conf -mv ${REPODIR}/deploy/build_packages/lenovolegionlinux-dkms.spec rpmbuild/SPECS/lenovolegionlinux.spec +cp ${REPODIR}/deploy/build_packages/lenovolegionlinux-dkms.spec rpmbuild/SPECS/lenovolegionlinux.spec #Change version according to tag sed -i "s/_VERSION/${TAG}/g" rpmbuild/SPECS/lenovolegionlinux.spec diff --git a/deploy/build_packages/lenovolegionlinux-dkms.spec b/deploy/build_packages/lenovolegionlinux-dkms.spec new file mode 100644 index 0000000..54af7e1 --- /dev/null +++ b/deploy/build_packages/lenovolegionlinux-dkms.spec @@ -0,0 +1,35 @@ +# norootforbuild +%global dkms_name lenovolegionlinux + +Name: dkms-lenovolegionlinux +License: GPL +Group: System/Kernel +Summary: LenovoLegionLinux Kernel Module Package +Version: _VERSION +Release: 0 +Source0: %{dkms_name}-kmod-%{version}-x86_64.tar.gz + +Requires: dkms + +%description +Driver for controlling Lenovo Legion laptops including fan control and power mode. + +%prep +%autosetup -p0 -n %{dkms_name}-kmod-%{version}-x86_64 + +%install +mkdir -p %{buildroot}%{_usrsrc}/%{dkms_name}-%{version}/ +cp -fr * %{buildroot}%{_usrsrc}/%{dkms_name}-%{version}/ + +%post +dkms add -m %{dkms_name} -v %{version} -q || : +# Rebuild and make available for the currently running kernel: +dkms build -m %{dkms_name} -v %{version} -q || : +dkms install -m %{dkms_name} -v %{version} -q --force || : + +%preun +# Remove all versions from DKMS registry: +dkms remove -m %{dkms_name} -v %{version} -q --all || : + +%files +%{_usrsrc}/%{dkms_name}-%{version} \ No newline at end of file