Accepting request 975792 from home:bnavigator:branches:devel:openSUSE:Factory:rpmlint
- Use python310 flavor explicitly, irrespective of the primary python3 flavor du jour. - Migration of primary Python interpreter to 3.10 * update stdlib.txt: encoding, importlib, lib-dynload, dataclasses, ast * Remove deprecated stdlib distutils from the venv (not used by rpmlint) * Do not install+delete pip in the venv - Update URL - Explicit BuildRequires: python-rpm-macros -- sitelib macros are used. OBS-URL: https://build.opensuse.org/request/show/975792 OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint-mini?expand=0&rev=164
This commit is contained in:
parent
05f6a3e470
commit
01e3ec1bc4
@ -1,3 +1,22 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon May 9 09:42:24 UTC 2022 - Ben Greiner <code@bnavigator.de>
|
||||
|
||||
- Use python310 flavor explicitly, irrespective of the primary
|
||||
python3 flavor du jour.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat May 7 23:29:36 UTC 2022 - Ben Greiner <code@bnavigator.de>
|
||||
|
||||
- Migration of primary Python interpreter to 3.10
|
||||
* update stdlib.txt: encoding, importlib, lib-dynload,
|
||||
dataclasses, ast
|
||||
* Remove deprecated stdlib distutils from the venv
|
||||
(not used by rpmlint)
|
||||
* Do not install+delete pip in the venv
|
||||
- Update URL
|
||||
- Explicit BuildRequires: python-rpm-macros -- sitelib macros
|
||||
are used.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Mar 5 10:52:37 UTC 2022 - Martin Liška <mliska@suse.cz>
|
||||
|
||||
|
@ -16,24 +16,40 @@
|
||||
#
|
||||
|
||||
|
||||
# This works regardless of the primary python3 flavor. The stdlib.txt and
|
||||
# install section depend on the python 3.10 layout.
|
||||
%define python_flavor python310
|
||||
%define my_python %{expand:%{__%{python_flavor}}}
|
||||
|
||||
Name: rpmlint-mini
|
||||
Version: %(rpm -q rpmlint --qf '%%{VERSION}')
|
||||
Release: 0
|
||||
Summary: RPM file correctness checker
|
||||
License: GPL-2.0-or-later
|
||||
URL: http://rpmlint.zarb.org/
|
||||
URL: https://github.com/rpm-software-management/rpmlint
|
||||
Source0: desktop-file-utils-0.24.tar.xz
|
||||
Source1: stdlib.txt
|
||||
Source2: rpmlint.wrapper
|
||||
Source3: rpmlint-mini.rpmlintrc
|
||||
# need to fetch the file from there
|
||||
BuildRequires: checkbashisms
|
||||
# the main package rpmlint's python3 runtime requirements do not necessarily match our target flavor
|
||||
BuildRequires: %{python_flavor}-base
|
||||
BuildRequires: %{python_flavor}-magic
|
||||
BuildRequires: %{python_flavor}-pybeam
|
||||
BuildRequires: %{python_flavor}-pyenchant
|
||||
BuildRequires: %{python_flavor}-pyxdg
|
||||
BuildRequires: %{python_flavor}-rpm
|
||||
BuildRequires: %{python_flavor}-toml
|
||||
BuildRequires: %{python_flavor}-xml
|
||||
BuildRequires: %{python_flavor}-zstandard
|
||||
BuildRequires: dash
|
||||
BuildRequires: glib2-devel
|
||||
BuildRequires: glib2-devel-static
|
||||
BuildRequires: libedit-devel
|
||||
BuildRequires: libtool
|
||||
BuildRequires: pkgconfig
|
||||
BuildRequires: python-rpm-macros
|
||||
BuildRequires: rpmlint >= 2
|
||||
#!BuildIgnore: rpmlint-mini
|
||||
Requires: cpio
|
||||
@ -54,15 +70,18 @@ make %{?_smp_mflags} desktop-file-validate V=1 DESKTOP_FILE_UTILS_LIBS="%{_libdi
|
||||
popd
|
||||
|
||||
%install
|
||||
# Check that rpmlint works at all
|
||||
# Check that rpmlint works at all, with the primary flavor
|
||||
set +e
|
||||
%{_bindir}/rpmlint -i rpmlint
|
||||
test $? -gt 0 -a $? -lt 60 && exit 1
|
||||
set -e
|
||||
# Check that we have all required python modules in the target flavor
|
||||
for p in $(rpm -q --requires rpmlint | grep '^python3-'); do
|
||||
rpm -q --whatprovides ${p/python3-/%{python_flavor}-}
|
||||
done
|
||||
# Build a virtual env
|
||||
python3 -m venv %{buildroot}/opt/testing
|
||||
# We don't need pip, or activation
|
||||
%{buildroot}/opt/testing/bin/pip uninstall -y pip
|
||||
%my_python -m venv %{buildroot}/opt/testing --without-pip --copies
|
||||
# We don't need activation
|
||||
rm %{buildroot}/opt/testing/bin/activate*
|
||||
# We need these available
|
||||
cp -a src/desktop-file-validate %{buildroot}/opt/testing/bin
|
||||
@ -74,22 +93,21 @@ cp -a %{_sysconfdir}/xdg/rpmlint %{buildroot}/opt/testing/share
|
||||
# Override configs are selectively taken from rpmlint-strict
|
||||
rm -f %{buildroot}/opt/testing/share/rpmlint/*.override.toml
|
||||
# Python standard library, rpmlint dependencies, and the interpreter
|
||||
pushd %{_libdir}/python%{py3_ver}
|
||||
pushd %{_libdir}/python%{python_version}
|
||||
for file in $(cat %{SOURCE1}); do
|
||||
exp=$(ls -1 $file)
|
||||
install -D -m 644 $exp %{buildroot}/opt/testing/lib/python%{py3_ver}/$exp
|
||||
install -D -m 644 $exp %{buildroot}/opt/testing/lib/python%{python_version}/$exp
|
||||
done
|
||||
popd
|
||||
cp -a %{python_sitearch}/{rpm,zstandard}* %{buildroot}/opt/testing/lib/python%{py3_ver}/site-packages
|
||||
cp -a %{python_sitelib} %{buildroot}/opt/testing/lib/python%{py3_ver}
|
||||
cp -a %{_libdir}/libpython%{py3_ver}*.so.* %{buildroot}/opt/testing/lib
|
||||
cp -a %{python_sitearch}/{rpm,zstandard}* %{buildroot}/opt/testing/lib/python%{python_version}/site-packages
|
||||
cp -a %{python_sitelib} %{buildroot}/opt/testing/lib/python%{python_version}
|
||||
cp -a %{python3_sitelib}/rpmlint* %{buildroot}/opt/testing/lib/python%{python_version}
|
||||
cp -a %{_libdir}/libpython%{python_version}*.so.* %{buildroot}/opt/testing/lib
|
||||
cp -a %{_libdir}/libexpat*.so.* %{buildroot}/opt/testing/lib
|
||||
cp -a %{_libdir}/libmpdec*.so.* %{buildroot}/opt/testing/lib || echo "Skipping libmpdec.so"
|
||||
cp -a %{_bindir}/python3 %{buildroot}/opt/testing/bin
|
||||
cp -a %{_bindir}/python%{py3_ver} %{buildroot}/opt/testing/bin
|
||||
pushd %{buildroot}/opt/testing/lib/python%{py3_ver}/
|
||||
pushd %{buildroot}/opt/testing/lib/python%{python_version}/
|
||||
for f in $(find -name \*.py | sort) ; do
|
||||
PYTHONOPTIMIZE=1 python3 -O -m compileall -b $f
|
||||
PYTHONOPTIMIZE=1 %{my_python} -O -m compileall -b $f
|
||||
rm $f
|
||||
done
|
||||
popd
|
||||
@ -104,6 +122,15 @@ install -m 755 -D %{SOURCE2} %{buildroot}/opt/testing/bin/rpmlint
|
||||
# We don't want to provide any libraries, or Python modules we ship
|
||||
%define __provides_exclude ^(lib|python)
|
||||
|
||||
%check
|
||||
# check rpmlint-mini with the custom flavor
|
||||
sed -e 's|/opt|%{buildroot}/opt|' -e 's|exec|%my_python|' %{buildroot}/opt/testing/bin/rpmlint > myrpmlint
|
||||
chmod +x myrpmlint
|
||||
set +e
|
||||
./myrpmlint -i rpmlint
|
||||
test $? -gt 0 -a $? -lt 60 && exit 1
|
||||
set -e
|
||||
|
||||
%files
|
||||
/opt/testing
|
||||
%license COPYING
|
||||
|
69
stdlib.txt
69
stdlib.txt
@ -9,6 +9,7 @@ _sysconfigdata*.py
|
||||
_weakrefset.py
|
||||
abc.py
|
||||
argparse.py
|
||||
ast.py
|
||||
base64.py
|
||||
bisect.py
|
||||
bz2.py
|
||||
@ -27,60 +28,10 @@ copy.py
|
||||
copyreg.py
|
||||
csv.py
|
||||
cProfile.py
|
||||
dataclasses.py
|
||||
datetime.py
|
||||
decimal.py
|
||||
dis.py
|
||||
distutils/archive_util.py
|
||||
distutils/bcppcompiler.py
|
||||
distutils/ccompiler.py
|
||||
distutils/cmd.py
|
||||
distutils/config.py
|
||||
distutils/core.py
|
||||
distutils/cygwinccompiler.py
|
||||
distutils/debug.py
|
||||
distutils/dep_util.py
|
||||
distutils/dir_util.py
|
||||
distutils/dist.py
|
||||
distutils/errors.py
|
||||
distutils/extension.py
|
||||
distutils/fancy_getopt.py
|
||||
distutils/filelist.py
|
||||
distutils/file_util.py
|
||||
distutils/__init__.py
|
||||
distutils/log.py
|
||||
distutils/msvc9compiler.py
|
||||
distutils/_msvccompiler.py
|
||||
distutils/msvccompiler.py
|
||||
distutils/spawn.py
|
||||
distutils/sysconfig.py
|
||||
distutils/text_file.py
|
||||
distutils/unixccompiler.py
|
||||
distutils/util.py
|
||||
distutils/versionpredicate.py
|
||||
distutils/version.py
|
||||
distutils/command/bdist_dumb.py
|
||||
distutils/command/bdist_msi.py
|
||||
distutils/command/bdist.py
|
||||
distutils/command/bdist_rpm.py
|
||||
distutils/command/bdist_wininst.py
|
||||
distutils/command/build_clib.py
|
||||
distutils/command/build_ext.py
|
||||
distutils/command/build.py
|
||||
distutils/command/build_py.py
|
||||
distutils/command/build_scripts.py
|
||||
distutils/command/check.py
|
||||
distutils/command/clean.py
|
||||
distutils/command/config.py
|
||||
distutils/command/__init__.py
|
||||
distutils/command/install_data.py
|
||||
distutils/command/install_egg_info.py
|
||||
distutils/command/install_headers.py
|
||||
distutils/command/install_lib.py
|
||||
distutils/command/install.py
|
||||
distutils/command/install_scripts.py
|
||||
distutils/command/register.py
|
||||
distutils/command/sdist.py
|
||||
distutils/command/upload.py
|
||||
email/base64mime.py
|
||||
email/charset.py
|
||||
email/contentmanager.py
|
||||
@ -198,7 +149,6 @@ encodings/koi8_u.py
|
||||
encodings/kz1048.py
|
||||
encodings/latin_1.py
|
||||
encodings/mac_arabic.py
|
||||
encodings/mac_centeuro.py
|
||||
encodings/mac_croatian.py
|
||||
encodings/mac_cyrillic.py
|
||||
encodings/mac_farsi.py
|
||||
@ -241,12 +191,22 @@ gettext.py
|
||||
gzip.py
|
||||
hashlib.py
|
||||
heapq.py
|
||||
importlib/_abc.py
|
||||
importlib/abc.py
|
||||
importlib/_adapters.py
|
||||
importlib/_bootstrap_external.py
|
||||
importlib/_bootstrap.py
|
||||
importlib/_common.py
|
||||
importlib/__init__.py
|
||||
importlib/machinery.py
|
||||
importlib/metadata.py
|
||||
importlib/metadata/_adapters.py
|
||||
importlib/metadata/_collections.py
|
||||
importlib/metadata/_functools.py
|
||||
importlib/metadata/__init__.py
|
||||
importlib/metadata/_itertools.py
|
||||
importlib/metadata/_meta.py
|
||||
importlib/metadata/_text.py
|
||||
importlib/readers.py
|
||||
importlib/resources.py
|
||||
importlib/util.py
|
||||
inspect.py
|
||||
@ -287,7 +247,6 @@ lib-dynload/_multibytecodec.cpython*.so
|
||||
lib-dynload/_multiprocessing.cpython*.so
|
||||
lib-dynload/_opcode.cpython*.so
|
||||
lib-dynload/ossaudiodev.cpython*.so
|
||||
lib-dynload/parser.cpython*.so
|
||||
lib-dynload/_pickle.cpython*.so
|
||||
lib-dynload/_posixshmem.cpython*.so
|
||||
lib-dynload/_posixsubprocess.cpython*.so
|
||||
@ -309,9 +268,11 @@ lib-dynload/syslog.cpython*.so
|
||||
lib-dynload/termios.cpython*.so
|
||||
lib-dynload/unicodedata.cpython*.so
|
||||
lib-dynload/_uuid.cpython*.so
|
||||
lib-dynload/xxlimited_35.cpython*.so
|
||||
lib-dynload/_xxsubinterpreters.cpython*.so
|
||||
lib-dynload/_xxtestfuzz.cpython*.so
|
||||
lib-dynload/zlib.cpython*.so
|
||||
lib-dynload/_zoneinfo.cpython*.so
|
||||
linecache.py
|
||||
locale.py
|
||||
logging/config.py
|
||||
|
Loading…
Reference in New Issue
Block a user