%define name python3-pyzmq %define srcname pyzmq %define version 18.1.1 %define release 1 # Tests by default. No tests: rpm -ba --define 'dotests 0' *.spec %{!?dotests: %define dotests 1} # Needs care because default command python may be linked to 32 or 64 bit python # and compiler/loader options are not the same, e.g. -maix32/-maix64 # Also, although # /usr/bin/python_64 eventually links to /opt/freeware/bin/python2.7_64 # /usr/bin/python_32 links to inexistant /opt/freeware/bin/python2_32 # So, use /opt/freeware/bin/python2.7 and /opt/freeware/bin/python2.7_64 %define is_python %(test -e /opt/freeware/bin/python3.7_32 && echo 1 || echo 0) %if %{is_python} %define python_sitelib %(/opt/freeware/bin/python3.7_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.7 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(/opt/freeware/bin/python3.7 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") %endif Name: %{name} Version: %{version} Release: %{release} Summary: General purpose template engine for python2 Group: Development/Languages License: BSD URL: https://pypi.python.org/pypi/pyzmq/16.0.2 Source0: https://pypi.python.org/pypi/pyzmq/16.0.2/pyzmq-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} BuildRequires: python3-devel >= 3.7.4-1 BuildRequires: zeromq-devel >= 4.3.2-1 BuildRequires: python3-pytest >= 5.3.1-1 Requires: zeromq >= 4.3.2-1 %description The 0MQ lightweight messaging kernel is a library which extends the standard socket interfaces with features traditionally provided by specialized messaging middle-ware products. 0MQ sockets provide an abstraction of asynchronous message queues, multiple messaging patterns, message filtering (subscriptions), seamless access to multiple transport protocols and more. This package contains the python bindings. %prep %setup -q -n pyzmq-%{version} export PYTHONPATH=/opt/freeware/lib/python27.zip:/opt/freeware/lib/python2.7:/opt/freeware/lib/python2.7/plat-aix6:/opt/freeware/lib/python2.7/lib-tk:/opt/freeware/lib/python2.7/lib-old:/opt/freeware/lib/python2.7/lib-dynload:/opt/freeware/lib/python2.7/site-packages:/opt/freeware/lib/python2.7/config %build export OBJECT_MODE=64 /opt/freeware/bin/python3.7 setup.py build %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT /opt/freeware/bin/python3.7 setup.py install --skip-build --root ${RPM_BUILD_ROOT} %if %{dotests} %check python3 setup.py build_ext --inplace python3 setup.py test || true %endif %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc COPYING.* %doc README.md examples/ %{python_sitelib64}/%{srcname}-*.egg-info %{python_sitelib64}/zmq #%exclude %{python_sitelib}/zmq/tests #%files -n python-%{srcname}-tests #%defattr(-,root,system,-) #%{python_sitelib}/zmq/tests %changelog * Mon Mar 09 2020 Reshma V Kumar - 18.1.1-1 - Update to latest version - Build with python3 * Wed Nov 08 2017 Ravi Hirekurabar - 2.9.6-2 - Initial port to AIX