Simplify the API of %gpgverify

Instead of:

  %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'

It is now possible to do:

  %gpgverify -k2 -s1 -d0

I haven't yet assumed any defaults not to break backwards compatibility.
This commit is contained in:
Miro Hrončok 2019-07-25 11:14:52 +02:00
parent 0b30be56e5
commit 3490049617
1 changed files with 16 additions and 1 deletions

View File

@ -43,4 +43,19 @@ fedora.writevars(macrofile,rpmvars)
}
# gpgverify verifies signed sources. There is documentation in the script.
%gpgverify %{_rpmconfigdir}/redhat/gpgverify
%gpgverify(k:s:d:) %{lua:
local script = rpm.expand("%{_rpmconfigdir}/redhat/gpgverify ")
local keyring = rpm.expand("%{-k*}")
local signature = rpm.expand("%{-s*}")
local data = rpm.expand("%{-d*}")
print(script)
if keyring ~= "" then
print(rpm.expand("--keyring '%{SOURCE" .. keyring .. "}' "))
end
if signature ~= "" then
print(rpm.expand("--signature '%{SOURCE" .. signature .. "}' "))
end
if data ~= "" then
print(rpm.expand("--data '%{SOURCE" .. data .. "}' "))
end
}