Compare commits

...

23 Commits
epel8 ... epel9

Author SHA1 Message Date
Maxwell G e144404aa7
Add forge-srpm-macros to the buildroot
10 months ago
Mattias Ellert 1b116421bf Add qt6-srpm-macros to the buildroot. Fixes rhbz#2220860.
1 year ago
Maxwell G 83096c1f15
Rebuild for RHEL 9.2
2 years ago
Maxwell G 22656b4be3
Add rust-srpm-macros-epel to the buildroot
2 years ago
Artur Frenszek-Iwicki fd96ff6194
Add a Requires on fpc-srpm-macros
2 years ago
Maxwell G a0d0fa2bf3
Add rpmautospec to the buildroot to mirror Fedora
2 years ago
Jitka Plesnikova 41c3ca379c Add boolean operator to perl-generators-epel
2 years ago
Jitka Plesnikova 0657f9b47c Add perl-generators-epel to the buildroot
2 years ago
Maxwell G ee11dd5032
Add go-srpm-macros-epel to the buildroot
2 years ago
Maxwell G c212ede694
Backport macros.shell-completions from Fedora
2 years ago
Carl George e19afa3b2e Backport java_arches macro from Fedora
3 years ago
Maxwell G db0166460a
Add `Requires: ansible-srpm-macros`
3 years ago
Carl George 61359cc134 Rebuild for EPEL9
3 years ago
Miro Hrončok 3dd1c45c3a Minor packaging nitpicks
3 years ago
Troy Dawson 1e810d8164 Add %dist to Release:, Fix pyproject-rpm-macros typo
3 years ago
Troy Dawson e714c8c15a Cleanup spec, prepare for new macros
3 years ago
Troy Dawson 5ac77a6aae epel-rpm-macros.rpmlintrc not used
3 years ago
Troy Dawson 34c5276fa0 macros.build-constraints provided by redhat-rpm-config
3 years ago
Troy Dawson 7353e5ae80 gpgverify provided by redhat-rpm-config
3 years ago
Troy Dawson 8ee9fd160e pythondist.attr provided by python3-rpm-generators
3 years ago
Troy Dawson 8122e8fd36 remove macros already in rhel9
3 years ago
Troy Dawson ccc4dda6d5 pyproject-rpm-macros in CRB thus not required by python3-devel or python3-rpm-macros
3 years ago
Troy Dawson ec361e3258 - Update release to 9
3 years ago

@ -1,5 +0,0 @@
addFilter("epel-rpm-macros\.src: W: strange-permission cmake-(build|configure|install) 755")
addFilter("epel-rpm-macros\.src: W: strange-permission gpgverify 755")
addFilter("no-%build-section")
addFilter("no-documentation")
addFilter("only-non-binary-in-usr-lib")

@ -1,38 +1,46 @@
Name: epel-rpm-macros Name: epel-rpm-macros
Version: 8 Version: 9
Release: 24 Release: 14%{dist}
Summary: Extra Packages for Enterprise Linux RPM macros Summary: Extra Packages for Enterprise Linux RPM macros
Group: System Environment/Base
License: GPLv2 License: GPLv2
# This is a EPEL maintained package which is specific to # This is a EPEL maintained package which is specific to
# our distribution. Thus the source is only available from # our distribution. Thus the source is only available from
# within this srpm. # within this srpm.
URL: http://download.fedoraproject.org/pub/epel URL: https://download.fedoraproject.org/pub/epel
Source0: macros.epel-rpm-macros Source0: macros.epel-rpm-macros
Source1: macros.zzz-epel-override Source1: macros.zzz-epel-override
Source2: gpgverify Source2: GPL
Source3: pythondist.attr #Add source for misc macros below here
Source9: GPL # https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/rawhide/f/macros.shell-completions
# misc macros Source3: macros.shell-completions
Source150: macros.build-constraints
BuildArch: noarch BuildArch: noarch
Requires: redhat-release >= %{version} Requires: redhat-release >= %{version}
# For FPC buildroot macros # For FPC buildroot macros
Requires: fpc-srpm-macros Requires: fpc-srpm-macros
# For Lua SRPM macros # pyproject-rpm-macros in CRB thus not required by python3-devel or python3-rpm-macros
Requires: lua-srpm-macros # https://bugzilla.redhat.com/show_bug.cgi?id=2001034
# For python buildroot macros Requires: (pyproject-rpm-macros if python3-rpm-macros)
Requires: python-srpm-macros Requires: ansible-srpm-macros
# Since the RHEL python-devel package doesn't require them, bring them in here # Backwards-compatible backport of the new forge-srpm-macros from Fedora that
Requires: python-rpm-macros # avoids conflicts with EL 9's old version
Requires: python2-rpm-macros Requires: forge-srpm-macros
# Make sure EPEL8's Python 3 packages use /usr/bin/python3.6 or python3.8 # Provides backports from Fedora's go-rpm-macros and fixes critical
# instead of /usr/libexec/platform-python # bugs in RHEL's go-rpm-macros.
Requires: (python-modular-rpm-macros if python3-devel) # Just like in Fedora, only the minimal -srpm-macros are needed in the buildroot.
Suggests: python36-rpm-macros # The rest of the macros are pulled in dynamically.
Requires: go-srpm-macros-epel
# Provides backports from Fedora's rust-srpm-macros
Requires: rust-srpm-macros-epel
# Provides backport from Fedora's perl-generators related to proposal
# https://fedoraproject.org/wiki/Changes/Perl_replace_MODULE_COMPAT_by_generator
Requires: (perl-generators-epel if perl-generators)
# Add rpmautospec to the buildroot to mirror Fedora
Requires: rpmautospec-rpm-macros
Requires: qt6-srpm-macros
%description %description
This package contains the Extra Packages for Enterprise Linux (EPEL) RPM This package contains the Extra Packages for Enterprise Linux (EPEL) RPM
@ -40,38 +48,71 @@ macros for building EPEL packages.
%prep %prep
%setup -cT %setup -cT
install -pm 644 %{SOURCE9} . install -pm 644 %{SOURCE2} .
%install %install
#GPG Key #epel rpm macros
install -Dpm 644 %{SOURCE0} \ install -Dpm 644 %{SOURCE0} \
%{buildroot}%{_rpmmacrodir}/macros.epel-rpm-macros %{buildroot}%{_rpmmacrodir}/macros.epel-rpm-macros
install -Dpm 644 %{SOURCE1} \ install -Dpm 644 %{SOURCE1} \
%{buildroot}%{_sysconfdir}/rpm/macros.zzz-epel-override %{buildroot}%{_sysconfdir}/rpm/macros.zzz-epel-override
install -Dpm 755 %{SOURCE2} \ #Add misc macros below here
%{buildroot}%{_rpmconfigdir}/gpgverify
install -Dpm 644 %{SOURCE3} \ install -Dpm 644 %{SOURCE3} \
%{buildroot}%{_fileattrsdir}/pythondist.attr %{buildroot}%{_rpmmacrodir}/macros.shell-completions
# misc macros
install -Dpm 644 %{SOURCE150} \
%{buildroot}%{_rpmmacrodir}/macros.build-constraints
%files %files
%license GPL %license GPL
%{_rpmmacrodir}/macros.epel-rpm-macros %{_rpmmacrodir}/macros.epel-rpm-macros
%{_sysconfdir}/rpm/macros.zzz-epel-override %{_sysconfdir}/rpm/macros.zzz-epel-override
%{_rpmconfigdir}/gpgverify %{_rpmmacrodir}/macros.shell-completions
%{_fileattrsdir}/pythondist.attr
# misc macros
%{_rpmmacrodir}/macros.build-constraints
%changelog %changelog
* Sat Mar 02 2024 Maxwell G <maxwell@gtmx.me> - 9-14
- Add forge-srpm-macros to the buildroot
* Thu Oct 05 2023 Mattias Ellert <mattias.ellert@physics.uu.se> - 9-13
- Add qt6-srpm-macros to the buildroot. Fixes rhbz#2220860.
* Wed May 10 2023 Maxwell G <maxwell@gtmx.me> - 9-12
- Rebuild for RHEL 9.2
* Sun Mar 05 2023 Artur Frenszek-Iwicki <fedora@svgames.pl> - 9-11
- Add fpc-srpm-macros to the buildroot
* Sat Feb 25 2023 Maxwell G <maxwell@gtmx.me> - 9-10
- Add rust-srpm-macros-epel to the buildroot
* Fri Feb 10 2023 Maxwell G <gotmax@e.email> - 9-9
- Add rpmautospec to the buildroot to mirror Fedora
* Mon Jan 23 2023 Jitka Plesnikova <jplesnik@redhat.com> - 9-8
- Add perl-generators-epel to the buildroot
* Fri Sep 02 2022 Maxwell G <gotmax@e.email> - 9-7
- Add go-srpm-macros-epel to the buildroot
* Thu Sep 01 2022 Maxwell G <gotmax@e.email> - 9-6
- Backport macros.shell-completions from Fedora
* Fri May 27 2022 Carl George <carl@george.computer> - 9-5
- Backport java_arches macro from Fedora
* Tue May 17 2022 Maxwell G <gotmax@e.email> - 9-4
- Add `Requires: ansible-srpm-macros`
* Thu Dec 02 2021 Carl George <carl@george.computer> - 9-3
- Rebuild for EPEL9
* Mon Oct 25 2021 Troy Dawson <tdawson@redhat.com> - 9-2
- Add %%dist to Release:
- Fix pyproject-rpm-macros typo
* Mon Oct 25 2021 Troy Dawson <tdawson@redhat.com> - 9-1
- Make an initial macro set for 9
* Wed Sep 1 2021 Michel Alexandre Salim <salimma@fedoraproject.org> - 8-24 * Wed Sep 1 2021 Michel Alexandre Salim <salimma@fedoraproject.org> - 8-24
- Fix macros.build-constraints' %%limit_build - Fix macros.build-constraints' %%limit_build
- number of CPUs will never be set to less than 1 - number of CPUs will never be set to less than 1

@ -1,116 +0,0 @@
#!/bin/bash
# Copyright 2018 B. Persson, Bjorn@Rombobeorn.se
#
# 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, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
function print_help {
cat <<'EOF'
Usage: gpgverify --keyring=<pathname> --signature=<pathname> --data=<pathname>
gpgverify is a wrapper around gpgv designed for easy and safe scripting. It
verifies a file against a detached OpenPGP signature and a keyring. The keyring
shall contain all the keys that are trusted to certify the authenticity of the
file, and must not contain any untrusted keys.
The differences, compared to invoking gpgv directly, are that gpgverify accepts
the keyring in either ASCII-armored or unarmored form, and that it will not
accidentally use a default keyring in addition to the specified one.
Parameters:
--keyring=<pathname> keyring with all the trusted keys and no others
--signature=<pathname> detached signature to verify
--data=<pathname> file to verify against the signature
EOF
}
fatal_error() {
message="$1" # an error message
status=$2 # a number to use as the exit code
echo "gpgverify: $message" >&2
exit $status
}
require_parameter() {
term="$1" # a term for a required parameter
value="$2" # Complain and terminate if this value is empty.
if test -z "${value}" ; then
fatal_error "No ${term} was provided." 2
fi
}
check_status() {
action="$1" # a string that describes the action that was attempted
status=$2 # the exit code of the command
if test $status -ne 0 ; then
fatal_error "$action failed." $status
fi
}
# Parse the command line.
keyring=
signature=
data=
for parameter in "$@" ; do
case "${parameter}" in
(--help)
print_help
exit
;;
(--keyring=*)
keyring="${parameter#*=}"
;;
(--signature=*)
signature="${parameter#*=}"
;;
(--data=*)
data="${parameter#*=}"
;;
(*)
fatal_error "Unknown parameter: \"${parameter}\"" 2
;;
esac
done
require_parameter 'keyring' "${keyring}"
require_parameter 'signature' "${signature}"
require_parameter 'data file' "${data}"
# Make a temporary working directory.
workdir="$(mktemp --directory)"
check_status 'Making a temporary directory' $?
workring="${workdir}/keyring.gpg"
# Decode any ASCII armor on the keyring. This is harmless if the keyring isn't
# ASCII-armored.
gpg2 --homedir="${workdir}" --yes --output="${workring}" --dearmor "${keyring}"
check_status 'Decoding the keyring' $?
# Verify the signature using the decoded keyring.
gpgv2 --homedir="${workdir}" --keyring="${workring}" "${signature}" "${data}"
check_status 'Signature verification' $?
# (--homedir isn't actually necessary. --dearmor processes only the input file,
# and if --keyring is used and contains a slash, then gpgv2 uses only that
# keyring. Thus neither command will look for a default keyring, but --homedir
# makes extra double sure that no default keyring will be touched in case
# another version of GPG works differently.)
# Clean up. (This is not done in case of an error that may need inspection.)
rm --recursive --force ${workdir}

@ -1,42 +0,0 @@
# Macros to constrain resource use during the build process
# outputs build flag overrides to be used in conjunction with
# %%make_build, %%cmake_build etc.
#
# if no override is needed, this macro outputs nothing
#
# - m memory limit in MBs per core; default is 1024
#
# Usage:
# e.g. %make_build %{limit_build -m 2048}
# => /usr/bin/make -O -j16 V=1 VERBOSE=1
# %make_build %{limit_build -m 40960}
# => /usr/bin/make -O -j16 V=1 VERBOSE=1 -j1
#
%limit_build(m:) %{lua:
local mem_per_process=rpm.expand("%{-m*}")
if mem_per_process == "" then
mem_per_process = 1024
else
mem_per_process = tonumber(mem_per_process)
end
local mem_total = 0
for line in io.lines('/proc/meminfo') do
if line:sub(1, 9) == "MemTotal:" then
local tokens = {}
for token in line:gmatch("%w+") do
tokens[#tokens + 1] = token
end
mem_total = tonumber(tokens[2])
break
end
end
local max_jobs = mem_total // (mem_per_process * 1024)
if max_jobs < 1 then
max_jobs = 1
end
cur_max_jobs=tonumber(rpm.expand("%{_smp_build_ncpus}"))
if cur_max_jobs > max_jobs then
print("-j" .. max_jobs)
end
}

@ -1,138 +1,9 @@
# epel macros # epel macros
%epel 8 %epel 9
# Mono macros requested in rhbz 1295117
%mono_arches %{ix86} x86_64 sparc sparcv9 ia64 %{arm} alpha s390x ppc ppc64 ppc64le
%_monodir %{_prefix}/lib/mono
%_monogacdir %{_monodir}/gac
# A directory for rpm macros
%rpmmacrodir /usr/lib/rpm/macros.d
# Upstream RPM has this in Fedora, obsoleting the one above.
%_rpmmacrodir /usr/lib/rpm/macros.d
# Bash completions; not in bash to not intefere with install ordering # Bash completions; not in bash to not intefere with install ordering
%bash_completion_dir /usr/share/bash-completion/completions/ %bash_completion_dir /usr/share/bash-completion/completions/
# Use the non-underscored Python macros to refer to Python in spec, etc. # Arches that OpenJDK and dependent packages run on
%python2 %__python2 %java_arches aarch64 ppc64le s390x x86_64
%python3 %__python3
# Simplified version backported from Fedora
%py_shebang_fix %{expand:/usr/bin/pathfix.py -pni "%{__python} %{py_shbang_opts}"}
%py2_shebang_fix %{expand:/usr/bin/pathfix.py -pni "%{__python2} %{py2_shbang_opts}"}
%py3_shebang_fix %{expand:/usr/bin/pathfix.py -pni "%{__python3} %{py3_shbang_opts}"}
# https://fedoraproject.org/wiki/Changes/Python_Upstream_Architecture_Names
%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'))")
%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'))")
# Users can use %%python only if they redefined %%__python (e.g. to %%__python3)
%python() %{lua:\
__python = rpm.expand("%__python")\
if __python == "/usr/bin/python" then\
rpm.expand("%{error:Cannot use %%python if %%__python wasn't redefined to something other than /usr/bin/python.}")\
else\
print(__python)\
end\
}
# 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-3
%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}
%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')
-- NB: dash needs to be escaped!
if name:match('^python3%-') then
replaced = name:gsub('^python3%-', 'python-')
print('Provides: ' .. replaced .. ' = ' .. evr .. '\\n')
end
}
# With $PATH and $PYTHONPATH set to the %%buildroot,
# try to import the given Python module(s).
# Useful as a smoke test in %%check when running tests is not feasible.
# Use spaces or commas as separators.
%py_check_import() %{expand:\\\
(cd %{_topdir} &&\\\
PATH="%{buildroot}%{_bindir}:$PATH"\\\
PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python_sitearch}:%{buildroot}%{python_sitelib}}"\\\
PYTHONDONTWRITEBYTECODE=1\\\
%{__python} -c "import %{lua:local m=rpm.expand('%{?*}'):gsub('[%s,]+', ', ');print(m)}"
)
}
%py2_check_import() %{expand:\\\
(cd %{_topdir} &&\\\
PATH="%{buildroot}%{_bindir}:$PATH"\\\
PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python2_sitearch}:%{buildroot}%{python2_sitelib}}"\\\
PYTHONDONTWRITEBYTECODE=1\\\
%{__python2} -c "import %{lua:local m=rpm.expand('%{?*}'):gsub('[%s,]+', ', ');print(m)}"
)
}
%py3_check_import() %{expand:\\\
(cd %{_topdir} &&\\\
PATH="%{buildroot}%{_bindir}:$PATH"\\\
PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}"\\\
PYTHONDONTWRITEBYTECODE=1\\\
%{__python3} -c "import %{lua:local m=rpm.expand('%{?*}'):gsub('[%s,]+', ', ');print(m)}"
)
}
%python_disable_dependency_generator() \
%undefine __pythondist_requires \
%{nil}
# gpgverify verifies signed sources. There is documentation in the script.
%gpgverify(k:s:d:) %{lua:
local script = rpm.expand("%{_rpmconfigdir}/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
}
# qt5 macro removed from RHEL8 but needed to ensure qtwebengine, and
# it's dependencies build on supported arches.
%qt5_qtwebengine_arches %{ix86} x86_64 %{arm} aarch64 mips mipsel mips64el

@ -0,0 +1,3 @@
%bash_completions_dir %{_datadir}/bash-completion/completions
%zsh_completions_dir %{_datadir}/zsh/site-functions
%fish_completions_dir %{_datadir}/fish/vendor_completions.d

@ -1,3 +0,0 @@
%__pythondist_provides %{_rpmconfigdir}/pythondistdeps.py --provides --majorver-provides
%__pythondist_requires %{_rpmconfigdir}/pythondistdeps.py --requires
%__pythondist_path ^/usr/lib(64)?/python[[:digit:]]\\.[[:digit:]]+/site-packages/[^/]+\\.(dist-info|egg-info|egg-link)$
Loading…
Cancel
Save