RPM: Use kernel build directory corresponding to kernel-devel

This commit is contained in:
Solar Designer 2023-09-14 22:09:33 +02:00
parent 5dc5cfea1f
commit 91d3da9ece
2 changed files with 15 additions and 3 deletions

View file

@ -1,3 +1,9 @@
The following major changes have been made since LKRG 0.9.7:
*) RPM spec file improvements to make it work or properly fail in a wider set
of circumstances
The following major changes have been made between LKRG 0.9.6 and 0.9.7:
*) Support new mainline kernels 6.4 to 6.5.x, and hopefully beyond

View file

@ -5,12 +5,12 @@
Summary: Linux Kernel Runtime Guard (LKRG)
Name: lkrg
Version: 0.9.7
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv2
URL: https://lkrg.org
Source: https://lkrg.org/download/%name-%version.tar.gz
ExclusiveArch: %ix86 x86_64 %arm32 %arm64
BuildRequires: make, gcc, kernel-devel
BuildRequires: make, gcc, elfutils-libelf-devel, kernel, kernel-devel
BuildRoot: /override/%name-%version
%description
@ -28,7 +28,7 @@ as open a file) based on the unauthorized credentials.
%setup -q
%build
make %{?_smp_mflags}
make %{?_smp_mflags} KERNELRELEASE=%kmod_headers_version
%install
rm -rf %buildroot
@ -55,6 +55,12 @@ echo 'To enable LKRG on bootup please use: systemctl enable lkrg'
%_sysconfdir/sysctl.d/*
%changelog
* Thu Sep 14 2023 Solar Designer <solar@openwall.com> 0.9.7-2
- Use kernel build directory corresponding to the kernel-devel package, not to
the currently running kernel
- "BuildRequires: kernel" for the /lib/modules/* directory
- "BuildRequires: elfutils-libelf-devel" to support CONFIG_UNWINDER_ORC=y
* Thu Sep 14 2023 Solar Designer <solar@openwall.com> 0.9.7-1
- Wrote this rough RPM spec file for Red Hat'ish distros, seems to work fine on
RHEL 7, 8, 9 rebuilds, but is only reliable when there's exactly one