%{!?dotests: %define dotests 1} %define name python3-packaging %define srcname packaging %define version 19.2 %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: Core utilities for Python packages Name: %{name} Version: %{version} Release: %{release} Source0: %{srcname}-%{version}.tar.gz License: BSD or ASL 2.0 Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} BuildArch: noarch Vendor: Benjamin Peterson Url: https://pypi.org/ Requires: python3-pyparsing >= 2.4.4 Requires: python3-six >= 1.12.0 %description python-packaging provides core utilities for Python packages like utilities for dealing with versions, specifiers, markers etc. %prep %setup -q -n %{srcname}-%{version} %build python3 setup.py build if [ "%{dotests}" == 1 ] then (python3 -m pytest tests/ || true) 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.APACHE LICENSE.BSD LICENSE PKG-INFO README.rst CHANGELOG.rst CONTRIBUTING.rst %{python_sitelib}/* %{python_sitelib}/packaging-%{version}-py?.?.egg-info %changelog * Wed Nov 6 2019 Baanu Tumma - 19.2-1 - First version built with python3