macros.ldc-srpm 0000644 00000000111 15055650401 0007465 0 ustar 00 # arches that ldc builds on
%ldc_arches %{ix86} x86_64 %{arm} %{power64}
macros.alt-python310 0000644 00000004011 15055650401 0010272 0 ustar 00 %__alt_python310 /opt/alt/python310/bin/python3
%alt_python310_sitelib %(%{__alt_python310} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
%alt_python310_sitearch %(%{__alt_python310} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))")
%alt_python310_version %(%{__alt_python310} -Ic "import sys; sys.stdout.write(sys.version[:3])")
%alt_python310_version_nodots %(%{__alt_python310} -Ic "import sys; sys.stdout.write(sys.version[:3].replace('.',''))")
%alt_py310dir %{_builddir}/python3-%{name}-%{version}-%{release}
%alt_python310_dir /opt/alt/python310
%py_setup setup.py
%alt_py310_shbang_opts -s
%alt_py310_shbang_opts_nodash %(opts=%{alt_py310_shbang_opts}; echo ${opts#-})
# Use the slashes after expand so that the command starts on the same line as
# the macro
%alt_py310_build() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python310} %{py_setup} %{?py_setup_args} build --executable="%{__alt_python310} %{alt_py310_shbang_opts}" %{?*}
}
%alt_py310_build_egg() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python310} %{py_setup} %{?py_setup_args} bdist_egg %{?*}
}
%alt_py310_build_wheel() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python310} %{py_setup} %{?py_setup_args} bdist_wheel %{?*}
}
%alt_py310_install() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python310} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
}
%alt_py310_install_egg() %{expand:\\\
mkdir -p %{buildroot}%{alt_python310_sitelib}
%alt_easy_install-3.9 -m --prefix %{buildroot}%{_prefix} -Z dist/*-py3.9.egg %{?*}
%{alt_python310_dir}/bin/easy_install-3.9 %{alt_python310_locate}/bin/easy_install-3.9
}
%alt_py310_install_wheel() %{expand:\\\
%{alt_python310_dir}/bin/pip3.9 install -I dist/%{1} --root %{buildroot} --no-deps
}
macros.alt-python312 0000644 00000004016 15055650401 0010301 0 ustar 00 %__alt_python312 /opt/alt/python312/bin/python3
%alt_python312_sitelib %(%{__alt_python312} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
%alt_python312_sitearch %(%{__alt_python312} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))")
%alt_python312_version %(%{__alt_python312} -Ic "import sys; sys.stdout.write(sys.version[:3])")
%alt_python312_version_nodots %(%{__alt_python312} -Ic "import sys; sys.stdout.write(sys.version[:3].replace('.',''))")
%alt_py312dir %{_builddir}/python3-%{name}-%{version}-%{release}
%alt_python312_dir /opt/alt/python312
%py_setup setup.py
%alt_py312_shbang_opts -s
%alt_py312_shbang_opts_nodash %(opts=%{alt_py312_shbang_opts}; echo ${opts#-})
# Use the slashes after expand so that the command starts on the same line as
# the macro
%alt_py312_build() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python312} %{py_setup} %{?py_setup_args} build --executable="%{__alt_python312} %{alt_py312_shbang_opts}" %{?*}
}
%alt_py312_build_egg() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python312} %{py_setup} %{?py_setup_args} bdist_egg %{?*}
}
%alt_py312_build_wheel() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python312} %{py_setup} %{?py_setup_args} bdist_wheel %{?*}
}
%alt_py312_install() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python312} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
}
%alt_py312_install_egg() %{expand:\\\
mkdir -p %{buildroot}%{alt_python312_sitelib}
%alt_easy_install-3.12 -m --prefix %{buildroot}%{_prefix} -Z dist/*-py3.12.egg %{?*}
%{alt_python312_dir}/bin/easy_install-3.12 %{alt_python312_locate}/bin/easy_install-3.12
}
%alt_py312_install_wheel() %{expand:\\\
%{alt_python312_dir}/bin/pip3.12 install -I dist/%{1} --root %{buildroot} --no-deps
}
macros.ocaml-srpm 0000644 00000001341 15055650401 0010024 0 ustar 00 # Note that OCaml is compiled on all architectures. However
# on some (rare) architectures, only bytecode compilation is
# available. Use these macros to find out if native code
# compilation is available on a particular architecture.
# Architectures that support the OCaml native code compiler.
%ocaml_native_compiler aarch64 %{arm} %{ix86} ppc ppc64 ppc64le riscv64 s390x sparc sparcv9 x86_64
# Architectures that support native dynamic linking of OCaml code.
%ocaml_natdynlink aarch64 %{arm} %{ix86} ppc ppc64 ppc64le riscv64 s390x sparc sparcv9 x86_64
# Architectures that support profiling of native code (ocamlopt -p).
%ocaml_native_profiling %{arm} %{ix86} ppc ppc64 ppc64le sparc sparcv9 x86_64
macros.openblas-srpm 0000644 00000000150 15055650401 0010531 0 ustar 00 # Architectures that OpenBLAS supports
%openblas_arches x86_64 %{ix86} armv7hl %{power64} aarch64 s390x
macros.python-srpm 0000644 00000013715 15055650401 0010262 0 ustar 00 # python3_pkgversion specifies the version of Python 3 in the distro. It can be
# a specific version (e.g. 34 in Fedora EPEL7)
%python3_pkgversion 3
# Set to /bin/true to avoid %ifdefs and %{? in specfiles
%__python3_other /bin/true
%py3_other_build /bin/true
%py3_other_install /bin/true
# Define where Python wheels will be stored and the prefix of -wheel packages
# - In Fedora we want wheel subpackages named e.g. `python-pip-wheel` that
# install packages into `/usr/share/python-wheels`. Both names are not
# versioned, because they're used by all Python 3 stacks.
# - In RHEL we want wheel packages named e.g. `python3-pip-wheel` and
# `python3.11-pip-wheel` that install packages into similarly versioned
# locations. We want each Python stack in RHEL to have their own wheels,
# because the main python3 wheels (which we can't upgrade) will likely be
# quite old by the time we're adding new alternate Python stacks.
# - In ELN we want to follow Fedora, because builds for ELN and Fedora rawhide
# need to be interoperable.
%python_wheel_pkg_prefix python%{?rhel:%{!?eln:%{python3_pkgversion}}}
%python_wheel_dir %{_datadir}/%{python_wheel_pkg_prefix}-wheels
# === Macros for Build/Requires tags using Python dist tags ===
# - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
# - These macros need to be in macros.python-srpm, because BuildRequires tags
# get rendered as runtime requires into the metadata of SRPMs.
# Converts Python dist name to a canonical format
%py_dist_name() %{lua:\
name = rpm.expand("%{?1:%{1}}");\
canonical = string.gsub(string.lower(name), "[^%w%.]+", "-");\
print(canonical);\
}
# Creates Python 2 dist tag(s) after converting names to canonical format
# Needs to first put all arguments into a list, because invoking a different
# macro (%py_dist_name) overwrites them
%py2_dist() %{lua:\
args = {}\
arg = 1\
while (true) do\
name = rpm.expand("%{?" .. arg .. ":%{" .. arg .. "}}");\
if (name == nil or name == '') then\
break\
end\
args[arg] = name\
arg = arg + 1\
end\
for arg, name in ipairs(args) do\
canonical = rpm.expand("%py_dist_name " .. name);\
print("python2dist(" .. canonical .. ") ");\
end\
}
# RHEL 9+ and Fedora compatibility macro
# Only use in macro backports, not intended to be used in spec files!
# In the future, the %%python3_pkgversion macro has a dot, e.g. 3.9 or 3.11
# However, in RHEL 8 at least, it does not, e.g. 38, 39
# This is a helpful macro that determines the proper "Python version" string with dot
# from %%python3_pkgversion without actually having Python installed.
# For values other than 3X, it should expand to %%python3_pkgversion unchanged.
# Examples of %%python3_pkgversion -> %%_python3_pkgversion_with_dot:
# 3 -> 3
# 38 -> 3.8
# 39 -> 3.9
# 310 -> 3.10
# 3.12 -> 3.12
# 4 -> 4
# 412 -> 412
%_python3_pkgversion_with_dot %{lua:print((rpm.expand("%python3_pkgversion"):gsub('^3(%d)', '3.%1')))}
# Creates Python 3 dist tag(s) after converting names to canonical format
# Needs to first put all arguments into a list, because invoking a different
# macro (%py_dist_name) overwrites them
%py3_dist() %{lua:\
python3_pkgversion_with_dot = rpm.expand("%_python3_pkgversion_with_dot")\
args = {}\
arg = 1\
while (true) do\
name = rpm.expand("%{?" .. arg .. ":%{" .. arg .. "}}");\
if (name == nil or name == '') then\
break\
end\
args[arg] = name\
arg = arg + 1\
end\
for arg, name in ipairs(args) do\
canonical = rpm.expand("%py_dist_name " .. name);\
print("python" .. python3_pkgversion_with_dot .. "dist(" .. canonical .. ") ");\
end\
}
# Macro to replace overly complicated references to PyPI source files.
# Expands to the pythonhosted URL for a package
# Accepts zero to three arguments:
# 1: The PyPI project name, defaulting to %srcname if it is defined, then
# %pypi_name if it is defined, then just %name.
# 2: The PYPI version, defaulting to %version with tildes stripped.
# 3: The file extension, defaulting to "tar.gz". (A period will be added
# automatically.)
# Requires %__pypi_url and %__pypi_default_extension to be defined.
%__pypi_url https://files.pythonhosted.org/packages/source/
%__pypi_default_extension tar.gz
%pypi_source() %{lua:
local src = rpm.expand('%1')
local ver = rpm.expand('%2')
local ext = rpm.expand('%3')
local url = rpm.expand('%__pypi_url')
\
-- If no first argument, try %srcname, then %pypi_name, then %name
-- Note that rpm leaves macros unchanged if they are not defined.
if src == '%1' then
src = rpm.expand('%srcname')
end
if src == '%srcname' then
src = rpm.expand('%pypi_name')
end
if src == '%pypi_name' then
src = rpm.expand('%name')
end
\
-- If no second argument, use %version
if ver == '%2' then
ver = rpm.expand('%version'):gsub('~', '')
end
\
-- If no third argument, use the preset default extension
if ext == '%3' then
ext = rpm.expand('%__pypi_default_extension')
end
\
local first = string.sub(src, 1, 1)
\
print(url .. first .. '/' .. src .. '/' .. src .. '-' .. ver .. '.' .. ext)
}
# Python packages in RHEL 8 should not provide unversioned python- names
# so this macro here is just a compatibility layer and only provides the given name.
%py_provides() %{lua:
local name = rpm.expand('%1')
if name == '%1' then
rpm.expand('%{error:%%py_provides requires at least 1 argument, the name to provide}')
end
local evr = rpm.expand('%2')
if evr == '%2' then
evr = rpm.expand('%{?epoch:%{epoch}:}%{version}-%{release}')
end
print('Provides: ' .. name .. ' = ' .. evr .. '\\n')
}
macros.forge 0000644 00000030675 15055650401 0007070 0 ustar 00 # Map forge information to rpm metadata. This macro will compute default spec
# variable values.
#
# The following spec variables SHOULD be set before calling the macro:
#
# forgeurl the project url on the forge, strongly recommended;
# alternatively, use -u <url>
# Version if applicable, set it with Version: <version>
# tag if applicable
# commit if applicable
#
# The macro will attempt to compute and set the following variables if they are
# not already set by the packager:
#
# forgesource an URL that can be used as SourceX: value
# forgesetupargs the correct arguments to pass to %setup for this source
# used by %forgesetup and %forgeautosetup
# archivename the source archive filename, without extentions
# archiveext the source archive filename extensions, without leading dot
# archiveurl the url that can be used to download the source archive,
# without renaming
# scm the scm type, when packaging code snapshots: commits or tags
#
# If the macro is unable to parse your forgeurl value set at least archivename
# and archiveurl before calling it.
#
# Most of the computed variables are both overridable and optional. However,
# the macro WILL REDEFINE %{dist} when packaging a snapshot (commit or tag).
# The previous %{dist} value will be lost. Don’t call the macro if you don’t
# wish %{dist} to be changed.
#
# Optional parameters:
# -u <url> Ignore forgeurl even if it exists and use <url> instead. Note
# that the macro will still end up setting <url> as the forgeurl
# spec variable if it manages to parse it.
# -s Silently ignore problems in forgeurl, use it if it can be parsed,
# ignore it otherwise.
# -p Restore problem handling, override -s.
# -v Be verbose and print every spec variable the macro sets.
# -i Print some info about the state of spec variables the macro may use or
# set at the end of the processing.
%forgemeta(u:spvi) %{lua:
local forgeurl = rpm.expand("%{?-u*}")
if (forgeurl == "") then
forgeurl = rpm.expand("%{?forgeurl}")
end
local silent = false
local verbose = false
local informative = false
if (rpm.expand("%{?-s}") ~= "") then
silent = true
end
if (rpm.expand("%{?-p}") ~= "") then
silent = false
end
if (rpm.expand("%{?-v}") ~= "") then
verbose = true
end
if (rpm.expand("%{?-i}") ~= "") then
informative = true
end
local tag = rpm.expand("%{?tag}")
local commit = rpm.expand("%{?commit}")
-- Be explicit about the spec variables we’re setting
local function explicitset(rpmvariable,value)
rpm.define(rpmvariable .. " " .. value)
if verbose then
rpm.expand("%{echo:Setting %%{" .. rpmvariable .. "} = " .. value .. "\\n}")
end
end
-- Never ever stomp on a spec variable the packager already set
local function safeset(rpmvariable,value)
if (rpm.expand("%{?" .. rpmvariable .. "}") == "") then
explicitset(rpmvariable,value)
end
end
-- Set spec variable values for each known software publishing service
if (forgeurl ~= "") then
local forge = string.match(forgeurl, "^[^:]+://([^/]+)/")
if (forge == nil) then
if not silent then
rpm.expand("%{error:URLs must include a protocol such as https:// and a path starting with / !\\n}")
end
else
if (string.match(forge, "^gitlab[%.-]") or string.match(forge, "[%.-]gitlab[%.]")) then
forgeurl = string.match(forgeurl, "https://[^/]+/[^/]+/[^/#?]+")
if (forgeurl == nil) then
if not silent then
rpm.expand("%{error:Gitlab URLs must match https://(…[-.])gitlab[-.]…/owner/repo !\\n}")
end
else
explicitset("forgeurl", forgeurl)
if (commit == "") then
rpm.expand("%{error:All Gitlab URLs require commit value knowledge: you need to define %{commit}!\\nPlease vote on https://gitlab.com/gitlab-org/gitlab-ce/issues/38830\\n}")
end
safeset("archiveext", "tar.bz2")
safeset("forgesetupargs", "-n %{archivename}")
if (commit ~= "") or (tag ~= "") then
safeset("scm", "git")
end
local owner = string.match(forgeurl, "^[^:]+://[^/]+/([^/]+)")
local repo = string.match(forgeurl, "^[^:]+://[^/]+/[^/]+/([^/]+)")
local version = rpm.expand("%{?version}")
if (version ~= "") and (version ~= "0") and (tag == "") then
-- GitLab does not have strong versionning semantics
-- Some projects use "version" as release tag, others "v" + "version"
-- Tag value needs to be explicitly declared before calling the macro
-- in the second case
tag = version
safeset("tag", tag)
end
if (tag ~= "") then
safeset("archivename", repo .. "-%{tag}-%{commit}")
safeset("archiveurl", "%{forgeurl}/repository/%{tag}/archive.%{archiveext}")
else
safeset("archivename", repo .. "-%{commit}")
safeset("archiveurl", "%{forgeurl}/repository/%{commit}/archive.%{archiveext}")
end
end
end
if (string.match(forge, "^github[%.-]") or string.match(forge, "[%.-]github[%.]")) then
forgeurl = string.match(forgeurl, "https://[^/]+/[^/]+/[^/#?]+")
if (forgeurl == nil) then
if not silent then
rpm.expand("%{error:GitHub URLs must match https://(…[-.])github[-.]…/owner/repo !\\n}")
end
else
explicitset("forgeurl", forgeurl)
safeset("archiveext", "tar.gz")
local forgesetupargs = "-n %{archivename}"
if (commit ~= "") or (tag ~= "") then
safeset("scm", "git")
end
local owner = string.match(forgeurl, "^[^:]+://[^/]+/([^/]+)")
local repo = string.match(forgeurl, "^[^:]+://[^/]+/[^/]+/([^/]+)")
if (tag ~= "") then
-- if upstream used a version suffix such as -rc1 or -beta it will not
-- be a valid version string for rpm but github will accept it fine and
-- use the same naming as for other versions: v prefix in the tag and
-- archivename, no v prefix in the topdir naming inside the archive
local version = rpm.expand("%{?version}")
if version ~= "" and
(string.match(tag, "^v" .. version .. "[^%d]") or
string.match(tag, "^v" .. version .. "$")) then
forgesetupargs = "-n " .. repo .. "-" .. string.gsub(tag, "^v", "")
end
safeset("archivename", repo .. "-%{tag}")
safeset("archiveurl", "%{forgeurl}/archive/%{tag}.%{archiveext}")
else
if (commit ~= "") then
safeset("archivename", repo .. "-%{commit}")
safeset("archiveurl", "%{forgeurl}/archive/%{commit}/" .. repo .. "-%{commit}.%{archiveext}")
else
safeset("archivename", repo .. "-%{version}")
safeset("archiveurl", "%{forgeurl}/archive/v%{version}.%{archiveext}")
end
end
safeset("forgesetupargs", forgesetupargs)
end
end
if (forge == "code.googlesource.com") then
forgeurl = string.match(forgeurl, "https://code.googlesource.com/[^#?]*[^/#?]+")
if (forgeurl == nil) then
if not silent then
rpm.expand("%{error:Googlesource URLs must match https://code.googlesource.com/…/repo !\\n}")
end
else
explicitset("forgeurl", forgeurl)
safeset("archiveext", "tar.gz")
safeset("forgesetupargs", "-c")
if (commit ~= "") or (tag ~= "") then
safeset("scm", "git")
end
local repo = string.match(forgeurl, "^[^:]+://.+/([^/?#]+)")
if (tag ~= "") then
safeset("archivename", repo .. "-%{tag}")
safeset("archiveurl", "%{forgeurl}/+archive/%{tag}.%{archiveext}")
else
if (commit ~= "") then
safeset("archivename", repo .. "-%{commit}")
safeset("archiveurl", "%{forgeurl}/+archive/%{commit}.%{archiveext}")
else
safeset("archivename", repo .. "-v%{version}")
safeset("archiveurl", "%{forgeurl}/+archive/v%{version}.%{archiveext}")
end
end
end
end
if (forge == "bitbucket.org") then
forgeurl = string.match(forgeurl, "https://[^/]+/[^/]+/[^/#?]+")
if (forgeurl == nil) then
if not silent then
rpm.expand("%{error:BitBucket URLs must match https://bitbucket.org/owner/repo !\\n}")
end
else
explicitset("forgeurl", forgeurl)
if (commit == "") then
rpm.expand("%{error:All BitBucket URLs require commit value knowledge: you need to define %{commit}!\\n}")
end
local shortcommit = string.sub(commit, 1, 12)
safeset("archiveext", "tar.bz2")
-- Default to git even though BitBucket allows choosing between several SCMs
-- Set scm to hg for example before calling the macro if your project does not use git
safeset("scm", "git")
local owner = string.match(forgeurl, "^[^:]+://[^/]+/([^/]+)")
local repo = string.match(forgeurl, "^[^:]+://[^/]+/[^/]+/([^/]+)")
safeset("archivename", owner .. "-" .. repo .. "-" .. shortcommit)
safeset("forgesetupargs", "-n %{archivename}")
if (tag ~= "") then
safeset("archiveurl", "%{forgeurl}/get/%{tag}.%{archiveext}")
else
safeset("archiveurl", "%{forgeurl}/get/%{commit}.%{archiveext}")
end
end
end
if (forge == "pagure.io") then
if not silent then
rpm.expand("%{error:https://pagure.io/pagure/issue/861 needs to be resolved before the “pagure.io”\\nsoftware publishing service can be supported.\\n}")
end
end
-- Final tests to check forgeurl was successfuly parsed
if not silent then
if (rpm.expand("%{?archivename}") == "") or (rpm.expand("%{?archiveurl}") == "") then
rpm.expand("%{error:Automation for the “" .. forge .. "”\\nsoftware publishing service is not implemented yet.\\nPlease extend the %%forgemeta macro!\\n}")
end
end
end
end
-- Set defaults if forgeurl is missing or does not parse
local archivename = rpm.expand("%{?archivename}")
safeset("archiveext", "tar.gz")
if (archivename ~= "") then
safeset("forgesetupargs", "-n %{archivename}")
end
if (commit ~= "") or (tag ~= "") then
safeset("scm", "git")
end
-- Source URL processing (computing the forgesource spec variable)
local archiveurl = rpm.expand("%{?archiveurl}")
local archiveext = rpm.expand("%{?archiveext}")
if (archivename ~= "") and (archiveurl ~= "") then
if (string.match(archiveurl, "/([^/]+)$") == archivename .. "." .. archiveext) then
safeset("forgesource", "%{archiveurl}")
else
safeset("forgesource", "%{?archiveurl}#/%{?archivename}.%{archiveext}")
end
end
-- dist processing (computing the correct pefix for snapshots)
local distprefix = rpm.expand("%{?tag}")
local version = rpm.expand("%{?version}")
if (distprefix == version) or (distprefix == "v" .. version) then
distprefix = ""
end
if (distprefix == "") then
distprefix = string.sub(rpm.expand("%{?commit}"), 1, 7)
end
if (distprefix ~= "") then
local dist = ".%([ -r %{_sourcedir}/%{archivename}.%{archiveext} ] && date +%Y%m%d -u -r %{_sourcedir}/%{archivename}.%{archiveext})%{scm}" .. string.gsub(distprefix, "-",".") .. rpm.expand("%{?dist}")
explicitset("dist", dist)
end
-- Final spec variable summary if the macro was called with -i
if informative then
rpm.expand("%{echo:Forge-specific packaging variables\\n}")
rpm.expand("%{echo: forgeurl: %{?forgeurl}\\n}")
rpm.expand("%{echo: forgesource: %{?forgesource}\\n}")
rpm.expand("%{echo: forgesetupargs: %{?forgesetupargs}\\n}")
rpm.expand("%{echo:Generic variables\\n}")
rpm.expand("%{echo: archivename: %{?archivename}\\n}")
rpm.expand("%{echo: archiveext: %{?archiveext}\\n}")
rpm.expand("%{echo: archiveurl: %{?archiveurl}\\n}")
rpm.expand("%{echo: scm: %{?scm}\\n}")
rpm.expand("%{echo: tag: %{?tag}\\n}")
rpm.expand("%{echo: commit: %{?commit}\\n}")
rpm.expand("%{echo: dist: %{?dist} (snapshot date is computed once %%{_sourcedir}/%%{archivename}.%%{archiveext} is available)\\n}")
end
}
# Convenience macro to relay computed arguments to %setup
%forgesetup(a:b:cDn:Tq) %setup %{?forgesetupargs} %{-a} %{-b} %{-c} %{-D} %{-n} %{-T} %{-q}
# Convenience macro to relay computed arguments to %autosetup
%forgeautosetup(a:b:cDn:TvNS:p:) %autosetup %{?forgesetupargs} %{-a} %{-b} %{-c} %{-D} %{-n} %{-T} %{-v} %{-N} %{-S} %{-p}
macros.go-srpm 0000644 00000016256 15055650401 0007351 0 ustar 00 # Copyright (c) 2015-2021 Jakub Cajka <jcajka@redhat.com>,
# Jan Chaloupka <jchaloup@redhat.com>,
# Nicolas Mailhot <nim@fedoraproject.org>
# Alejandro Saez Morollon <asm@redhat.com>
# This file is distributed under the terms of GNU GPL license version 3, or
# any later version.
# This file contains macros for building projects in golang for packages
# with golang compiler or gcc-go compiler based on an architecture.
# Golang is primarly for primary architectures, gcc-go for secondary.
#
# This file provides only macros and must not use any other package except
# redhat-rpm-macros.
# Define arches for PA and SA
%golang_arches x86_64 %{arm} aarch64 ppc64le s390x
%gccgo_arches %{mips}
%go_arches %{golang_arches} %{gccgo_arches}
# Where to set GOPATH for builds
%gopath %{_datadir}/gocode
# Define go_compilers macro to signal go-compiler package is available
%go_compiler 1
# Sanitize a Go import path that can then serve as rpm package name
# Mandatory parameter: a Go import path
%gorpmname() %{lua:
local goname = rpm.expand("%1")
-- lowercase and end with '/'
goname = string.lower(goname .. "/")
-- remove eventual protocol prefix
goname = string.gsub(goname, "^http(s?)://", "")
-- add golang prefix
goname = "golang-" .. goname
-- remove FQDN root (.com, .org, etc)
goname = string.gsub(goname, "^([^/]+)%.([^%./]+)/", "%1/")
-- special-case x.y.z number-strings as that’s an exception in our naming
-- guidelines
repeat
goname, i = string.gsub(goname, "(%d)%.(%d)", "%1:%2")
until i == 0
-- replace various separators rpm does not like with -
goname = string.gsub(goname, "[%._/%-]+", "-")
-- because of the Azure sdk
goname = string.gsub(goname, "%-for%-go%-", "-")
-- Tokenize along - separators and remove duplicates to avoid
-- golang-foo-foo-bar-foo names
local result = ""
local tokens = {}
tokens["go"] = true
tokens["git"] = true
for token in string.gmatch(goname, "[^%-]+") do
if not tokens[token] then
result = result .. "-" .. token
tokens[token] = true
end
end
-- reassemble the string, restore x.y.z runs, convert the vx.y.z
-- Go convention to x.y.z as prefered in rpm naming
result = string.gsub(result, "^-", "")
result = string.gsub(result, ":", ".")
-- some projects have a name that end up in a number, and *also* add release
-- numbers on top of it, keep a - prefix before version strings
result = string.gsub(result, "%-v([%.%d])", "-%1")
print(result)
}
# Map Go information to rpm metadata. This macro will compute default spec
# variable values.
#
# The following spec variable MUST be set before calling the macro:
#
# goipath the packaged Go project import path
#
# The following spec variables SHOULD be set before calling the macro:
#
# forgeurl the project url on the forge, strongly recommended, if it can not
# be deduced from goipath; alternatively, use -u <url>
# Version if applicable, set it with Version: <version>
# tag if applicable
# commit if applicable
#
# The macro will attempt to compute and set the following variables if they are
# not already set by the packager:
#
# goname an rpm-compatible package name derived from goipath
# gosource an URL that can be used as SourceX: value
# gourl an URL that can be used as URL: value
#
# It will delegate processing to the forgemeta macro for:
#
# forgesource an URL that can be used as SourceX: value
# forgesetupargs the correct arguments to pass to %setup for this source
# used by %forgesetup and %forgeautosetup
# archivename the source archive filename, without extentions
# archiveext the source archive filename extensions, without leading dot
# archiveurl the url that can be used to download the source archive,
# without renaming
# scm the scm type, when packaging code snapshots: commits or tags
#
# If the macro is unable to parse your forgeurl value set at least archivename
# and archiveurl before calling it.
#
# Most of the computed variables are both overridable and optional. However,
# the macro WILL REDEFINE %{dist} when packaging a snapshot (commit or tag).
# The previous %{dist} value will be lost. Don’t call the macro if you don’t
# wish %{dist} to be changed.
#
# Optional parameters:
# -u <url> Ignore forgeurl even if it exists and use <url> instead. Note
# that the macro will still end up setting <url> as the forgeurl
# spec variable if it manages to parse it.
# -s Silently ignore problems in forgeurl, use it if it can be parsed,
# ignore it otherwise.
# -p Restore problem handling, override -s.
# -v Be verbose and print every spec variable the macro sets.
# -i Print some info about the state of spec variables the macro may use or
# set at the end of the processing.
%gometa(u:spvi) %{expand:%{lua:
local forgeurl = rpm.expand("%{?-u*}")
if (forgeurl == "") then
forgeurl = rpm.expand("%{?forgeurl}")
end
-- Be explicit about the spec variables we’re setting
local function explicitset(rpmvariable,value)
rpm.define(rpmvariable .. " " .. value)
if (rpm.expand("%{?-v}") ~= "") then
rpm.expand("%{echo:Setting %%{" .. rpmvariable .. "} = " .. value .. "\\n}")
end
end
-- Never ever stomp on a spec variable the packager already set
local function safeset(rpmvariable,value)
if (rpm.expand("%{?" .. rpmvariable .. "}") == "") then
explicitset(rpmvariable,value)
end
end
-- All the Go packaging automation relies on goipath being set
local goipath = rpm.expand("%{?goipath}")
if (goipath == "") then
rpm.expand("%{error:Please set the Go import path in the “goipath” variable before calling “gometa”!}")
end
-- Compute and set spec variables
if (forgeurl ~= "") then
rpm.expand("%forgemeta %{?-v} %{?-i} %{?-s} %{?-p} -u " .. forgeurl .. "\\n")
safeset("gourl", forgeurl)
else
safeset("gourl", "https://" .. goipath)
rpm.expand("%forgemeta %{?-v} %{?-i} -s %{?-p} -u %{gourl}\\n")
end
if (rpm.expand("%{?forgesource}") ~= "") then
safeset("gosource", "%{forgesource}")
else
safeset("gosource", "%{gourl}/%{archivename}.%{archiveext}")
end
safeset("goname", "%gorpmname %{goipath}")
-- Final spec variable summary if the macro was called with -i
if (rpm.expand("%{?-i}") ~= "") then
rpm.expand("%{echo:Go-specific packaging variables}")
rpm.expand("%{echo: goipath: %{?goipath}}")
rpm.expand("%{echo: goname: %{?goname}}")
rpm.expand("%{echo: gourl: %{?gourl}}")
rpm.expand("%{echo: gosource: %{?gosource}}")
end}
BuildRequires: compiler(go-compiler)
ExclusiveArch: %{go_arches}
}
# Define commands for building
# BUILD_ID can be generated for golang build no matter of debuginfo
%gobuild(o:) \
CGO_CPPFLAGS="-D_FORTIFY_SOURCE=2 -fstack-protector-all" go build -compiler gc -buildmode pie '-tags=rpm_crashtraceback libtrust_openssl ' -ldflags "-linkmode=external -compressdwarf=false ${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'" -a -v -x %{?**};\
# Define commands for testing
%gotest() go test -compiler gc -ldflags "${LDFLAGS:-}" %{?**};
macros.vpath 0000644 00000000344 15055650401 0007076 0 ustar 00 # ---- VPATH default settings
# directory where CMakeLists.txt/meson.build/etc. are placed
%_vpath_srcdir .
# directory (doesn't need to exist) where all generated build files will be placed
%_vpath_builddir %_target_platform
macros.systemtap 0000644 00000000316 15055650401 0010004 0 ustar 00 # -*- Mode: rpm-spec; indent-tabs-mode: nil -*- */
#
# RPM macros for packages installing systemtap tapset files
%_systemtap_tapsetdir /usr/share/systemtap/tapset
%_systemtap_datadir /usr/share/systemtap
macros.mono-srpm 0000644 00000000265 15055650401 0007705 0 ustar 00 # arches that mono builds on
%mono_arches %{ix86} x86_64 sparc sparcv9 ia64 %{arm} aarch64 alpha s390x ppc ppc64 ppc64le
%_monodir %{_prefix}/lib/mono
%_monogacdir %{_monodir}/gac
macros.fedora-misc 0000644 00000005415 15055650401 0010151 0 ustar 00 # Some miscellaneous Fedora-related macros
# List files matching inclusion globs, excluding files matching exclusion blogs
# Optional parameters:
# – -i "<globs>" inclusion globs
# – -x "<globs>" exclusion globs
# Globs are space-separated lists of shell globs. Such lists require %{quote:}
# use for safe rpm argument passing.
# Alternatively, set the following rpm variables before calling the macro:
# – “listfiles_include” inclusion globs
# — “listfiles_exclude” exclusion globs
# Arguments passed to the macro without flags will be interpreted as inclusion
# globs.
%listfiles(i:x:) %{expand:
%if %{lua: print(string.len(rpm.expand("%{?-i*}%{?listfiles_include}%*")))}
listfiles_include=$(realpath -e --relative-base=. %{?-i*} %{?listfiles_include} %* | sort -u)
%if %{lua: print(string.len(rpm.expand("%{?-x*}%{?listfiles_exclude}")))}
while IFS= read -r finc ; do
realpath -qe --relative-base=. %{?-x*} %{?listfiles_exclude} \\
| sort -u | grep -q "${finc}" || echo "${finc}"
done <<< "${listfiles_include}"
%else
echo "${listfiles_include}"
%endif
%endif
}
# https://github.com/rpm-software-management/rpm/issues/581
# Write the contents of a list of rpm variables to a macro file.
# The target file must contain the corresponding anchors.
# For example %writevars -f myfile foo bar will replace:
# @@FOO@@ with the rpm evaluation of %{foo} and
# @@BAR@@ with the rpm evaluation of %{bar}
# in myfile
%writevars(f:) %{lua:
local fedora = require "fedora.common"
local macrofile = rpm.expand("%{-f*}")
local rpmvars = {}
for i = 1, rpm.expand("%#") do
table.insert(rpmvars, rpm.expand("%" .. i))
end
fedora.writevars(macrofile,rpmvars)
}
# gpgverify verifies signed sources. There is documentation in the script.
%gpgverify(k:s:d:) %{lua:
local script = rpm.expand("%{_rpmconfigdir}/redhat/gpgverify ")
local keyring = rpm.expand("%{-k*}")
local signature = rpm.expand("%{-s*}")
local data = rpm.expand("%{-d*}")
print(script)
if keyring ~= "" then
print(rpm.expand("--keyring='%{SOURCE" .. keyring .. "}' "))
end
if signature ~= "" then
print(rpm.expand("--signature='%{SOURCE" .. signature .. "}' "))
end
if data ~= "" then
print(rpm.expand("--data='%{SOURCE" .. data .. "}' "))
end
}
# gpgverify verifies signed sources. There is documentation in the script.
%gpgverify(k:s:d:) %{lua:
local script = rpm.expand("%{_rpmconfigdir}/redhat/gpgverify ")
local keyring = rpm.expand("%{-k*}")
local signature = rpm.expand("%{-s*}")
local data = rpm.expand("%{-d*}")
print(script)
if keyring ~= "" then
print(rpm.expand("--keyring='%{SOURCE" .. keyring .. "}' "))
end
if signature ~= "" then
print(rpm.expand("--signature='%{SOURCE" .. signature .. "}' "))
end
if data ~= "" then
print(rpm.expand("--data='%{SOURCE" .. data .. "}' "))
end
}
macros.alt-python311 0000644 00000004042 15055650401 0010277 0 ustar 00 %__alt_python311 /opt/alt/python311/bin/python3
%alt_python311_sitelib %(%{__alt_python311} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
%alt_python311_sitearch %(%{__alt_python311} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))")
%alt_python311_version %(%{__alt_python311} -Ic "import sys; sys.stdout.write(sys.version[:3])")
%alt_python311_version_nodots %(%{__alt_python311} -Ic "import sys; sys.stdout.write(sys.version[:3].replace('.',''))")
%alt_py311dir %{_builddir}/python3-%{name}-%{version}-%{release}
%alt_python311_dir /opt/alt/python311
%py_setup setup.py
%alt_py311_shbang_opts -s
%alt_py311_shbang_opts_nodash %(opts=%{alt_py311_shbang_opts}; echo ${opts#-})
# Use the slashes after expand so that the command starts on the same line as
# the macro
%alt_py311_build() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python311} %{py_setup} %{?py_setup_args} build --executable="%{__alt_python311} %{alt_py311_shbang_opts}" %{?*}
}
%alt_py311_build_egg() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python311} %{py_setup} %{?py_setup_args} bdist_egg %{?*}
}
%alt_py311_build_wheel() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python311} %{py_setup} %{?py_setup_args} bdist_wheel %{?*}
}
%alt_py311_install() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python311} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
}
%alt_py311_install_egg() %{expand:\\\
mkdir -p %{buildroot}%{alt_python311_sitelib}
%{alt_python311_dir}/bin/easy_install-3.11 -m --prefix %{buildroot}%{_prefix} -Z dist/*-py3.11.egg %{?*}
%{alt_python311_dir}/bin/easy_install-3.11 %{alt_python311_locate}/bin/easy_install-3.11
}
%alt_py311_install_wheel() %{expand:\\\
%{alt_python311_dir}/bin/pip3.11 install -I dist/%{1} --root %{buildroot} --no-deps
}
macros.environment-modules 0000644 00000000113 15055650401 0011760 0 ustar 00 # RPM macros for environment modules
%_modulesdir %{_datadir}/modulefiles
macros.python 0000644 00000006557 15055650401 0007311 0 ustar 00 # %%__python is defined in /usr/lib/rpm/macros to raise an error
# so if you don't redefine it, you'll get the same error from %%python
%python %__python
%python_platform_triplet %(%{__python} -Esc "import sysconfig; print(sysconfig.get_config_var('MULTIARCH'))")
%python_ext_suffix %(%{__python} -Esc "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))")
%py_setup setup.py
%py_shbang_opts -s
%py_shbang_opts_nodash %(opts=%{py_shbang_opts}; echo ${opts#-})
%py_shebang_flags %(opts=%{py_shbang_opts}; echo ${opts#-})
%py_shebang_fix %{expand:\\\
if [ -f /usr/bin/pathfix%{python_version}.py ]; then
pathfix=/usr/bin/pathfix%{python_version}.py
else
# unversioned pathfix.py provided by platform-python-devel
pathfix=/usr/bin/pathfix.py
fi
if [ -z "%{?py_shebang_flags}" ]; then
shebang_flags="-k"
else
shebang_flags="-ka%{py_shebang_flags}"
fi
$pathfix -pni %{__python} $shebang_flags}
# Use the slashes after expand so that the command starts on the same line as
# the macro
%py_build() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__python} %{py_setup} %{?py_setup_args} build --executable="%{__python} %{py_shbang_opts}" %{?*}
sleep 1
}
%py_build_egg() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__python} %{py_setup} %{?py_setup_args} bdist_egg %{?*}
sleep 1
}
%py_build_wheel() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__python} %{py_setup} %{?py_setup_args} bdist_wheel %{?*}
sleep 1
}
%py_install() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__python} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
}
%py_install_egg() %{expand:\\\
mkdir -p %{buildroot}%{python_sitelib}
easy_install -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python_version}.egg %{?*}
}
%py_install_wheel() %{expand:\\\
pip install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} --no-deps
}
%python_provide() %{lua:
function string.starts(String,Start)
return string.sub(String,1,string.len(Start))==Start
end
package = rpm.expand("%{?1}")
vr = rpm.expand("%{?epoch:%{epoch}:}%{version}-%{release}")
if (string.starts(package, "python2-")) then
--No unversioned provides as python2 is not default
elseif (string.starts(package, "python" .. rpm.expand("%{python3_pkgversion}") .. "-")) then
--No unversioned provides as python3 is not default
elseif (rpm.expand("%{?python3_other_pkgversion}") ~= "" and string.starts(package, "python" .. rpm.expand("%{python3_other_pkgversion}") .. "-")) then
--No unversioned provides as python3_other is not default
elseif (string.starts(package, "pypy-")) then
--No unversioned provides as pypy is not default
elseif (string.starts(package, "pypy3-")) then
--No unversioned provides as pypy is not default
elseif (string.starts(package, "python-")) then
--Providing the current default python
print("Provides: python2-")
print(string.sub(package,8,string.len(package)))
print(" = ")
print(vr)
else
print("%python_provide: ERROR: ")
print(package)
print(" not recognized.")
end
}
%python_enable_dependency_generator() \
%global __python_requires %{_rpmconfigdir}/pythondistdeps.py --requires \
%{nil}
macros.vim 0000644 00000000050 15055650401 0006541 0 ustar 00 %vimfiles_root %{_datadir}/vim/vimfiles
macros.kernel-srpm 0000644 00000000164 15055650401 0010213 0 ustar 00 # kernel_arches lists what arches the full kernel is built for.
%kernel_arches x86_64 s390x ppc64le aarch64 %{arm}
macros.python3 0000644 00000007202 15055650401 0007360 0 ustar 00 %__python3 /usr/libexec/platform-python
%python3 %__python3
%python3_sitelib %(%{__python3} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
%python3_sitearch %(%{__python3} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
%python3_version %(%{__python3} -Ic "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))")
%python3_version_nodots %(%{__python3} -Ic "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info).replace('.',''))")
%python3_platform %(%{__python3} -Ic "import sysconfig; print(sysconfig.get_platform())")
%python3_platform_triplet %(%{__python3} -Ic "import sysconfig; print(sysconfig.get_config_var('MULTIARCH'))")
%python3_ext_suffix %(%{__python3} -Ic "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))")
%py3dir %{_builddir}/python3-%{name}-%{version}-%{release}
%py3_shbang_opts -s
%py3_shbang_opts_nodash %(opts=%{py3_shbang_opts}; echo ${opts#-})
%py3_shebang_flags %(opts=%{py3_shbang_opts}; echo ${opts#-})
%py3_shebang_fix %{expand:\\\
if [ -f /usr/bin/pathfix%{python3_version}.py ]; then
pathfix=/usr/bin/pathfix%{python3_version}.py
else
# unversioned pathfix.py provided by platform-python-devel
pathfix=/usr/bin/pathfix.py
fi
if [ -z "%{?py3_shebang_flags}" ]; then
shebang_flags="-k"
else
shebang_flags="-ka%{py3_shebang_flags}"
fi
$pathfix -pni %{__python3} $shebang_flags}
# Use the slashes after expand so that the command starts on the same line as
# the macro
%py3_build() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__python3} %{py_setup} %{?py_setup_args} build --executable="%{__python3} %{py3_shbang_opts}" %{?*}
sleep 1
}
%py3_build_egg() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__python3} %{py_setup} %{?py_setup_args} bdist_egg %{?*}
sleep 1
}
%py3_build_wheel() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__python3} %{py_setup} %{?py_setup_args} bdist_wheel %{?*}
sleep 1
}
%py3_install() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__python3} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
}
%py3_install_egg() %{expand:\\\
mkdir -p %{buildroot}%{python3_sitelib}
CFLAGS="%{optflags}" %{__python3} -m easy_install -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python3_version}.egg %{?*}
}
%py3_install_wheel() %{expand:\\\
CFLAGS="%{optflags}" %{__python3} -m pip install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} --no-deps
}
# This only supports Python 3.5+ and will never work with Python 2.
# Hence, it has no Python version in the name.
%pycached() %{lua:
path = rpm.expand("%{?*}")
if (string.sub(path, "-3") ~= ".py") then
rpm.expand("%{error:%%pycached can only be used with paths explicitly ending with .py}")
else
print(path)
pyminor = path:match("/python3.(%d+)/") or "*"
dirname = path:match("(.*/)")
modulename = path:match(".*/([^/]+).py")
print("\\n" .. dirname .. "__pycache__/" .. modulename .. ".cpython-3" .. pyminor .. "{,.opt-?}.pyc")
end
}
# This is intended for Python 3 only, hence also no Python version in the name.
%__pytest /usr/bin/pytest-%{_python3_pkgversion_with_dot}
%pytest %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
PATH="%{buildroot}%{_bindir}:$PATH"\\\
PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}"\\\
PYTHONDONTWRITEBYTECODE=1\\\
%__pytest}
macros.systemd 0000644 00000010036 15055650401 0007443 0 ustar 00 # -*- Mode: rpm-spec; indent-tabs-mode: nil -*- */
# SPDX-License-Identifier: LGPL-2.1+
#
# This file is part of systemd.
#
# Copyright 2012 Lennart Poettering
# RPM macros for packages installing systemd unit files
%_unitdir /usr/lib/systemd/system
%_userunitdir /usr/lib/systemd/user
%_presetdir /usr/lib/systemd/system-preset
%_userpresetdir /usr/lib/systemd/user-preset
%_udevhwdbdir /usr/lib/udev/hwdb.d
%_udevrulesdir /usr/lib/udev/rules.d
%_journalcatalogdir /usr/lib/systemd/catalog
%_binfmtdir /usr/lib/binfmt.d
%_sysctldir /usr/lib/sysctl.d
%_sysusersdir /usr/lib/sysusers.d
%_tmpfilesdir /usr/lib/tmpfiles.d
%_environmentdir /usr/lib/environment.d
%_modulesloaddir /usr/lib/modules-load.d
%_modprobedir /usr/lib/modprobe.d
%_systemdgeneratordir /usr/lib/systemd/system-generators
%_systemdusergeneratordir /usr/lib/systemd/user-generators
%_systemd_system_env_generator_dir /usr/lib/systemd/system-environment-generators
%_systemd_user_env_generator_dir /usr/lib/systemd/user-environment-generators
# Because we had one release with a typo...
# This is temporary (Remove after systemd 240 is released)
%_environmnentdir %{warn:Use %%_environmentdir instead}%_environmentdir
%systemd_requires \
Requires(post): systemd \
Requires(preun): systemd \
Requires(postun): systemd \
%{nil}
%systemd_ordering \
OrderWithRequires(post): systemd \
OrderWithRequires(preun): systemd \
OrderWithRequires(postun): systemd \
%{nil}
%systemd_post() \
if [ $1 -eq 1 ] ; then \
# Initial installation \
systemctl --no-reload preset %{?*} &>/dev/null || : \
fi \
%{nil}
%systemd_user_post() %{expand:%systemd_post \\--global %%{?*}}
%systemd_preun() \
if [ $1 -eq 0 ] ; then \
# Package removal, not upgrade \
systemctl --no-reload disable --now %{?*} &>/dev/null || : \
fi \
%{nil}
%systemd_user_preun() \
if [ $1 -eq 0 ] ; then \
# Package removal, not upgrade \
systemctl --global disable %{?*} &>/dev/null || : \
fi \
%{nil}
%systemd_postun() %{nil}
%systemd_user_postun() %{nil}
%systemd_postun_with_restart() \
if [ $1 -ge 1 ] ; then \
# Package upgrade, not uninstall \
systemctl try-restart %{?*} &>/dev/null || : \
fi \
%{nil}
%systemd_user_postun_with_restart() %{nil}
%udev_hwdb_update() %{nil}
%udev_rules_update() %{nil}
%journal_catalog_update() %{nil}
# Deprecated. Use %tmpfiles_create_package instead
%tmpfiles_create() \
systemd-tmpfiles --create %{?*} &>/dev/null || : \
%{nil}
# Deprecated. Use %sysusers_create_package instead
%sysusers_create() \
systemd-sysusers %{?*} &>/dev/null || : \
%{nil}
%sysusers_create_inline() \
systemd-sysusers - <<SYSTEMD_INLINE_EOF &>/dev/null || : \
%{?*} \
SYSTEMD_INLINE_EOF \
%{nil}
# This should be used by package installation scripts which require users or
# groups to be present before the files installed by the package are present on
# disk (for example because some files are owned by those users or groups).
#
# Example:
# Source1: %{name}-sysusers.conf
# ...
# %install
# install -D %SOURCE1 %{buildroot}%{_sysusersdir}/%{name}.conf
# %pre
# %sysusers_create_package %{name} %SOURCE1
# %files
# %{_sysusersdir}/%{name}.conf
%sysusers_create_package() \
systemd-sysusers --replace=%_sysusersdir/%1.conf - <<SYSTEMD_INLINE_EOF &>/dev/null || : \
%(cat %2) \
SYSTEMD_INLINE_EOF \
%{nil}
# This may be used by package installation scripts to create files according to
# their tmpfiles configuration from a package installation script, even before
# the files of that package are installed on disk.
#
# Example:
# Source1: %{name}-tmpfiles.conf
# ...
# %install
# install -D %SOURCE1 %{buildroot}%{_tmpfilesdir}/%{name}.conf
# %pre
# %tmpfiles_create_package %{name} %SOURCE1
# %files
# %{_tmpfilesdir}/%{name}.conf
%tmpfiles_create_package() \
systemd-tmpfiles --replace=%_tmpfilesdir/%1.conf --create - <<SYSTEMD_INLINE_EOF &>/dev/null || : \
%(cat %2) \
SYSTEMD_INLINE_EOF \
%{nil}
%sysctl_apply() \
/usr/lib/systemd/systemd-sysctl %{?*} &>/dev/null || : \
%{nil}
%binfmt_apply() \
/usr/lib/systemd/systemd-binfmt %{?*} &>/dev/null || : \
%{nil}
macros.perl 0000644 00000012100 15055650401 0006707 0 ustar 00 # Sensible Perl-specific RPM build macros.
#
# Note that these depend on the generic filtering system being in place in
# rpm core; but won't cause a build to fail if they're not present.
#
# Chris Weyl <cweyl@alumni.drew.edu> 2009
# Marcela Mašláňová <mmaslano@redhat.com> 2011
# This macro unsets several common vars used to control how Makefile.PL (et
# al) build and install packages. We also set a couple to help some of the
# common systems be less interactive. This was blatantly stolen from
# cpanminus, and helps building rpms locally when one makes extensive use of
# local::lib, etc.
#
# Usage, in %build, before "%{__perl} Makefile.PL ..."
#
# %{?perl_ext_env_unset}
%perl_ext_env_unset %{expand:
unset PERL_MM_OPT MODULEBUILDRC PERL5INC
export PERL_AUTOINSTALL="--defaultdeps"
export PERL_MM_USE_DEFAULT=1
}
#############################################################################
# Filtering macro incantations
# keep track of what "revision" of the filtering we're at. Each time we
# change the filter we should increment this.
%perl_default_filter_revision 3
# By default, for perl packages we want to filter all files in _docdir from
# req/prov scanning.
# Filtering out any provides caused by private libs in vendorarch/archlib
# (vendor/core) is done by rpmbuild since Fedora 20
# <https://fedorahosted.org/fpc/ticket/353>.
#
# Note that this must be invoked in the spec file, preferably as
# "%{?perl_default_filter}", before any %description block.
%perl_default_filter %{expand: \
%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}^%{_docdir}
%global __requires_exclude_from %{?__requires_exclude_from:%__requires_exclude_from|}^%{_docdir}
%global __provides_exclude %{?__provides_exclude:%__provides_exclude|}^perl\\\\(VMS|^perl\\\\(Win32|^perl\\\\(DB\\\\)|^perl\\\\(UNIVERSAL\\\\)
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\\\(VMS|^perl\\\\(Win32
}
#############################################################################
# Macros to assist with generating a "-tests" subpackage in a semi-automatic
# manner.
#
# The following macros are still in a highly experimental stage and users
# should be aware that the interface and behaviour may change.
#
# PLEASE, PLEASE CONDITIONALIZE THESE MACROS IF YOU USE THEM.
#
# See http://gist.github.com/284409
# These macros should be invoked as above, right before the first %description
# section, and conditionalized. e.g., for the common case where all our tests
# are located under t/, the correct usage is:
#
# %{?perl_default_subpackage_tests}
#
# If custom files/directories need to be specified, this can be done as such:
#
# %{?perl_subpackage_tests:%perl_subpackage_tests t/ one/ three.sql}
#
# etc, etc.
%perl_version %(eval "`%{__perl} -V:version`"; echo $version)
%perl_testdir %{_libexecdir}/perl5-tests
%cpan_dist_name %(eval echo %{name} | %{__sed} -e 's/^perl-//')
# easily mark something as required by -tests and BR to the main package
%tests_req() %{expand:\
BuildRequires: %*\
%%tests_subpackage_requires %*\
}
# fixup (and create if needed) the shbang lines in tests, so they work and
# rpmlint doesn't (correctly) have a fit
%fix_shbang_line() \
TMPHEAD=`mktemp`\
TMPBODY=`mktemp`\
for file in %* ; do \
head -1 $file > $TMPHEAD\
tail -n +2 $file > $TMPBODY\
%{__perl} -pi -e '$f = /^#!/ ? "" : "#!%{__perl}$/"; $_="$f$_"' $TMPHEAD\
cat $TMPHEAD $TMPBODY > $file\
done\
%{__perl} -MExtUtils::MakeMaker -e "ExtUtils::MM_Unix->fixin(qw{%*})"\
%{__rm} $TMPHEAD $TMPBODY\
%{nil}
# additional -tests subpackage requires, if any
%tests_subpackage_requires() %{expand: \
%global __tests_spkg_req %{?__tests_spkg_req} %* \
}
# additional -tests subpackage provides, if any
%tests_subpackage_provides() %{expand: \
%global __tests_spkg_prov %{?__tests_spkg_prov} %* \
}
#
# Runs after the body of %check completes.
#
%__perl_check_pre %{expand: \
%{?__spec_check_pre} \
pushd %{buildsubdir} \
%define perl_br_testdir %{buildroot}%{perl_testdir}/%{cpan_dist_name} \
%{__mkdir_p} %{perl_br_testdir} \
%{__tar} -cf - %{__perl_test_dirs} | ( cd %{perl_br_testdir} && %{__tar} -xf - ) \
find . -maxdepth 1 -type f -name '*META*' -exec %{__cp} -vp {} %{perl_br_testdir} ';' \
find %{perl_br_testdir} -type f -exec %{__chmod} -c -x {} ';' \
T_FILES=`find %{perl_br_testdir} -type f -name '*.t'` \
%fix_shbang_line $T_FILES \
%{__chmod} +x $T_FILES \
%{_fixperms} %{perl_br_testdir} \
popd \
}
#
# The actual invoked macro
#
%perl_subpackage_tests() %{expand: \
%global __perl_package 1\
%global __perl_test_dirs %* \
%global __spec_check_pre %{expand:%{__perl_check_pre}} \
%package tests\
Summary: Test suite for package %{name}\
Group: Development/Debug\
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}\
Requires: /usr/bin/prove \
%{?__tests_spkg_req:Requires: %__tests_spkg_req}\
%{?__tests_spkg_prov:Provides: %__tests_spkg_prov}\
AutoReqProv: 0 \
%description tests\
This package provides the test suite for package %{name}.\
%files tests\
%defattr(-,root,root,-)\
%{perl_testdir}\
}
# shortcut sugar
%perl_default_subpackage_tests %perl_subpackage_tests t/
macros.valgrind-srpm 0000644 00000000177 15055650401 0010545 0 ustar 00 # valgrind_arches lists what arches Valgrind works on
%valgrind_arches %{ix86} x86_64 ppc ppc64 ppc64le armv7hl aarch64 s390x
macros.scl 0000644 00000033041 15055650401 0006535 0 ustar 00 # scl-utils RPM macros
#
# Copyright (C) 2012 Red Hat, Inc.
# Written by Jindrich Novy <jnovy@redhat.com>.
%scl_debug() %{expand:
%define old_debug %{lua:print(rpm.expand("%{debug_package}"):len())}
%undefine _debugsource_packages
%global debug_package %{expand:
%if "%{?old_debug}" == "0"
%{expand: %{nil}}
%else
%if "%{?scl}%{!?scl:0}" == "%{pkg_name}"
%{expand: %{nil}}
%else
%ifnarch noarch
%package debuginfo
Summary: Debug information for package %{name}
Group: Development/Debug
AutoReqProv: 0
Requires: %scl_runtime
Provides: scl-package(%scl)
%{lua:
debuginfo=tonumber(rpm.expand("%{old_debug}"))
if debuginfo > 0 then
rpm.define("__debug_package 1")
end
}
%description debuginfo
This package provides debug information for package %{name}.
Debug information is useful when developing applications that use this
package or when debugging this package.
%files debuginfo -f debugfiles.list
%defattr(-,root,root)
%endif
%endif
%endif
%{nil}}}
%scl_prefix() %{?scl:%(if [ "%1" = "%%1" ]; then echo "%{scl}-"; else echo "%1-"; fi)}%{!?scl:%{nil}}
%scl_package() %{expand:%{!?_root_prefix:
%global pkg_name %1
%global scl_name %{scl}
%global scl_runtime %{scl}-runtime
%global scl_basedir /opt
%{!?scl_vendor: %global scl_vendor rh}
%{!?_scl_prefix: %global _scl_prefix %{scl_basedir}/%{scl_vendor}}
%global _scl_scripts %{_scl_prefix}/%{scl}
%global _scl_root %{_scl_prefix}/%{scl}/root
%global _root_prefix %{_prefix}
%global _root_exec_prefix %{_root_prefix}
%global _root_bindir %{_exec_prefix}/bin
%global _root_sbindir %{_exec_prefix}/sbin
%global _root_libexecdir %{_exec_prefix}/libexec
%global _root_datadir %{_prefix}/share
%global _root_sysconfdir %{_sysconfdir}
%global _root_sharedstatedir %{_sharedstatedir}
%global _root_localstatedir %{_localstatedir}
%global _root_libdir %{_exec_prefix}/%{_lib}
%global _root_includedir %{_prefix}/include
%global _root_infodir %{_datadir}/info
%global _root_mandir %{_datadir}/man
%global _root_initddir %{_sysconfdir}/rc.d/init.d
%global _prefix %{_scl_root}/usr
%global _exec_prefix %{_prefix}
%global _bindir %{_exec_prefix}/bin
%global _sbindir %{_exec_prefix}/sbin
%global _libexecdir %{_exec_prefix}/libexec
%global _datadir %{_prefix}/share
%global _sysconfdir %{_scl_root}/etc
%{?nfsmountable: %global _sysconfdir %{_root_sysconfdir}%{_scl_prefix}/scls/%{scl}}
%{?rh_layout: %global _sysconfdir %{_root_sysconfdir}%{_scl_prefix}/%{scl}}
%global _sharedstatedir %{_scl_root}/var/lib
%{?nfsmountable: %global _sharedstatedir %{_root_localstatedir}%{_scl_prefix}/scls/%{scl}/lib}
%{?rh_layout: %global _sharedstatedir %{_root_localstatedir}%{_scl_prefix}/%{scl}/lib}
%global _localstatedir %{_scl_root}/var
%{?nfsmountable: %global _localstatedir %{_root_localstatedir}%{_scl_prefix}/scls/%{scl}}
%{?rh_layout: %global _localstatedir %{_root_localstatedir}%{_scl_prefix}/%{scl}}
%global _libdir %{_exec_prefix}/%{_lib}
%global _includedir %{_prefix}/include
%global _infodir %{_datadir}/info
%global _mandir %{_datadir}/man
%global _docdir %{_datadir}/doc
%global _defaultdocdir %{_docdir}
}
%{?scl_dependency_generators:%scl_dependency_generators}
%global scl_pkg_name %{scl}-%{pkg_name}
%scl_debug
%global __os_install_post %{expand:
/usr/lib/rpm/brp-scl-compress %{_scl_root}
%{!?__debug_package:/usr/lib/rpm/brp-strip %{__strip}
/usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump}
}
/usr/lib/rpm/brp-strip-static-archive %{__strip}
/usr/lib/rpm/brp-scl-python-bytecompile %{__python3} %{?_python_bytecompile_errors_terminate_build} %{_scl_root}
/usr/lib/rpm/brp-python-hardlink
%{nil}}
BuildRequires: scl-utils-build
%if "%{?scl}%{!?scl:0}" == "%{pkg_name}"
Requires: %{scl_runtime}
Provides: scl-package(%{scl})
%endif
%{?scl_package_override:%scl_package_override}
}
%scl_require() %{_scl_prefix}/%1/enable, %1
%scl_require_package() %1-%2
%scl_enable_script() %{expand:
cat >> %{buildroot}%{_scl_scripts}/enable << 'EOF'
eval `/usr/bin/modulecmd bash load %{scl}`
EOF
}
%scl_files %{expand:
%defattr(-,root,root,-)
%dir %_scl_prefix
%dir %attr(555,root,root) %{_scl_root}
%dir %attr(555,root,root) %{_scl_scripts}
%{_scl_scripts}/enable
%{_root_sysconfdir}/scl/prefixes/%scl
%{_scl_root}/bin
%attr(555,root,root) %{_scl_root}/boot
%{_scl_root}/dev
%dir %{_sysconfdir}
%{_sysconfdir}/X11
%{_sysconfdir}/xdg
%{_sysconfdir}/opt
%{_sysconfdir}/pm
%{_sysconfdir}/xinetd.d
%{_sysconfdir}/skel
%{_sysconfdir}/sysconfig
%{_sysconfdir}/pki
%{_scl_root}/home
%{_scl_root}/lib
%ifarch x86_64 ppc ppc64 ppc64le aarch64 sparc sparc64 s390 s390x
%{_scl_root}/%{_lib}
%endif
%{_scl_root}/media
%dir %{_scl_root}/mnt
%dir %{_scl_root}/opt
%attr(555,root,root) %{_scl_root}/proc
%attr(550,root,root) %{_scl_root}/root
%{_scl_root}/run
%{_scl_root}/sbin
%{_scl_root}/srv
%{_scl_root}/sys
%attr(1777,root,root) %{_scl_root}/tmp
%dir %{_scl_root}/usr
%attr(555,root,root) %{_scl_root}/usr/bin
%{_scl_root}/usr/etc
%{_scl_root}/usr/games
%{_scl_root}/usr/include
%dir %attr(555,root,root) %{_scl_root}/usr/lib
%ifarch x86_64 ppc ppc64 ppc64le aarch64 sparc sparc64 s390 s390x
%attr(555,root,root) %{_scl_root}/usr/%{_lib}
%endif
%{_scl_root}/usr/libexec
%{_scl_root}/usr/local
%attr(555,root,root) %{_scl_root}/usr/sbin
%dir %{_scl_root}/usr/share
%{_scl_root}/usr/share/aclocal
%{_scl_root}/usr/share/applications
%{_scl_root}/usr/share/augeas
%{_scl_root}/usr/share/backgrounds
%{_scl_root}/usr/share/desktop-directories
%{_scl_root}/usr/share/dict
%{_scl_root}/usr/share/doc
%attr(555,root,root) %dir %{_scl_root}/usr/share/empty
%{_scl_root}/usr/share/games
%{_scl_root}/usr/share/ghostscript
%{_scl_root}/usr/share/gnome
%{_scl_root}/usr/share/icons
%{_scl_root}/usr/share/idl
%{_scl_root}/usr/share/info
%dir %{_scl_root}/usr/share/licenses
%dir %{_scl_root}/usr/share/locale
%dir %{_scl_root}/usr/share/man
%{_scl_root}/usr/share/mime-info
%{_scl_root}/usr/share/misc
%{_scl_root}/usr/share/omf
%{_scl_root}/usr/share/pixmaps
%{_scl_root}/usr/share/sounds
%{_scl_root}/usr/share/themes
%{_scl_root}/usr/share/xsessions
%{_scl_root}/usr/share/X11
%{_scl_root}/usr/src
%{_scl_root}/usr/tmp
%dir %{_localstatedir}
%{_localstatedir}/adm
%{_localstatedir}/cache
%{_localstatedir}/db
%{_localstatedir}/empty
%{_localstatedir}/games
%{_localstatedir}/gopher
%{_localstatedir}/lib
%{_localstatedir}/local
%ghost %dir %attr(755,root,root) %{_localstatedir}/lock
%ghost %{_localstatedir}/lock/subsys
%{_localstatedir}/log
%{_localstatedir}/mail
%{_localstatedir}/nis
%{_localstatedir}/opt
%{_localstatedir}/preserve
%ghost %attr(755,root,root) %{_localstatedir}/run
%dir %{_localstatedir}/spool
%attr(755,root,root) %{_localstatedir}/spool/lpd
%attr(775,root,mail) %{_localstatedir}/spool/mail
%attr(1777,root,root) %{_localstatedir}/tmp
%{_localstatedir}/yp
}
%scl_install %{expand:
# scl specific stuff
mkdir -p %{buildroot}%{_root_sysconfdir}/{rpm,scl/{prefixes,modulefiles}}
cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config << EOF
%%%%scl %scl
%{?nfsmountable:%%%%nfsmountable %{nfsmountable}}
%{!?nfsmountable:%%%%undefine nfsmountable}
%{?rh_layout:%%%%rh_layout %{rh_layout}}
%{!?rh_layout:%%%%undefine rh_layout}
EOF
cat >> %{buildroot}%{_root_sysconfdir}/scl/prefixes/%{scl} << EOF
%_scl_prefix
EOF
test -e %{buildroot}%{_scl_scripts}/%{scl} && ln -s %{_scl_scripts}/%{scl} %{buildroot}%{_root_sysconfdir}/scl/modulefiles/%{scl}
# filelist
set +x
cat >> %{buildroot}/lang-exceptions << EOF
af_ZA
am_ET
ast_ES
az_IR
bg_BG
bn_IN
ca@valencia
ca_ES
ca_ES@valencian
cs_CZ
de_AT
de_CH
de_DE
default
el_GR
en_AU
en_CA
en_GB
en_US
en_NZ
es_AR
es_CL
es_CO
es_CR
es_DO
es_EC
es_ES
es_GT
es_HN
es_MX
es_NI
es_PA
es_PE
es_PR
es_SV
es_UY
es_VE
et_EE
eu_ES
fa_IR
fi_FI
fr_BE
fr_CA
fr_CH
fr_FR
gl_ES
he_IL
hr_HR
hu_HU
it_CH
it_IT
ja_JP
ko_KR
ks@devanagari
lv_LV
ms_MY
my_MM
nb_NO
nds_DE
nl_BE
nl_NL
pl_PL
pt_BR
pt_PT
ru_RU
sl_SI
sq_AL
sr_RS
sv_SE
uk_UA
ur_PK
zh_CN
zh_CN.GB2312
zh_HK
zh_TW
zh_TW.Big5
en@boldquot
en@quot
nds@NFE
sr@ije
sr@ijekavian
sr@ijekavianlatin
sr@latin
sr@Latn
uz@cyrillic
uz@Latn
be@latin
en@shaw
brx
brx_IN
EOF
cat >> %{buildroot}/iso_639.sed << EOF
1,/<iso_639_entries/b
# on each new iso-code process the current one
\\!\\(<iso_639_entry\\|</iso_639_entries>\\)!{
x
s/^$//
# we are on the first iso-code--nothing to process here
t
# process and write to output
s/\\s\\+/ /g
s/<iso_639_entry//
s!/\\s*>!!
# use '%' as a separator of parsed and unparsed input
s/\\(.*\\)iso_639_2T_code="\\([^"]\\+\\)"\\(.*\\)/\\2 % \\1 \\3/
s/\\([^%]\\+\\)%\\(.*\\)iso_639_2B_code="\\([^"]\\+\\)"\\(.*\\)/\\1\\t\\3 % \\2 \\4/
# clear subst. memory for the next t
t clear
:clear
s/\\([^%]\\+\\)%\\(.*\\)iso_639_1_code="\\([^"]\\+\\)"\\(.*\\)/\\1\\t\\3 % \\2 \\4/
t name
# no 639-1 code--write xx
s/%/\\tXX %/
:name
s/\\([^%]\\+\\)%\\(.*\\)name="\\([^"]\\+\\)"\\(.*\\)/\\1\\t\\3/
s/ \\t/\\t/g
p
b
:noout
}
H
EOF
cat >> %{buildroot}/iso_3166.sed << EOF
1,/<iso_3166_entries/b
# on each new iso-code process the current one
\\!\\(<iso_3166_entry\\|</iso_3166_entries>\\)!{
x
s/^$//
# we are on the first iso-code--nothing to process here
t
# process and write to output
s/\\s\\+/ /g
s/<iso_3166_entry//
s!/\\s*>!!
# use '%' as a separator of parsed and unparsed input
s/\\(.*\\)alpha_2_code="\\([^"]\\+\\)"\\(.*\\)/\\2 % \\1 \\3/
s/\\([^%]\\+\\)%\\(.*\\)alpha_3_code="\\([^"]\\+\\)"\\(.*\\)/\\1% \\2 \\4/
# clear subst. memory for the next t
t clear
:clear
s/\\([^%]\\+\\)%\\(.*\\)numeric_code="\\([^"]\\+\\)"\\(.*\\)/\\1% \\2 \\4/
t name
# no 3166 code--write xx
s/%/\\tXX %/
:name
s/\\([^%]\\+\\)%\\(.*\\)name="\\([^"]\\+\\)"\\(.*\\)/\\1\\t\\3/
s/ \\t/\\t/g
p
b
:noout
}
H
EOF
mkdir -p %{buildroot}%{_localstatedir}
pushd %{buildroot}%{_localstatedir}
mkdir -p {adm,empty,gopher,lib/{games,misc,rpm-state},local,lock/subsys,log,nis,preserve,run,spool/{mail,lpd,uucp},tmp,db,cache,opt,games,yp}
popd
mkdir -p %{buildroot}%{_sysconfdir}
pushd %{buildroot}%{_sysconfdir}
mkdir -p {X11/{applnk,fontpath.d},xdg/autostart,opt,pm/{config.d,power.d,sleep.d},xinetd.d,skel,sysconfig,pki}
popd
mkdir -p %{buildroot}%{_scl_root}
rm -f $RPM_BUILD_DIR/%{buildsubdir}/filelist
rm -f $RPM_BUILD_DIR/%{buildsubdir}/filesystem
pushd %{buildroot}%{_scl_root}
mkdir -p boot dev \\
home media mnt opt proc root run/lock srv sys tmp \\
usr/{bin,etc,games,include,lib/{games,locale,modules,sse2},libexec,local/{bin,etc,games,lib,sbin,src,share/{applications,man/man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x},info},libexec,include,},sbin,share/{aclocal,applications,augeas/lenses,backgrounds,desktop-directories,dict,doc,empty,games,ghostscript/conf.d,gnome,icons,idl,info,licenses,man/man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x,0p,1p,3p},mime-info,misc,omf,pixmaps,sounds,themes,xsessions,X11},src,src/kernels,src/debug}
%ifarch x86_64 ppc ppc64 ppc64le aarch64 sparc sparc64 s390 s390x
mkdir -p usr/{%{_lib}/{games,sse2,tls,X11,pm-utils/{module.d,power.d,sleep.d}},local/%{_lib}}
%endif
ln -snf %{_localstatedir}/tmp usr/tmp
ln -snf spool/mail %{buildroot}%{_localstatedir}/mail
ln -snf usr/bin bin
ln -snf usr/sbin sbin
ln -snf usr/lib lib
%ifarch x86_64 ppc ppc64 ppc64le aarch64 sparc sparc64 s390 s390x
ln -snf usr/%{_lib} %{_lib}
%endif
sed -n -f %{buildroot}/iso_639.sed /usr/share/xml/iso-codes/iso_639.xml >%{buildroot}/iso_639.tab
sed -n -f %{buildroot}/iso_3166.sed /usr/share/xml/iso-codes/iso_3166.xml >%{buildroot}/iso_3166.tab
grep -av "^$" %{buildroot}/iso_639.tab | grep -av "^#" | while read a b c d ; do
[[ "$d" =~ "^Reserved" ]] && continue
[[ "$d" =~ "^No linguistic" ]] && continue
locale=$c
if [ "$locale" = "XX" ]; then
locale=$b
fi
echo "%lang(${locale}) %{_scl_root}/usr/share/locale/${locale}" >> $RPM_BUILD_DIR/%{buildsubdir}/filelist
echo "%lang(${locale}) %ghost %config(missingok) %{_scl_root}/usr/share/man/${locale}" >> $RPM_BUILD_DIR/%{buildsubdir}/filelist
done
cat %{buildroot}/lang-exceptions | grep -v "^#" | grep -v "^$" | while read loc ; do
locale=$loc
locality=
special=
[[ "$locale" =~ "@" ]] && locale=${locale%%%%@*}
[[ "$locale" =~ "_" ]] && locality=${locale##*_}
[[ "$locality" =~ "." ]] && locality=${locality%%%%.*}
[[ "$loc" =~ "_" ]] || [[ "$loc" =~ "@" ]] || special=$loc
# If the locality is not official, skip it
if [ -n "$locality" ]; then
grep -q "^$locality" %{buildroot}/iso_3166.tab || continue
fi
# If the locale is not official and not special, skip it
if [ -z "$special" ]; then
egrep -q "[[:space:]]${locale%%_*}[[:space:]]" \\
%{buildroot}/iso_639.tab || continue
fi
echo "%lang(${locale}) %{_scl_root}/usr/share/locale/${loc}" >> $RPM_BUILD_DIR/%{buildsubdir}/filelist
echo "%lang(${locale}) %ghost %config(missingok) %{_scl_root}/usr/share/man/${loc}" >> $RPM_BUILD_DIR/%{buildsubdir}/filelist
done
rm -f %{buildroot}/iso_639.tab
rm -f %{buildroot}/iso_639.sed
rm -f %{buildroot}/iso_3166.tab
rm -f %{buildroot}/iso_3166.sed
rm -f %{buildroot}/lang-exceptions
cat $RPM_BUILD_DIR/%{buildsubdir}/filelist | grep "locale" | while read a b ; do
mkdir -p -m 755 %{buildroot}/$b/LC_MESSAGES
done
cat $RPM_BUILD_DIR/%{buildsubdir}/filelist | grep "/share/man" | while read a b c d; do
mkdir -p -m 755 %{buildroot}/$d/man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x,0p,1p,3p}
done
for i in man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x,0p,1p,3p}; do
echo "%{_scl_root}/usr/share/man/$i" >> $RPM_BUILD_DIR/%{buildsubdir}/filelist
done
ln -s $RPM_BUILD_DIR/%{buildsubdir}/filelist $RPM_BUILD_DIR/%{buildsubdir}/filesystem
set -x
popd
}
macros.selinux-policy 0000644 00000015156 15055650401 0010747 0 ustar 00 # Copyright (C) 2017 Red Hat, Inc. All rights reserved.
#
# Author: Petr Lautrbach <plautrba@redhat.com>
# Author: Lukáš Vrabec <lvrabec@redhat.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# RPM macros for packages installing SELinux modules
%_selinux_policy_version 3.14.3
%_selinux_store_path /var/lib/selinux
%_selinux_store_policy_path %{_selinux_store_path}/${_policytype}
%_file_context_file %{_sysconfdir}/selinux/${SELINUXTYPE}/contexts/files/file_contexts
%_file_context_file_pre %{_localstatedir}/lib/rpm-state/file_contexts.pre
%_file_custom_defined_booleans %{_selinux_store_policy_path}/rpmbooleans.custom
%_file_custom_defined_booleans_tmp %{_selinux_store_policy_path}/rpmbooleans.custom.tmp
# %selinux_requires
%selinux_requires \
Requires: selinux-policy >= %{_selinux_policy_version} \
BuildRequires: git \
BuildRequires: pkgconfig(systemd) \
BuildRequires: selinux-policy \
BuildRequires: selinux-policy-devel \
Requires(post): selinux-policy-base >= %{_selinux_policy_version} \
Requires(post): libselinux-utils \
Requires(post): policycoreutils \
%if 0%{?fedora} || 0%{?rhel} > 7\
Requires(post): policycoreutils-python-utils \
%else \
Requires(post): policycoreutils-python \
%endif \
%{nil}
# %selinux_modules_install [-s <policytype>] [-p <modulepriority>] module [module]...
%selinux_modules_install("s:p:") \
. /etc/selinux/config \
_policytype=%{-s*} \
if [ -z "${_policytype}" ]; then \
_policytype="targeted" \
fi \
if [ "${SELINUXTYPE}" = "${_policytype}" ]; then \
%{_sbindir}/semodule -n -s ${_policytype} -X %{!-p:200}%{-p*} -i %* \
%{_sbindir}/selinuxenabled && %{_sbindir}/load_policy || : \
fi \
%{nil}
# %selinux_modules_uninstall [-s <policytype>] [-p <modulepriority>] module [module]...
%selinux_modules_uninstall("s:p:") \
. /etc/selinux/config \
_policytype=%{-s*} \
if [ -z "${_policytype}" ]; then \
_policytype="targeted" \
fi \
if [ $1 -eq 0 ]; then \
if [ "${SELINUXTYPE}" = "${_policytype}" ]; then \
%{_sbindir}/semodule -n -X %{!-p:200}%{-p*} -s ${_policytype} -r %* &> /dev/null || : \
%{_sbindir}/selinuxenabled && %{_sbindir}/load_policy || : \
fi \
fi \
%{nil}
# %selinux_relabel_pre [-s <policytype>]
%selinux_relabel_pre("s:") \
. /etc/selinux/config \
_policytype=%{-s*} \
if [ -z "${_policytype}" ]; then \
_policytype="targeted" \
fi \
if %{_sbindir}/selinuxenabled && [ "${SELINUXTYPE}" = "${_policytype}" ]; then \
[ -f %{_file_context_file_pre} ] || cp -f %{_file_context_file} %{_file_context_file_pre} \
fi \
%{nil}
# %selinux_relabel_post [-s <policytype>]
%selinux_relabel_post("s:") \
. /etc/selinux/config \
_policytype=%{-s*} \
if [ -z "${_policytype}" ]; then \
_policytype="targeted" \
fi \
if %{_sbindir}/selinuxenabled && [ "${SELINUXTYPE}" = "${_policytype}" ]; then \
if [ -f %{_file_context_file_pre} ]; then \
%{_sbindir}/fixfiles -C %{_file_context_file_pre} restore &> /dev/null \
rm -f %{_file_context_file_pre} \
fi \
fi \
%{nil}
# %selinux_set_booleans [-s <policytype>] boolean [boolean]...
%selinux_set_booleans("s:") \
. /etc/selinux/config \
_policytype=%{-s*} \
if [ -z "${_policytype}" ]; then \
_policytype="targeted" \
fi \
if [ -d "%{_selinux_store_policy_path}" ]; then \
LOCAL_MODIFICATIONS=$(%{_sbindir}/semanage boolean -E) \
if [ ! -f %_file_custom_defined_booleans ]; then \
/bin/echo "# This file is managed by macros.selinux-policy. Do not edit it manually" > %_file_custom_defined_booleans \
fi \
semanage_import='' \
for boolean in %*; do \
boolean_name=${boolean%=*} \
boolean_value=${boolean#*=} \
boolean_local_string=$(grep "$boolean_name\$" <<<$LOCAL_MODIFICATIONS) \
if [ -n "$boolean_local_string" ]; then \
semanage_import="${semanage_import}\\nboolean -m -$boolean_value $boolean_name" \
boolean_customized_string=$(grep "$boolean_name\$" %_file_custom_defined_booleans | tail -n 1) \
if [ -n "$boolean_customized_string" ]; then \
/bin/echo $boolean_customized_string >> %_file_custom_defined_booleans \
else \
/bin/echo $boolean_local_string >> %_file_custom_defined_booleans \
fi \
else \
semanage_import="${semanage_import}\\nboolean -m -$boolean_value $boolean_name" \
boolean_default_value=$(LC_ALL=C %{_sbindir}/semanage boolean -l | grep "^$boolean_name " | sed 's/[^(]*([^,]*, *\\(on\\|off\\).*/\\1/') \
/bin/echo "boolean -m --$boolean_default_value $boolean_name" >> %_file_custom_defined_booleans \
fi \
done; \
if %{_sbindir}/selinuxenabled && [ "${SELINUXTYPE}" = "${_policytype}" ]; then \
/bin/echo -e "$semanage_import" | %{_sbindir}/semanage import -S "${_policytype}" \
elif test -d /usr/share/selinux/"${_policytype}"/base.lst; then \
/bin/echo -e "$semanage_import" | %{_sbindir}/semanage import -S "${_policytype}" -N \
fi \
fi \
%{nil}
# %selinux_unset_booleans [-s <policytype>] boolean [boolean]...
%selinux_unset_booleans("s:") \
. /etc/selinux/config \
_policytype=%{-s*} \
if [ -z "${_policytype}" ]; then \
_policytype="targeted" \
fi \
if [ -d "%{_selinux_store_policy_path}" ]; then \
semanage_import='' \
for boolean in %*; do \
boolean_name=${boolean%=*} \
boolean_customized_string=$(grep "$boolean_name\$" %_file_custom_defined_booleans | tail -n 1) \
if [ -n "$boolean_customized_string" ]; then \
awk "/$boolean_customized_string/ && !f{f=1; next} 1" %_file_custom_defined_booleans > %_file_custom_defined_booleans_tmp && mv %_file_custom_defined_booleans_tmp %_file_custom_defined_booleans \
if ! grep -q "$boolean_name\$" %_file_custom_defined_booleans; then \
semanage_import="${semanage_import}\\n${boolean_customized_string}" \
fi \
fi \
done; \
if %{_sbindir}/selinuxenabled && [ "${SELINUXTYPE}" = "${_policytype}" ]; then \
/bin/echo -e "$semanage_import" | %{_sbindir}/semanage import -S "${_policytype}" \
elif test -d /usr/share/selinux/"${_policytype}"/base.lst; then \
/bin/echo -e "$semanage_import" | %{_sbindir}/semanage import -S "${_policytype}" -N \
fi \
fi \
%{nil}
macros.ldconfig 0000644 00000000463 15055650401 0007543 0 ustar 00 #%ldconfig /sbin/ldconfig
%ldconfig_post(n:) %{?ldconfig:%post -p %ldconfig %{?*} %{-n:-n %{-n*}}\
%end}
%ldconfig_postun(n:) %{?ldconfig:%postun -p %ldconfig %{?*} %{-n:-n %{-n*}}\
%end}
%ldconfig_scriptlets(n:) %{?ldconfig:\
%ldconfig_post %{?*} %{-n:-n %{-n*}}\
%ldconfig_postun %{?*} %{-n:-n %{-n*}}\
}
macros.rust-srpm 0000644 00000000075 15055650401 0007731 0 ustar 00 %rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x
macros.efi-srpm 0000644 00000006003 15055650401 0007474 0 ustar 00 #
# EFI specific SRPM macro definitions
#
# Copyright 2018 Peter M Jones <pjones@redhat.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
%_efi_srpm_macros_setup() %{expand:%{lua:
-- test if our arch matches
local function arch(archmacro)
local target = rpm.expand(" %{_target_cpu} ")
local arches = rpm.expand(" " .. archmacro .. " ")
local match = string.match(arches, target)
return (match ~= nil)
end
-- give us the arch...
local function getarch()
if arch("ia64") then
return("ia64")
elseif arch("x86_64") then
return("x64")
elseif arch("%{ix86}") then
return("ia32")
elseif arch("aarch64") then
return("aa64")
elseif arch("%{arm}") then
return("arm")
else
return("none")
end
end
-- alt arch
local function getaltarch()
if arch("x86_64") then
return("ia32")
else
return("none")
end
end
-- make some macros
local done = rpm.expand("%{?_efi}")
if done == nil or done == "" then
local arch = getarch()
local alt = getaltarch()
print("%global _efi x86_64 aarch64 %{arm} %{ix86}\\n")
print("%global _efi_vendor cloudlinux\\n")
if arch == "none" then
print("%global _efi_has_arch 0\\n")
else
print("%global _efi_has_arch 1\\n")
end
print("%global _efi_arch " .. getarch() .. "\\n")
print("%global _efi_arch_upper " .. string.upper(getarch()) .. "\\n")
if alt == "none" then
print("%global _efi_has_alt_arch 0\\n")
else
print("%global _efi_has_alt_arch 1\\n")
end
print("%global _efi_alt_arch " .. alt .. "\\n")
print("%global _efi_alt_arch_upper " .. string.upper(alt) .. "\\n")
end
}}
%efi_srpm_macros_version %{expand:%{_efi_srpm_macros_setup}}3
%efi %{expand:%{_efi_srpm_macros_setup}}%{expand:%{_efi}}
%efi_vendor %{expand:%{_efi_srpm_macros_setup}}%{expand:%{_efi_vendor}}
%efi_esp_root /boot/efi
%efi_esp_efi %{efi_esp_root}/EFI
%efi_esp_boot %{efi_esp_efi}/BOOT
%efi_esp_dir %{expand:%{_efi_srpm_macros_setup}}%{efi_esp_efi}/centos
%efi_arch %{expand:%{_efi_srpm_macros_setup}}%{_efi_arch}
%efi_arch_upper %{expand:%{_efi_srpm_macros_setup}}%{_efi_arch_upper}
%efi_has_arch %{expand:%{_efi_srpm_macros_setup}}0%{_efi_has_arch}
%efi_has_alt_arch %{expand:%{_efi_srpm_macros_setup}}0%{_efi_has_alt_arch}
%efi_alt_arch %{expand:%{_efi_srpm_macros_setup}}%{?_efi_alt_arch}%{nil}
%efi_alt_arch_upper %{expand:%{_efi_srpm_macros_setup}}%{?_efi_alt_arch_upper}%{nil}
macros.ruby 0000644 00000001751 15055650401 0006740 0 ustar 00 %ruby_libdir %{_datadir}/%{srcname}
%ruby_libarchdir %{_libdir}/%{srcname}
# This is the local lib/arch and should not be used for packaging.
%ruby_sitedir site_ruby
%ruby_sitelibdir %{_prefix}/share/%{srcname}/%{ruby_sitedir}
%ruby_sitearchdir %{_prefix}/%{_lib}/%{srcname}/%{ruby_sitedir}
# This is the general location for libs/archs compatible with all
# or most of the Ruby versions available in the Fedora repositories.
%ruby_vendordir vendor_ruby
%ruby_vendorlibdir %{ruby_libdir}/%{ruby_vendordir}
%ruby_vendorarchdir %{ruby_libarchdir}/%{ruby_vendordir}
# For ruby packages we want to filter out any provides caused by private
# libs in %%{ruby_vendorarchdir}/%%{ruby_sitearchdir}.
#
# Note that this must be invoked in the spec file, preferably as
# "%{?ruby_default_filter}", before any %description block.
%ruby_default_filter %{expand: \
%global __provides_exclude_from %{?__provides_exclude_from:%{__provides_exclude_from}|}^(%{ruby_vendorarchdir}|%{ruby_sitearchdir})/.*\\\\.so$ \
}
macros.alt-python39 0000644 00000003751 15055650401 0010234 0 ustar 00 %__alt_python39 /opt/alt/python39/bin/python3
%alt_python39_sitelib %(%{__alt_python39} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
%alt_python39_sitearch %(%{__alt_python39} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))")
%alt_python39_version %(%{__alt_python39} -Ic "import sys; sys.stdout.write(sys.version[:3])")
%alt_python39_version_nodots %(%{__alt_python39} -Ic "import sys; sys.stdout.write(sys.version[:3].replace('.',''))")
%alt_py39dir %{_builddir}/python3-%{name}-%{version}-%{release}
%alt_python39_dir /opt/alt/python39
%py_setup setup.py
%alt_py39_shbang_opts -s
%alt_py39_shbang_opts_nodash %(opts=%{alt_py39_shbang_opts}; echo ${opts#-})
# Use the slashes after expand so that the command starts on the same line as
# the macro
%alt_py39_build() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python39} %{py_setup} %{?py_setup_args} build --executable="%{__alt_python39} %{alt_py39_shbang_opts}" %{?*}
}
%alt_py39_build_egg() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python39} %{py_setup} %{?py_setup_args} bdist_egg %{?*}
}
%alt_py39_build_wheel() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python39} %{py_setup} %{?py_setup_args} bdist_wheel %{?*}
}
%alt_py39_install() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python39} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
}
%alt_py39_install_egg() %{expand:\\\
mkdir -p %{buildroot}%{alt_python39_sitelib}
%alt_easy_install-3.9 -m --prefix %{buildroot}%{_prefix} -Z dist/*-py3.9.egg %{?*}
%{alt_python39_dir}/bin/easy_install-3.9 %{alt_python39_locate}/bin/easy_install-3.9
}
%alt_py39_install_wheel() %{expand:\\\
%{alt_python39_dir}/bin/pip3.9 install -I dist/%{1} --root %{buildroot} --no-deps
}
macros.info 0000644 00000000606 15055650401 0006710 0 ustar 00 %info_requires \
Requires(post): /sbin/install-info \
Requires(preun): /sbin/install-info
%info_post() \
if [ -f %{_infodir}/%1 ]; then # --excludedocs? \
/sbin/install-info %{_infodir}/%1 %{_infodir}/dir || : \
fi
%info_preun() \
if [ $1 == 0 ]; then \
if [ -f %{_infodir}/%1 ]; then # --excludedocs? \
/sbin/install-info --delete %{_infodir}/%1 %{_infodir}/dir || : \
fi \
fi
macros.qt5-qtbase 0000644 00000000116 15055650401 0007737 0 ustar 00 %_qt5 qt5-qtbase
%_qt5_epoch 0
%_qt5_version 5.15.3
%_qt5_evr 5.15.3-8.el8_10
macros.perl-srpm 0000644 00000001432 15055650401 0007674 0 ustar 00 # Copyright (c) 2012 Petr Pisar <ppisar@redhat.com>.
# This file is distributed under the terms of GNU GPL license version 3, or
# any later version.
# This file contains macros that can be used for building source RPM package
# from git source repository. This file must present in minimal build root to
# take effect.
# This file must not use Perl or any non-minimal-build-root package. The
# purpose is to enable bootstrapping perl.
# Perl bootstrap For rebuild of Perl and all related packages is needed
# switch, which enable only vital build requires. This could help cyclic
# dependencies, for example: perl-Test-Minimum-Version <->
# perl-Perl-Minimum-Version Defined for bootstraping, undefined otherwise.
# Usage: %%if !%%{defined perl_bootstrap} ... %%endif
#%%perl_bootstrap 1
macros.firewalld 0000644 00000000357 15055650401 0007731 0 ustar 00 # RPM macros for packages installing firewalld services/zones
# put this into %post otherwise firewalld won't load new service/zone file
%firewalld_reload() \
test -x %{_bindir}/firewall-cmd && firewall-cmd --reload --quiet || : \
%{nil}
macros.pybytecompile 0000644 00000001566 15055650401 0010650 0 ustar 00 # Note that the path could itself be a python file, or a directory
# Python's compile_all module only works on directories, and requires a max
# recursion depth
# Usage:
# %py_byte_compile <interpereter> <path>
# Example:
# %py_byte_compile %{__python3} %{buildroot}%{_datadir}/spam/plugins/
# This will terminate build on SyntaxErrors, if you want to avoid that,
# use it in a subshell like this:
# (%{py_byte_compile <interpereter> <path>}) || :
%py_byte_compile()\
python_binary="%1"\
buildroot_path="%2"\
bytecode_compilation_path=".${buildroot_path/#$RPM_BUILD_ROOT}"\
failure=0\
pushd $RPM_BUILD_ROOT\
find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -m py_compile || failure=1\
find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -m py_compile || failure=1\
popd\
test $failure -eq 0
macros.ghc-srpm 0000644 00000000636 15055650401 0007500 0 ustar 00 # Macros needed for building srpms of Haskell packages
# from ghc-7.8 ghci is supported on all arch's
# former archs: armv5tel ppc sparcv9
%ghc_arches_with_ghci %{ix86} x86_64 armv7hl ppc64 ppc64le aarch64 s390 s390x %{mips}
# ghc_arches is not used in current packages but still here for back compat
# former archs: alpha ppc sparcv9 armv5tel
%ghc_arches %{ix86} x86_64 armv7hl ppc64 ppc64le aarch64 s390 s390x
macros.alt-python38 0000644 00000003746 15055650401 0010237 0 ustar 00 %__alt_python38 /opt/alt/python38/bin/python3
%alt_python38_sitelib %(%{__alt_python38} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
%alt_python38_sitearch %(%{__alt_python38} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
%alt_python38_version %(%{__alt_python38} -Ic "import sys; sys.stdout.write(sys.version[:3])")
%alt_python38_version_nodots %(%{__alt_python38} -Ic "import sys; sys.stdout.write(sys.version[:3].replace('.',''))")
%alt_py38dir %{_builddir}/python3-%{name}-%{version}-%{release}
%alt_python38_dir /opt/alt/python38
%py_setup setup.py
%alt_py38_shbang_opts -s
%alt_py38_shbang_opts_nodash %(opts=%{alt-py38_shbang_opts}; echo ${opts#-})
# Use the slashes after expand so that the command starts on the same line as
# the macro
%alt_py38_build() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python38} %{py_setup} %{?py_setup_args} build --executable="%{__alt_python38} %{alt-py38_shbang_opts}" %{?*}
}
%alt_py38_build_egg() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python38} %{py_setup} %{?py_setup_args} bdist_egg %{?*}
}
%alt_py38_build_wheel() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python38} %{py_setup} %{?py_setup_args} bdist_wheel %{?*}
}
%alt_py38_install() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python38} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
}
%alt_py38_install_egg() %{expand:\\\
mkdir -p %{buildroot}%{alt_python38_sitelib}
%alt_easy_install-3.8 -m --prefix %{buildroot}%{_prefix} -Z dist/*-py3.8.egg %{?*}
%{alt_python38_dir}/bin/easy_install-3.8 %{alt_python38_locate}/bin/easy_install-3.8
}
%alt_py38_install_wheel() %{expand:\\\
%{alt_python38_dir}/bin/pip3.8 install -I dist/%{1} --root %{buildroot} --no-deps
}
macros.nodejs-srpm 0000644 00000000504 15055650401 0010213 0 ustar 00 # nodejs_arches lists what arches Node.js and dependent packages run on.
#
# Enabling Node.js on other arches requires porting the V8 JavaScript JIT to
# those arches. Support for POWER and aarch64 arrived in nodejs v4. Support
# for s390x arrived in nodejs v6
%nodejs_arches %{ix86} x86_64 %{arm} aarch64 %{power64} s390x
macros.alt-python313 0000644 00000004016 15055650401 0010302 0 ustar 00 %__alt_python313 /opt/alt/python313/bin/python3
%alt_python313_sitelib %(%{__alt_python313} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
%alt_python313_sitearch %(%{__alt_python313} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))")
%alt_python313_version %(%{__alt_python313} -Ic "import sys; sys.stdout.write(sys.version[:3])")
%alt_python313_version_nodots %(%{__alt_python313} -Ic "import sys; sys.stdout.write(sys.version[:3].replace('.',''))")
%alt_py313dir %{_builddir}/python3-%{name}-%{version}-%{release}
%alt_python313_dir /opt/alt/python313
%py_setup setup.py
%alt_py313_shbang_opts -s
%alt_py313_shbang_opts_nodash %(opts=%{alt_py313_shbang_opts}; echo ${opts#-})
# Use the slashes after expand so that the command starts on the same line as
# the macro
%alt_py313_build() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python313} %{py_setup} %{?py_setup_args} build --executable="%{__alt_python313} %{alt_py313_shbang_opts}" %{?*}
}
%alt_py313_build_egg() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python313} %{py_setup} %{?py_setup_args} bdist_egg %{?*}
}
%alt_py313_build_wheel() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python313} %{py_setup} %{?py_setup_args} bdist_wheel %{?*}
}
%alt_py313_install() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__alt_python313} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
}
%alt_py313_install_egg() %{expand:\\\
mkdir -p %{buildroot}%{alt_python313_sitelib}
%alt_easy_install-3.13 -m --prefix %{buildroot}%{_prefix} -Z dist/*-py3.13.egg %{?*}
%{alt_python313_dir}/bin/easy_install-3.13 %{alt_python313_locate}/bin/easy_install-3.13
}
%alt_py313_install_wheel() %{expand:\\\
%{alt_python313_dir}/bin/pip3.13 install -I dist/%{1} --root %{buildroot} --no-deps
}
macros.dwz 0000644 00000003416 15055650401 0006563 0 ustar 00 # Macros for reducing debug info size using dwz(1) utility.
# The two default values below should result in dwz taking at most
# 3GB of RAM or so on 64-bit hosts and 2.5GB on 32-bit hosts
# on the largest *.debug files (in mid 2012 those are
# libreoffice-debuginfo, debuginfos containing
# libxul.so.debug and libwebkitgtk-*.so.*.debug).
# This needs to be tuned based on the amount of available RAM
# on build boxes for each architecture as well as virtual address
# space limitations if dwz is 32-bit program. While it needs less
# memory than 64-bit program because pointers are smaller, it can
# never have more than 4GB-epsilon of RAM and on some architecture
# even less than that (e.g. 2GB).
# Number of debugging information entries (DIEs) above which
# dwz will stop considering file for multifile optimizations
# and enter a low memory mode, in which it will optimize
# in about half the memory needed otherwise.
%_dwz_low_mem_die_limit 10000000
# Number of DIEs above which dwz will stop processing
# a file altogether.
%_dwz_max_die_limit 50000000
# On x86_64 increase the higher limit to make libwebkit* optimizable.
# libwebkit* in mid 2012 contains roughly 87mil DIEs, and 64-bit
# dwz is able to optimize it from ~1.1GB to ~410MB using 5.2GB of RAM.
%_dwz_max_die_limit_x86_64 110000000
# On ARM, build boxes often have only 512MB of RAM and are very slow.
# Lower both the limits.
%_dwz_low_mem_die_limit_armv5tel 4000000
%_dwz_low_mem_die_limit_armv7hl 4000000
%_dwz_max_die_limit_armv5tel 10000000
%_dwz_max_die_limit_armv7hl 10000000
%_dwz_limit() %{expand:%%{?%{1}_%{_arch}}%%{!?%{1}_%{_arch}:%%%{1}}}
%_find_debuginfo_dwz_opts --run-dwz\\\
--dwz-low-mem-die-limit %{_dwz_limit _dwz_low_mem_die_limit}\\\
--dwz-max-die-limit %{_dwz_limit _dwz_max_die_limit}
macros.fedora-misc-srpm 0000644 00000000357 15055650401 0011130 0 ustar 00 # Some miscellaneous Fedora-related macros
# A directory for rpm macros
%rpmmacrodir /usr/lib/rpm/macros.d
# A directory for appdata metainfo. This has changed between releases so a
# macro is useful.
%_metainfodir %{_datadir}/metainfo