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