2013-05-01 08:12:39 +02:00
|
|
|
%package -n %{-n*}-kmp-%1
|
2023-04-18 10:10:13 +02:00
|
|
|
%define _this_kmp_kernel_version k%(echo %2 | sed -r 'y/-/_/')
|
2019-03-11 12:01:11 +01:00
|
|
|
%define _this_kmp_version %{-v*}_%_this_kmp_kernel_version
|
2011-10-05 07:01:45 +02:00
|
|
|
Version: %_this_kmp_version
|
|
|
|
Release: %{-r*}
|
|
|
|
%(
|
|
|
|
for spec in {%_sourcedir,%_specdir}/%name.spec /dev/null; do
|
|
|
|
[ -e $spec ] && break
|
|
|
|
done
|
|
|
|
awk '
|
|
|
|
BEGIN { tags["summary"] = "Summary: %summary"
|
2020-11-20 09:06:59 +01:00
|
|
|
tags["group"] = "" }
|
2011-10-05 07:01:45 +02:00
|
|
|
/^%%/ { in_pkg_header = \
|
|
|
|
($0 ~ /^%%package[ \t]+KMP[ \t]*$/ ||
|
|
|
|
$0 ~ /^%%package[ \t]+-n[ \t]*%name-KMP[ \t]*$/)
|
|
|
|
next }
|
|
|
|
in_pkg_header && /^(Summary|Group):[ \t]*/ \
|
|
|
|
{ tag = tolower($1) ; sub(/:$/, "", tag)
|
|
|
|
tags[tag] = $0 }
|
|
|
|
END { print tags["summary"]
|
2020-11-20 09:06:59 +01:00
|
|
|
if ( tags["group"] != "" ) print tags["group"] }
|
2011-10-05 07:01:45 +02:00
|
|
|
' $spec
|
|
|
|
)
|
2013-05-01 08:12:39 +02:00
|
|
|
Provides: %{-n*}-kmp = %_this_kmp_version
|
|
|
|
Provides: %{-n*}-kmp = %{-v*}
|
2019-03-11 12:01:11 +01:00
|
|
|
Provides: multiversion(kernel)
|
|
|
|
Provides: %{-n*}-kmp-%1-%_this_kmp_kernel_version
|
2011-10-05 07:01:45 +02:00
|
|
|
Requires: coreutils grep
|
2021-11-24 09:05:20 +01:00
|
|
|
Requires(pre): suse-kernel-rpm-scriptlets
|
2023-03-16 09:16:47 +01:00
|
|
|
Requires(post): suse-kernel-rpm-scriptlets
|
|
|
|
Requires: suse-kernel-rpm-scriptlets
|
|
|
|
Requires(preun): suse-kernel-rpm-scriptlets
|
2021-11-24 09:05:20 +01:00
|
|
|
Requires(postun): suse-kernel-rpm-scriptlets
|
2013-05-01 08:12:39 +02:00
|
|
|
%{-c:Requires: %{-n*}-ueficert}
|
2011-10-05 07:01:45 +02:00
|
|
|
Enhances: kernel-%1
|
2017-06-14 16:35:28 +02:00
|
|
|
Supplements: packageand(kernel-%1:%{-n*})
|
2019-03-11 12:01:11 +01:00
|
|
|
Conflicts: %{-n*}-kmp-%1-%_this_kmp_kernel_version
|
2011-10-05 07:01:45 +02:00
|
|
|
AutoReqProv: on
|
2022-03-23 09:14:44 +01:00
|
|
|
|
|
|
|
%define run_if_exists run_if_exists() { \
|
|
|
|
if [ -x "$1" ] ; then \
|
|
|
|
"$@" \
|
|
|
|
else \
|
|
|
|
echo Cannot execute "$1" >&2 \
|
|
|
|
fi \
|
|
|
|
} \
|
|
|
|
run_if_exists
|
|
|
|
|
2011-10-05 07:01:45 +02:00
|
|
|
%{-p:%{expand:%(cd %_sourcedir; cat %{-p*})}}
|
2013-05-01 08:12:39 +02:00
|
|
|
%description -n %{-n*}-kmp-%1
|
2011-10-05 07:01:45 +02:00
|
|
|
%(
|
|
|
|
for spec in {%_sourcedir,%_specdir}/%name.spec /dev/null; do
|
|
|
|
[ -e $spec ] && break
|
|
|
|
done
|
|
|
|
awk '
|
|
|
|
/^%%/ { in_desc = \
|
|
|
|
($0 ~ /^%%description[ \t]+KMP[ \t]*$/ ||
|
|
|
|
$0 ~ /^%%description[ \t]+-n[ \t]*%name-KMP[ \t]*$/)
|
|
|
|
next }
|
|
|
|
in_desc { print; good = 1 }
|
|
|
|
END { exit(! good) }
|
|
|
|
' $spec || \
|
|
|
|
awk '
|
|
|
|
/^%%/ { in_desc = \
|
|
|
|
($0 ~ /^%%description[ \t]*$/ ||
|
|
|
|
$0 ~ /^%%description[ \t]+-n[ \t]*%name[ \t]*$/)
|
|
|
|
next }
|
|
|
|
in_desc { print; good = 1 }
|
|
|
|
END { exit(! good) }
|
|
|
|
' $spec
|
|
|
|
)
|
2021-10-08 06:38:15 +02:00
|
|
|
%pre -n %{-n*}-kmp-%1
|
2023-03-09 07:13:29 +01:00
|
|
|
%{-b:KMP_NEEDS_MKINITRD=1; export KMP_NEEDS_MKINITRD}
|
2024-02-10 08:06:46 +01:00
|
|
|
%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/kmp-pre --name "%{-n*}-kmp-%1" \
|
2021-10-08 06:38:15 +02:00
|
|
|
--version "%_this_kmp_version" --release "%{-r*}" --kernelrelease "%2" \
|
2024-03-13 09:29:45 +01:00
|
|
|
--flavor "%1" --usrmerged "%{usrmerged}" "$@"
|
2013-05-01 08:12:39 +02:00
|
|
|
%post -n %{-n*}-kmp-%1
|
2023-03-09 07:13:29 +01:00
|
|
|
%{-b:KMP_NEEDS_MKINITRD=1; export KMP_NEEDS_MKINITRD}
|
2024-02-10 08:06:46 +01:00
|
|
|
%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/kmp-post --name "%{-n*}-kmp-%1" \
|
2021-10-08 06:38:15 +02:00
|
|
|
--version "%_this_kmp_version" --release "%{-r*}" --kernelrelease "%2" \
|
2024-03-13 09:29:45 +01:00
|
|
|
--flavor "%1" --usrmerged "%{usrmerged}" "$@"
|
2013-05-01 08:12:39 +02:00
|
|
|
%preun -n %{-n*}-kmp-%1
|
2023-03-09 07:13:29 +01:00
|
|
|
%{-b:KMP_NEEDS_MKINITRD=1; export KMP_NEEDS_MKINITRD}
|
|
|
|
%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/kmp-preun --name "%{-n*}-kmp-%1" \
|
2021-10-08 06:38:15 +02:00
|
|
|
--version "%_this_kmp_version" --release "%{-r*}" --kernelrelease "%2" \
|
2024-03-13 09:29:45 +01:00
|
|
|
--flavor "%1" --usrmerged "%{usrmerged}" "$@"
|
2013-05-01 08:12:39 +02:00
|
|
|
%postun -n %{-n*}-kmp-%1
|
2023-03-09 07:13:29 +01:00
|
|
|
%{-b:KMP_NEEDS_MKINITRD=1; export KMP_NEEDS_MKINITRD}
|
|
|
|
%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/kmp-postun --name "%{-n*}-kmp-%1" \
|
2021-10-08 06:38:15 +02:00
|
|
|
--version "%_this_kmp_version" --release "%{-r*}" --kernelrelease "%2" \
|
2024-03-13 09:29:45 +01:00
|
|
|
--flavor "%1" --usrmerged "%{usrmerged}" "$@"
|
2021-10-08 06:38:15 +02:00
|
|
|
%posttrans -n %{-n*}-kmp-%1
|
2023-03-09 07:13:29 +01:00
|
|
|
%{-b:KMP_NEEDS_MKINITRD=1; export KMP_NEEDS_MKINITRD}
|
2024-02-10 08:06:46 +01:00
|
|
|
%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/kmp-posttrans --name "%{-n*}-kmp-%1" \
|
2021-10-08 06:38:15 +02:00
|
|
|
--version "%_this_kmp_version" --release "%{-r*}" --kernelrelease "%2" \
|
2024-03-13 09:29:45 +01:00
|
|
|
--flavor "%1" --usrmerged "%{usrmerged}" "$@"
|
2013-05-01 08:12:39 +02:00
|
|
|
%files -n %{-n*}-kmp-%1
|
2011-10-05 07:01:45 +02:00
|
|
|
%{-f:%{expand:%(cd %_sourcedir; cat %{-f*})}}
|
|
|
|
%{!-f:%defattr (-,root,root)}
|
2021-10-08 06:38:15 +02:00
|
|
|
%{!-f:%{kernel_module_directory}/%2-%1}
|