%{!?dotests: %define dotests 1} %define name python3-pytz %define srcname pytz %define version 2019.3 %define release 1 %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 /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: Python package with an object-oriented approach to text processing Name: %{name} Version: %{version} Release: %{release} Source0: %{srcname}-%{version}.tar.gz License: MIT Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} BuildArch: noarch Vendor: Benjamin Peterson Url: https://pypi.org/ BuildRequires: python3 >= 3.7.3, python3-pytest >= 5.3.1, python3-py >= 1.8.0, python3-pluggy >= 0.13.0 %description pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher. It also solves the issue of ambiguous times at the end of daylight saving time, which you can read more about in the Python Library Reference %prep %setup -q -n %{srcname}-%{version} %build python3 setup.py build if [ "%{dotests}" == 1 ] then PYTHONPATH=%{buildroot}%{python_sitelib} python3 -m pytest -v 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.txt PKG-INFO README.txt %{python_sitelib}/* %changelog * Sat Nov 23 2019 Baanu Tumma - 2019.3-1 - First version built with python3