From 2e4f67270e21bfcfb31419577629d5e64ce46fb9 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Fri, 29 Mar 2024 01:14:23 +0100 Subject: [PATCH] - version suffix for package name instead of alt_kernel, fixed extraversion --- kernel.spec | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/kernel.spec b/kernel.spec index 1912008..3513bbb 100644 --- a/kernel.spec +++ b/kernel.spec @@ -7,7 +7,9 @@ %define postver 214 %define rel 1 -%define alt_kernel 5.10 +%define alt_kernel %{nil} + +%define versuffix -%{basever} # kernel release (used in filesystem and eventually in uname -r) # modules will be looked from /lib/modules/%{kernel_release} @@ -20,7 +22,7 @@ Summary(de.UTF-8): Der Linux-Kernel (Kern des Linux-Betriebssystems) Summary(et.UTF-8): Linuxi kernel (ehk operatsioonisüsteemi tuum) Summary(fr.UTF-8): Le Kernel-Linux (La partie centrale du systeme) Summary(pl.UTF-8): Jądro Linuksa -Name: kernel%{_alt_kernel} +Name: kernel%{versuffix}%{_alt_kernel} Version: %{basever}.%{postver} Release: %{rel} Epoch: 3 @@ -111,7 +113,7 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %define objdir %{topdir}/%{targetobj} %define targetobj %{_target_base_arch}-gcc-%(%{kgcc} -dumpversion) -%define _kernelsrcdir /usr/src/linux%{_alt_kernel}-%{version} +%define _kernelsrcdir /usr/src/linux%{versuffix}%{_alt_kernel}-%{version} %if "%{_target_base_arch}" != "%{_host_base_arch}" %define CrossOpts ARCH=%{_target_base_arch} CROSS_COMPILE=%{_target_cpu}-tld-linux- @@ -329,7 +331,7 @@ cd linux-%{basever} %endif # Fix EXTRAVERSION in main Makefile -sed -i 's#EXTRAVERSION =.*#EXTRAVERSION = %{?alt_kernel:-%{alt_kernel}}#g' Makefile +sed -i 's#EXTRAVERSION =.*#EXTRAVERSION = %{?alt_kernel:_%{alt_kernel}}#g' Makefile # cleanup backups after patching find '(' -name '*~' -o -name '*.orig' -o -name '.gitignore' ')' -print0 | xargs -0 -r -l512 rm -f @@ -555,13 +557,13 @@ fi %depmod %{kernel_release} %post headers -ln -snf %{basename:%{_kernelsrcdir}} %{_prefix}/src/linux%{_alt_kernel} +ln -snf %{basename:%{_kernelsrcdir}} %{_prefix}/src/linux%{versuffix}%{_alt_kernel} %postun headers if [ "$1" = "0" ]; then - if [ -L %{_prefix}/src/linux%{_alt_kernel} ]; then - if [ "$(readlink %{_prefix}/src/linux%{_alt_kernel})" = "linux%{_alt_kernel}-%{version}" ]; then - rm -f %{_prefix}/src/linux%{_alt_kernel} + if [ -L %{_prefix}/src/linux%{versuffix}%{_alt_kernel} ]; then + if [ "$(readlink %{_prefix}/src/linux%{versuffix}%{_alt_kernel})" = "linux%{versuffix}%{_alt_kernel}-%{version}" ]; then + rm -f %{_prefix}/src/linux%{versuffix}%{_alt_kernel} fi fi fi -- 2.46.0