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