#To run testcases, zope.interface is required. Install it using the following command # python3 -m pip install zope.interface %{!?dotests: %define dotests 1} %define name python3-attrs %define srcname attrs %define version 19.3.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 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(python3_64 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") %endif Summary: Python attributes without boilerplate Name: %{name} Version: %{version} Release: %{release} Source0: %{srcname}-%{version}.tar.gz Url: https://pypi.org/project/attrs/ License: MIT Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot BuildArch: noarch Prefix: %{_prefix} BuildRequires: python3 >= 3.7.4-1 BuildRequires: python3-devel >= 3.7.4-1 BuildRequires: python3-hypothesis >= 4.47.4-1 BuildRequires: python3-pytest >= 5.3.1-1 Requires: python3 >= 3.7.4-1 %description attrs is an MIT-licensed Python package with class decorators that ease the chores of implementing the most common attribute-related object protocols. %prep %setup -q -n %{srcname}-%{version} %build export OBJECT_MODE=64 python3 setup.py build %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT python3 setup.py install --skip-build --root ${RPM_BUILD_ROOT} %if %{dotests} %check PYTHONPATH=%{buildroot}/%{python_sitelib} py.test-3 -v %endif %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc LICENSE README.rst AUTHORS.rst %{python_sitelib}/* %changelog * Mon Jan 07 2020 Reshma V Kumar - 19.3.0-1 - Initial build for AIX Toolbox - Build with python3