396caf
# Fedora macros, safe to use at SRPM build stage
396caf
396caf
# A directory for rpm macros
396caf
%rpmmacrodir /usr/lib/rpm/macros.d
396caf
396caf
# A directory for appdata metainfo.  This has changed between releases so a
396caf
# macro is useful.
396caf
%_metainfodir %{_datadir}/metainfo
396caf
396caf
# A directory for SWID tag files describing the installation
396caf
%_swidtagdir %{_prefix}/lib/swidtag/fedoraproject.org
396caf
396caf
# Applies the fedora.wordwrap filter to the content of an rpm variable, and
396caf
# prints the result.
396caf
#   – putting multiple lines of UTF-8 text inside a variable is usually
396caf
#     accomplished with %{expand:some_text}
396caf
# Control variables, flags and arguments:
396caf
#   -v <variable_name>  (default value: _description)
396caf
%wordwrap(v:) %{lua:
396caf
local   fedora = require "fedora.common"
396caf
local variable = "%{?" .. rpm.expand("%{-v*}%{!-v:_description}") .. "}"
396caf
print(fedora.wordwrap(variable))
396caf
}
396caf
396caf
# A single Name: and %package substitute
396caf
# Control variables, flags and arguments:
396caf
#   %{source_name}         the SRPM name
396caf
#   %{source_summary}      the SRPM summary
396caf
#   %{source_description}  the SRPM description
396caf
#   -n <name>              declare a package named <name>
396caf
#                          (%package-like behavior)
396caf
#   -v                     be verbose
396caf
#   %1                     declare a package named %{source_name}-%{%1}
396caf
#                          (%package-like behavior)
396caf
%new_package(n:v) %{lua:
396caf
local      fedora = require "fedora.common"
396caf
local    pkg_name = fedora.readflag("n")
396caf
local     verbose = fedora.hasflag("v")
396caf
local name_suffix = fedora.read("1")
396caf
local source_name = fedora.read("source_name")
396caf
local       first = not ( fedora.read("name") or fedora.read("currentname") )
396caf
fedora.new_package(source_name, pkg_name, name_suffix, first, verbose)
396caf
}