%define name python-pyzmq %define srcname pyzmq %define version 16.0.2 %define release 2 # 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/python2.7 && echo 1 || echo 0) %if %{is_python} %define python_sitelib %(/opt/freeware/bin/python2.7 -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/python2.7_64 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(/opt/freeware/bin/python2.7_64 -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/%{version} Source0: https://pypi.python.org/pypi/pyzmq/%{version}/pyzmq-%{version}.tar.gz Prefix: %{_prefix} BuildRequires: python-devel BuildRequires: python-setuptools BuildRequires: zeromq-devel >= 4.3.2-1 BuildRequires: python-pytest BuildRequires: python-tornado 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} # Duplicate source for 32 & 64 bits rm -rf /tmp/%{name}-%{version}-32bit cp -pr . /tmp/%{name}-%{version}-32bit rm -fr * mv /tmp/%{name}-%{version}-32bit 32bit cp -pr 32bit 64bit 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 cd 64bit export OBJECT_MODE=64 /opt/freeware/bin/python2.7_64 setup.py build cd ../32bit export OBJECT_MODE=32 export CC="/usr/vac/bin/xlc_r -q32 -D_LARGE_FILES" /opt/freeware/bin/python setup.py build %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT export OBJECT_MODE=64 cd 64bit /opt/freeware/bin/python2.7_64 setup.py install --skip-build --root ${RPM_BUILD_ROOT} # Move lib to lib64 #mv ${RPM_BUILD_ROOT}%{_libdir} ${RPM_BUILD_ROOT}%{_libdir64} export OBJECT_MODE=64 cd ../32bit /opt/freeware/bin/python2.7 setup.py install --skip-build --root ${RPM_BUILD_ROOT} %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) #%license 32bit/COPYING.* #%doc 32bit/README.md 32bit/examples/ %{python_sitelib}/%{srcname}-*.egg-info %{python_sitelib}/zmq %{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 * Fri Mar 13 2020 Reshma V Kumar - 16.0.2-2 - Rebuild to remove libzmq.so dependency * Wed Nov 08 2017 Ravi Hirekurabar - 2.9.6-2 - Initial port to AIX