%{!?dotests: %define dotests 1} %define name python3-importlib-metadata %define srcname importlib_metadata %define version 0.23 %define release 1 %define is_python %(test -e /usr/bin/python3_32 && echo 1 || echo 0) %if %{is_python} %define python_sitelib %(python3_32 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") %endif %define _libdir64 %{_prefix}/lib64 %define is_python_64 %(test -e /usr/bin/python3 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") %endif Summary: Read metadata from Python packages Name: %{name} Version: %{version} Release: %{release} Source0: %{srcname}-%{version}.tar.gz Url: https://pypi.org/project/importlib-metadata/ License: ASL 2.0 Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} BuildArch: noarch BuildRequires: python3 >= 3.7.3 BuildRequires: python3-devel >= 3.7.3 BuildRequires: python3-packaging >= 19.2 BuildRequires: python3-pyparsing >= 2.4.4 BuildRequires: python3-six >= 1.12.0 Requires: python3 >= 3.7.3 Requires: python3-zipp >= 0.6.0 %description importlib_metadata is a library which provides an API for accessing an installed package’s metadata, such as its entry points or its top-level name. This functionality intends to replace most uses of pkg_resources entry point API and metadata API. Along with importlib.resources in Python 3.7 and newer (backported as importlib_resources for older versions of Python), this can eliminate the need to use the older and less efficient pkg_resources package. %prep %setup -q -n %{srcname}-%{version} %build export OBJECT_MODE=64 python3 setup.py build if [ "%{dotests}" == 1 ] then ( python3 setup.py test ) fi %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT python3 setup.py install --skip-build --root ${RPM_BUILD_ROOT} %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc LICENSE README.rst %{python_sitelib}/* %changelog * Wed Nov 06 2019 Reshma V Kumar -0.23-1 - Initial port for AIX Toolbox - Build with python3