%{!?dotests: %define dotests 1} %define name python3-babel %define srcname Babel %define version 2.7.0 %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_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 Summary: Internationalization utilities Name: %{name} Version: %{version} Release: %{release} Source0: %{srcname}-%{version}.tar.gz License: BSD Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} BuildArch: noarch Vendor: Edgewall Software Url: https://pypi.org/ BuildRequires: python3 >= 3.7.3 BuildRequires: python3-devel >= 3.7.3 BuildRequires: python3-pytest >= 5.3.1, python3-py >= 1.8.0, python3-pluggy >= 0.13.0 Requires: python3 >= 3.7.3 Requires: python3-pytz >= 2019.3 #for running test cases pip install freezegun %description A collection of tools for internationalizing Python applications. %prep %setup -q -n %{srcname}-%{version} %build python3 setup.py build if [ "%{dotests}" == 1 ] then python3 -m pytest 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 CHANGES PKG-INFO README.rst LICENSE %doc docs %{python_sitelib}/* %changelog * Thu Nov 7 2019 Baanu Tumma - 2.7.0-1 - Update to latest version, built with python3 * Thu Jul 17 2013 Tristan Delhalle - 0.9.6-1 - first version for AIX V6.1 and higher