%{!?dotests: %define dotests 1} %define name python3-cffi %define srcname cffi %define version 1.13.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 /opt/freeware/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: C parser and AST generator written in Python 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: ppc Url: https://pypi.org/ Requires: python3 >= 3.7.3-1 Requires: python3-pycparser >= 2.19-1 Requires: libffi >= 3.2.1-3 BuildRequires: libffi-devel >= 3.2.1-1 BuildRequires: python3-sphinx >= 2.3.0-1 BuildRequires: python3-pytest >= 5.3.1-1, python3-py >= 1.8.0, python3-pluggy >= 0.13.0 BuildRequires: python3-pycparser >= 2.19-1 %description C Foreign Function Interface for Python. Interact with almost any C code from Python, based on C-like declarations that you can often copy-paste from header files or documentation. %prep %setup -q -n %{srcname}-%{version} %build export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib" 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}" == 1 ] then (PYTHONPATH=%{buildroot}%{python_sitelib64} python3 -m pytest c/ testing/ || true) fi %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc LICENSE PKG-INFO README.md %{python_sitelib64}/* %changelog *Mon Nov 25 2019 Baanu Tumma - 1.13.2-1 - First version for AIX, built using python3