Compare commits
23 Commits
Author | SHA1 | Date |
---|---|---|
Maxwell G | e144404aa7 | 10 months ago |
Mattias Ellert | 1b116421bf | 1 year ago |
Maxwell G | 83096c1f15 | 2 years ago |
Maxwell G | 22656b4be3 | 2 years ago |
Artur Frenszek-Iwicki | fd96ff6194 | 2 years ago |
Maxwell G | a0d0fa2bf3 | 2 years ago |
Jitka Plesnikova | 41c3ca379c | 2 years ago |
Jitka Plesnikova | 0657f9b47c | 2 years ago |
Maxwell G | ee11dd5032 | 2 years ago |
Maxwell G | c212ede694 | 2 years ago |
Carl George | e19afa3b2e | 3 years ago |
Maxwell G | db0166460a | 3 years ago |
Carl George | 61359cc134 | 3 years ago |
Miro Hrončok | 3dd1c45c3a | 3 years ago |
Troy Dawson | 1e810d8164 | 3 years ago |
Troy Dawson | e714c8c15a | 3 years ago |
Troy Dawson | 5ac77a6aae | 3 years ago |
Troy Dawson | 34c5276fa0 | 3 years ago |
Troy Dawson | 7353e5ae80 | 3 years ago |
Troy Dawson | 8ee9fd160e | 3 years ago |
Troy Dawson | 8122e8fd36 | 3 years ago |
Troy Dawson | ccc4dda6d5 | 3 years ago |
Troy Dawson | ec361e3258 | 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,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 8
|
||||
|
||||
# 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
|
||||
%epel 9
|
||||
|
||||
# Bash completions; not in bash to not intefere with install ordering
|
||||
%bash_completion_dir /usr/share/bash-completion/completions/
|
||||
|
||||
# Use the non-underscored Python macros to refer to Python in spec, etc.
|
||||
%python2 %__python2
|
||||
%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
|
||||
# Arches that OpenJDK and dependent packages run on
|
||||
%java_arches aarch64 ppc64le s390x x86_64
|
||||
|
@ -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…
Reference in new issue