mirror of
https://abf.rosa.ru/djam/auto-krokodil.git
synced 2025-02-23 18:42:58 +00:00
add macros to extract major and minor nvidia version
This commit is contained in:
parent
34a69ebc4a
commit
d7c49bf34e
2 changed files with 12 additions and 1 deletions
|
@ -3,7 +3,7 @@ Name: auto-krokodil
|
|||
Group: System/Kernel and hardware
|
||||
License: GPLv3
|
||||
Url: https://abf.io/import/auto-krokodil
|
||||
Version: 0.9
|
||||
Version: 0.10
|
||||
Release: 1
|
||||
BuildArch: noarch
|
||||
%ifarch %{ix86} %{x86_64}
|
||||
|
|
|
@ -101,3 +101,14 @@ Requires: (kmod-nvidia%{-j*}.%{-n*}-kabi(%{-p*}) if nvidia%{-j*}) \
|
|||
Requires: (kmod-nvidia-%{-k*}-%{-f*}(%{-j*}.%{-n*}) if kernel-%{-k*}-%{-f*}) \
|
||||
%{nil} \
|
||||
}
|
||||
|
||||
# Extract major and minor versions of package $1
|
||||
# Example:
|
||||
# kernel-source-nvidia390 has version 390.5
|
||||
# korko_j will extract 390, kroko_n will extract 5
|
||||
# See also: https://github.com/rpm-software-management/rpm/pull/1794
|
||||
# p - name of package which version to extract (e.g.: kernel-source-nvidia390)
|
||||
# r - any number (e.g.: 0, 1, 390 etc.)
|
||||
# needed at SRPM stage when _j and _n cannot extract real versions to avoid duplicate subpackages
|
||||
%kroko_j(p:r:) %(if rpm -q %{-p*} >/dev/null 2>&1; then rpm -q --qf '%%{version}' %{-p*} | awk -F '.' '{print $1}'; else echo %{-r*}; fi)
|
||||
%kroko_n(p:r:) %(if rpm -q %{-p*} >/dev/null 2>&1; then rpm -q --qf '%%{version}' %{-p*} | awk -F '.' '{print $2}'; else echo %{-r*}; fi)
|
||||
|
|
Loading…
Add table
Reference in a new issue