%global __tar /opt/freeware/bin/tar %bcond_without dotests #%define is_python %(test -e /opt/freeware/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 /opt/freeware/bin/python3_64 && 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 Name: python-charset-normalizer Version: 2.0.12 Release: 1 Summary: The Real First Universal Charset Detector License: MIT URL: https://pypi.org/ Source0: charset-normalizer-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel >= 3.7.11 #BuildRequires: pyproject-rpm-macros #BuildRequires: python3dist(pytest) %description A library that helps you read text from an unknown charset encoding. Motivated by chardet, trying to resolve the issue by taking a new approach. All IANA character set names for which the Python core library provides codecs are supported. %package -n python3-charset-normalizer Summary: %{summary} %description -n python3-charset-normalizer A library that helps you read text from an unknown charset encoding. Motivated by chardet, trying to resolve the issue by taking a new approach. All IANA character set names for which the Python core library provides codecs are supported. %prep %autosetup -n charset-normalizer-%{version} # Remove pytest-cov settings from setup.cfg sed -i "/addopts = --cov/d" setup.cfg %build export PATH=/opt/freeware/bin:$PATH python3 setup.py build %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} python3 setup.py install --root %{buildroot} %check %if %{with dotests} python3 -m venv python_venv . ./python_venv/bin/activate pip3 install pytest pip3 install hypothesis #ulimit -d unlimited #ulimit -n unlimited ulimit -m unlimited #ulimit -f unlimited ( python runtests.py -m 'full' -v || true ) deactivate %endif %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files -n python3-charset-normalizer %license LICENSE %doc README.md %{_bindir}/normalizer %{python_sitelib}/charset_normalizer %{python_sitelib}/*.egg-info/ %changelog * Tue Apr 05 2022 Rakshitha N - 2.0.12 - First Build