Blame SOURCES/load.inc

d54c42
%{lua:
d54c42
d54c42
function source_macros(file)
d54c42
  local macro = nil
d54c42
d54c42
  for line in io.lines(file) do
d54c42
    if not macro and line:match("^%%") then
d54c42
      macro = line:match("^%%(.*)$")
d54c42
      line = nil
d54c42
    end
d54c42
d54c42
    if macro then
d54c42
      if line and macro:match("^.-%s*\\%s*$") then
d54c42
        macro = macro .. '\n' .. line
d54c42
      end
d54c42
d54c42
      if not macro:match("^.-%s*\\%s*$") then
d54c42
        rpm.define(macro)
d54c42
        macro = nil
d54c42
      end
d54c42
    end
d54c42
  end
d54c42
end
d54c42
d54c42
}
d54c42
d54c42
# Include the constants defined in macros files. Could be dropped as soon as
d54c42
# RPM supports the %%load macro (RPM 4.12+ probably).
d54c42
# http://lists.rpm.org/pipermail/rpm-maint/2014-February/003659.html
d54c42
%define load() %{lua:source_macros(rpm.expand("%1"))}