#24 Add %{epoch} to Requires line if needed
Opened 11 months ago by tagoh. Modified 11 months ago
tagoh/fonts-rpm-macros epoch-in-req  into  main

file modified
+21 -2
@@ -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             .. [[

no initial comment

rebased onto 3b375c0

11 months ago

2 new commits added

  • Add fontheader support for meta packages
  • Add %{epoch} to Requires line if needed
11 months ago

2 new commits added

  • Add fontheader support for meta packages
  • Add %{epoch} to Requires line if needed
11 months ago
Metadata