| |
@@ -150,13 +150,31 @@
|
| |
]]))
|
| |
end
|
| |
|
| |
+ -- Output Requires(meta) line
|
| |
+ local function output_requires(fontpkg)
|
| |
+ if tonumber(rpm.expand("0%{?epoch}")) == 0 then
|
| |
+ print(rpm.expand( "Requires(meta): " .. fontpkg .. " = %{version}-%{release}\n"))
|
| |
+ else
|
| |
+ print(rpm.expand( "Requires(meta): " .. fontpkg .. " = %{epoch}:%{version}-%{release}\n"))
|
| |
+ end
|
| |
+ end
|
| |
+
|
| |
-- Create a font (sub)metapackage header
|
| |
local function metapkg(name, summary, description, suffixes)
|
| |
local fedora = require "fedora.common"
|
| |
local fontpkgs = fedora.getsuffixed("fontname")
|
| |
+ local hsuffix
|
| |
if (name == "") then
|
| |
name, _ = string.gsub(rpm.expand("%{source_name}"), "-fonts$", "")
|
| |
name = name .. "-fonts-all"
|
| |
+ hsuffix = "all"
|
| |
+ else
|
| |
+ hsuffix = norm(name)
|
| |
+ end
|
| |
+ if (rpm.expand("%{?fontheader" .. hsuffix .. "}") ~= "") then
|
| |
+ fedora.explicitset( "currentfontheader", "%{fontheader" .. hsuffix .. "}", false)
|
| |
+ else
|
| |
+ fedora.explicitunset("currentfontheader", false)
|
| |
end
|
| |
if (summary == "") then
|
| |
summary = "All the font packages, created in %{source_name}"
|
| |
@@ -177,18 +195,19 @@
|
| |
]]))
|
| |
if (suffixes == "") then
|
| |
for _, fontpkg in pairs(fontpkgs) do
|
| |
- print(rpm.expand( "Requires(meta): " .. fontpkg .. " = %{version}-%{release}\n"))
|
| |
+ output_requires(fontpkg)
|
| |
end
|
| |
else
|
| |
for suffix in string.gmatch(rpm.expand(suffixes), "[^%s%p]+") do
|
| |
local fontpkg = fontpkgs[suffix]
|
| |
if (fontpkg ~= nil) then
|
| |
- print(rpm.expand("Requires(meta): " .. fontpkg .. " = %{version}-%{release}\n"))
|
| |
+ output_requires(fontpkg)
|
| |
end
|
| |
end
|
| |
end
|
| |
print(rpm.expand([[
|
| |
BuildArch: noarch
|
| |
+ %{?currentfontheader}
|
| |
%description -n ]] .. name .. [[
|
| |
|
| |
]] .. description .. [[
|
| |