PHP 7.4.33
Preview: macros.fedora-misc Size: 2.76 KB
//lib/rpm/macros.d/macros.fedora-misc

# Some miscellaneous Fedora-related macros

# List files matching inclusion globs, excluding files matching exclusion blogs
# Optional parameters:
#  – -i "<globs>" inclusion globs
#  – -x "<globs>" exclusion globs
# Globs are space-separated lists of shell globs. Such lists require %{quote:}
# use for safe rpm argument passing.
# Alternatively, set the following rpm variables before calling the macro:
#  – “listfiles_include” inclusion globs
#  — “listfiles_exclude” exclusion globs
# Arguments passed to the macro without flags will be interpreted as inclusion
# globs.
%listfiles(i:x:) %{expand:
%if %{lua: print(string.len(rpm.expand("%{?-i*}%{?listfiles_include}%*")))}
  listfiles_include=$(realpath -e --relative-base=. %{?-i*} %{?listfiles_include} %* | sort -u)
  %if  %{lua: print(string.len(rpm.expand("%{?-x*}%{?listfiles_exclude}")))}
    while IFS= read -r finc ; do
      realpath -qe --relative-base=. %{?-x*} %{?listfiles_exclude} \\
        | sort -u | grep -q "${finc}" || echo "${finc}"
    done <<< "${listfiles_include}"
  %else
    echo "${listfiles_include}"
  %endif
%endif
}

# https://github.com/rpm-software-management/rpm/issues/581
# Write the contents of a list of rpm variables to a macro file.
# The target file must contain the corresponding anchors.
# For example %writevars -f myfile foo bar will replace:
#  @@FOO@@ with the rpm evaluation of %{foo} and
#  @@BAR@@ with the rpm evaluation of %{bar}
# in myfile
%writevars(f:) %{lua:
local    fedora = require "fedora.common"
local macrofile = rpm.expand("%{-f*}")
local   rpmvars = {}
for i = 1, rpm.expand("%#") do
  table.insert(rpmvars, rpm.expand("%" .. i))
end
fedora.writevars(macrofile,rpmvars)
}

# gpgverify verifies signed sources. There is documentation in the script.
%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
}

# gpgverify verifies signed sources. There is documentation in the script.
%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
}

Directory Contents

Dirs: 0 × Files: 32

Name Size Perms Modified Actions
1.76 KB lrw-r--r-- 2023-04-06 08:55:45
Edit Download
3.01 KB lrw-r--r-- 2021-04-08 10:38:23
Edit Download
75 B lrw-r--r-- 2020-07-30 12:13:34
Edit Download
2.76 KB lrw-r--r-- 2023-04-06 08:55:45
Edit Download
239 B lrw-r--r-- 2023-04-06 08:55:45
Edit Download
239 B lrw-r--r-- 2025-03-11 09:51:08
Edit Download
12.43 KB lrw-r--r-- 2023-04-06 08:55:45
Edit Download
414 B lrw-r--r-- 2018-08-12 10:37:49
Edit Download
7.17 KB lrw-r--r-- 2021-04-08 14:45:20
Edit Download
390 B lrw-r--r-- 2022-04-18 17:09:26
Edit Download
116 B lrw-r--r-- 2023-04-06 08:55:45
Edit Download
73 B lrw-r--r-- 2023-04-06 08:55:45
Edit Download
307 B lrw-r--r-- 2023-04-06 08:55:45
Edit Download
181 B lrw-r--r-- 2023-04-06 08:55:45
Edit Download
324 B lrw-r--r-- 2023-04-06 08:55:45
Edit Download
737 B lrw-r--r-- 2019-10-14 08:31:03
Edit Download
104 B lrw-r--r-- 2019-10-16 20:47:30
Edit Download
5.06 KB lrw-r--r-- 2023-05-18 21:20:52
Edit Download
794 B lrw-r--r-- 2019-10-13 14:18:38
Edit Download
886 B lrw-r--r-- 2023-05-16 12:55:39
Edit Download
3.36 KB lrw-r--r-- 2023-05-16 12:55:39
Edit Download
5.95 KB lrw-r--r-- 2023-05-16 12:55:39
Edit Download
1.82 KB lrw-r--r-- 2022-04-21 15:26:14
Edit Download
3.63 KB lrw-r--r-- 2023-05-16 12:55:39
Edit Download
61 B lrw-r--r-- 2018-01-08 19:15:07
Edit Download
13.53 KB lrw-r--r-- 2023-04-01 16:10:31
Edit Download
6.61 KB lrw-r--r-- 2024-12-17 04:10:18
Edit Download
4.03 KB lrw-r--r-- 2025-04-22 01:58:19
Edit Download
206 B lrw-r--r-- 2023-10-14 13:06:48
Edit Download
127 B lrw-r--r-- 2023-04-06 08:55:45
Edit Download
40 B lrw-r--r-- 2022-08-02 16:44:39
Edit Download
228 B lrw-r--r-- 2023-04-06 08:55:45
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).