%global __tar /opt/freeware/bin/tar %define name python3-setuptools-rust %define srcname setuptools-rust %define version 0.12.1 %define release 1 %define is_python %(test -e /opt/freeware/bin/python3_32 && echo 1 || echo 0) %if %{is_python} %define python_sitelib %(/opt/freeware/bin/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 %(/opt/freeware/bin/python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif Summary: YAML parser and emitter for Python Name: %{name} Version: %{version} Release: %{release} Source0: %{srcname}-%{version}.tar.gz Url: https://pypi.org/project/setuptools-rust License: MIT Group: Development/Libraries Prefix: %{_prefix} BuildRequires: python3 >= 3.7.9 BuildRequires: python3-devel >= 3.7.9 Provides: python3-setuptools-rust = %{version}-%{release} %description setuptools-rust is a plugin for setuptools to build Rust Python extensions implemented with PyO3 or rust-cpython. Compile and distribute Python extensions written in Rust as easily as if they were written in C. %prep %setup -q -n %{srcname}-%{version} %build /opt/freeware/bin/python3 setup.py build %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT /opt/freeware/bin/python3 setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT} %check python3 setup.py test %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc LICENSE PKG-INFO examples %{python_sitelib}/* %changelog * Thu Nov 04 2021 Rishita Saha - 0.12.1-1 - Initial port to AIX Toolbox