Thomas Spura ce1e63a
%if 0%{?fedora} > 12
36179bc
%global with_python3 1
36179bc
%endif
36179bc
Thomas Spura 2cdb52e
# el5 has python-2.4, but 2.5 is minimum, so build with python2.6:
Thomas Spura 2cdb52e
# http://lists.zeromq.org/pipermail/zeromq-dev/2010-November/007597.html
Thomas Spura 2cdb52e
%if ! ( 0%{?fedora} > 12 || 0%{?rhel} > 5)
Seth House c6fbbf5
%global pybasever 2.6
Seth House c6fbbf5
%global __python_ver 26
Seth House c6fbbf5
%global __python %{_bindir}/python%{?pybasever}
Thomas Spura 2cdb52e
%global python python26
Seth House c6fbbf5
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
Seth House c6fbbf5
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
Thomas Spura 2cdb52e
%else
a0075ca
%{?filter_setup:
a0075ca
%filter_provides_in %{python_sitearch}/.*\.so$
Thomas Spura ce1e63a
%if 0%{?fedora} > 12
Thomas Spura 6d9942d
%filter_provides_in %{python3_sitearch}/.*\.so$
Thomas Spura 6d9942d
%endif
a0075ca
%filter_setup
a0075ca
}
Thomas Spura 2cdb52e
%endif
36179bc
36179bc
%global checkout 18f5d061558a176f5496aa8e049182c1a7da64f6
36179bc
36179bc
%global srcname pyzmq
36179bc
48bbb9f
%global run_tests 1
bc2b5f7
Thomas Spura 2cdb52e
Name:           python-zmq
Thomas Spura ce1e63a
Version:        14.3.1
Thomas Spura ce1e63a
Release:        1%{?dist}
36179bc
Summary:        Software library for fast, message-based applications
36179bc
36179bc
Group:          Development/Libraries
Thomas Spura ce1e63a
License:        LGPLv3+ and ASL 2.0 and BSD
36179bc
URL:            http://www.zeromq.org/bindings:python
36179bc
# VCS:          git:http://github.com/zeromq/pyzmq.git
36179bc
# git checkout with the commands:
36179bc
# git clone http://github.com/zeromq/pyzmq.git pyzmq.git
36179bc
# cd pyzmq.git
36179bc
# git archive --format=tar --prefix=pyzmq-%%{version}/ %%{checkout} | xz -z --force - > pyzmq-%%{version}.tar.xz
Thomas Spura ce1e63a
Source0:        https://pypi.python.org/packages/source/p/pyzmq/pyzmq-%{version}.tar.gz
36179bc
Seth House c6fbbf5
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
36179bc
Thomas Spura ce1e63a
BuildRequires:  chrpath
Thomas Spura ce1e63a
Thomas Spura 2cdb52e
%if ! ( 0%{?fedora} > 12 || 0%{?rhel} > 5)
Seth House c6fbbf5
BuildRequires:  python26-devel
Seth House c6fbbf5
BuildRequires:  python26-distribute
Seth House c6fbbf5
BuildRequires:  python26-nose
Seth House c6fbbf5
%else
36179bc
BuildRequires:  python2-devel
36179bc
BuildRequires:  python-setuptools
36179bc
BuildRequires:  python-nose
Seth House c6fbbf5
%endif
36179bc
Thomas Spura 2cdb52e
BuildRequires:  zeromq-devel
Thomas Spura 2cdb52e
36179bc
%if 0%{?with_python3}
36179bc
BuildRequires:  python3-devel
36179bc
BuildRequires:  python3-setuptools
36179bc
# needed for 2to3
36179bc
BuildRequires:  python-tools
Thomas Spura 9c45c1e
BuildRequires:  python3-nose
36179bc
%endif
36179bc
Thomas Spura 2cdb52e
36179bc
%description
36179bc
The 0MQ lightweight messaging kernel is a library which extends the
36179bc
standard socket interfaces with features traditionally provided by
36179bc
specialized messaging middle-ware products. 0MQ sockets provide an
36179bc
abstraction of asynchronous message queues, multiple messaging
36179bc
patterns, message filtering (subscriptions), seamless access to
36179bc
multiple transport protocols and more.
36179bc
36179bc
This package contains the python bindings.
36179bc
36179bc
Thomas Spura 2cdb52e
%if ! ( 0%{?fedora} > 12 || 0%{?rhel} > 5)
Thomas Spura 2cdb52e
%package -n python26-zmq
Thomas Spura 2cdb52e
Summary:        Software library for fast, message-based applications
Thomas Spura 2cdb52e
Group:          Development/Libraries
Thomas Spura 2cdb52e
License:        LGPLv3+
Thomas Spura 2cdb52e
%description -n python26-zmq
Thomas Spura 2cdb52e
The 0MQ lightweight messaging kernel is a library which extends the
Thomas Spura 2cdb52e
standard socket interfaces with features traditionally provided by
Thomas Spura 2cdb52e
specialized messaging middle-ware products. 0MQ sockets provide an
Thomas Spura 2cdb52e
abstraction of asynchronous message queues, multiple messaging
Thomas Spura 2cdb52e
patterns, message filtering (subscriptions), seamless access to
Thomas Spura 2cdb52e
multiple transport protocols and more.
Thomas Spura 2cdb52e
Thomas Spura 2cdb52e
This package contains the python bindings for python26.
Thomas Spura 2cdb52e
%endif
Thomas Spura 2cdb52e
Thomas Spura 2cdb52e
Thomas Spura 2cdb52e
%if ! ( 0%{?fedora} > 12 || 0%{?rhel} > 5)
Thomas Spura 2cdb52e
%package -n python26-zmq-tests
Thomas Spura 2cdb52e
%else
Thomas Spura 0b1941e
%package tests
Thomas Spura 2cdb52e
%endif
Thomas Spura 0b1941e
Summary:        Software library for fast, message-based applications
Thomas Spura 0b1941e
Group:          Development/Libraries
Thomas Spura 0b1941e
License:        LGPLv3+
Thomas Spura 2cdb52e
%if ! ( 0%{?fedora} > 12 || 0%{?rhel} > 5)
Thomas Spura 3c3aef6
Requires:       python26-zmq = %{version}-%{release}
Thomas Spura 2cdb52e
%description -n python26-zmq-tests
Thomas Spura 2cdb52e
%else
Thomas Spura 6d9942d
Requires:       python-zmq = %{version}-%{release}
Thomas Spura 0b1941e
%description tests
Thomas Spura 2cdb52e
%endif
Thomas Spura 0b1941e
The 0MQ lightweight messaging kernel is a library which extends the
Thomas Spura 0b1941e
standard socket interfaces with features traditionally provided by
Thomas Spura 0b1941e
specialized messaging middle-ware products. 0MQ sockets provide an
Thomas Spura 0b1941e
abstraction of asynchronous message queues, multiple messaging
Thomas Spura 0b1941e
patterns, message filtering (subscriptions), seamless access to
Thomas Spura 0b1941e
multiple transport protocols and more.
Thomas Spura 0b1941e
Thomas Spura 0b1941e
This package contains the testsuite for the python bindings.
Thomas Spura 0b1941e
Thomas Spura 0b1941e
36179bc
%if 0%{?with_python3}
36179bc
%package -n python3-zmq
36179bc
Summary:        Software library for fast, message-based applications
36179bc
Group:          Development/Libraries
36179bc
License:        LGPLv3+
36179bc
%description -n python3-zmq
36179bc
The 0MQ lightweight messaging kernel is a library which extends the
36179bc
standard socket interfaces with features traditionally provided by
36179bc
specialized messaging middle-ware products. 0MQ sockets provide an
36179bc
abstraction of asynchronous message queues, multiple messaging
36179bc
patterns, message filtering (subscriptions), seamless access to
36179bc
multiple transport protocols and more.
36179bc
36179bc
This package contains the python bindings.
Thomas Spura 0b1941e
Thomas Spura 0b1941e
Thomas Spura 0b1941e
%package -n python3-zmq-tests
Thomas Spura 0b1941e
Summary:        Software library for fast, message-based applications
Thomas Spura 0b1941e
Group:          Development/Libraries
Thomas Spura 0b1941e
License:        LGPLv3+
Thomas Spura 6d9942d
Requires:       python3-zmq = %{version}-%{release}
Thomas Spura 0b1941e
%description -n python3-zmq-tests
Thomas Spura 0b1941e
The 0MQ lightweight messaging kernel is a library which extends the
Thomas Spura 0b1941e
standard socket interfaces with features traditionally provided by
Thomas Spura 0b1941e
specialized messaging middle-ware products. 0MQ sockets provide an
Thomas Spura 0b1941e
abstraction of asynchronous message queues, multiple messaging
Thomas Spura 0b1941e
patterns, message filtering (subscriptions), seamless access to
Thomas Spura 0b1941e
multiple transport protocols and more.
Thomas Spura 0b1941e
Thomas Spura 0b1941e
This package contains the testsuite for the python bindings.
Thomas Spura 0b1941e
36179bc
%endif
36179bc
36179bc
36179bc
%prep
36179bc
%setup -q -n %{srcname}-%{version}
Thomas Spura ce1e63a
Thomas Spura ce1e63a
# remove bundled libraries
Thomas Spura ce1e63a
rm -rf bundled
Thomas Spura ce1e63a
36179bc
# remove shebangs
36179bc
for lib in zmq/eventloop/*.py; do
36179bc
    sed '/\/usr\/bin\/env/d' $lib > $lib.new &&
36179bc
    touch -r $lib $lib.new &&
36179bc
    mv $lib.new $lib
36179bc
done
36179bc
36179bc
# remove excecutable bits
36179bc
chmod -x examples/pubsub/topics_pub.py
36179bc
chmod -x examples/pubsub/topics_sub.py
36179bc
342c17d
# delete hidden files
a0075ca
#find examples -name '.*' | xargs rm -v
a0075ca
342c17d
36179bc
%if 0%{?with_python3}
36179bc
rm -rf %{py3dir}
36179bc
cp -a . %{py3dir}
36179bc
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
36179bc
rm -r %{py3dir}/examples
Thomas Spura ce1e63a
2to3 --write --nobackups %{py3dir}/zmq/green
a0075ca
36179bc
%endif
36179bc
36179bc
36179bc
%build
36179bc
CFLAGS="%{optflags}" %{__python} setupegg.py build
36179bc
36179bc
%if 0%{?with_python3}
36179bc
pushd %{py3dir}
d57ff9e
CFLAGS="%{optflags}" %{__python3} setup.py build
36179bc
popd
36179bc
%endif # with_python3
36179bc
36179bc
36179bc
36179bc
%install
Thomas Spura ce1e63a
%global RPATH /zmq/{backend/cython,devices}
36179bc
# Must do the python3 install first because the scripts in /usr/bin are
36179bc
# overwritten with every setup.py install (and we want the python2 version
36179bc
# to be the default for now).
36179bc
%if 0%{?with_python3}
36179bc
pushd %{py3dir}
Thomas Spura 4155cf5
%{__python3} setup.py install --skip-build --root %{buildroot}
36179bc
36179bc
popd
Thomas Spura ce1e63a
chrpath --delete %{buildroot}%{python3_sitearch}%{RPATH}/*.so
36179bc
%endif # with_python3
36179bc
36179bc
36179bc
%{__python} setupegg.py install -O1 --skip-build --root %{buildroot}
36179bc
Thomas Spura ce1e63a
chrpath --delete %{buildroot}%{python_sitearch}%{RPATH}/*.so
36179bc
36179bc
36179bc
%check
bc2b5f7
%if 0%{?run_tests}
bc2b5f7
    rm zmq/__*
Thomas Spura ce1e63a
    cd %{buildroot}%{python_sitearch}
bc2b5f7
    PYTHONPATH=%{buildroot}%{python_sitearch} \
Thomas Spura c784a47
        %{_bindir}/nosetests-2.6 -v zmq.tests
36179bc
bc2b5f7
    %if 0%{?with_python3}
bc2b5f7
    # there is no python3-nose yet
bc2b5f7
    pushd %{py3dir}
36179bc
    rm zmq/__*
Thomas Spura 9c45c1e
    PYTHONPATH=%{buildroot}%{python3_sitearch} \
Thomas Spura 9c45c1e
        %{__python3} setup.py test
bc2b5f7
    popd
bc2b5f7
    %endif
36179bc
%endif
36179bc
36179bc
Thomas Spura 2cdb52e
%if ! ( 0%{?fedora} > 12 || 0%{?rhel} > 5)
Thomas Spura 2cdb52e
%files -n python26-zmq
Thomas Spura 2cdb52e
%else
36179bc
%files
Thomas Spura 2cdb52e
%endif
36179bc
%defattr(-,root,root,-)
Thomas Spura ce1e63a
%doc README.md COPYING.* examples/
36179bc
%{python_sitearch}/%{srcname}-*.egg-info
36179bc
%{python_sitearch}/zmq
Thomas Spura 63e7506
%exclude %{python_sitearch}/zmq/tests
36179bc
Thomas Spura 2cdb52e
%if ! ( 0%{?fedora} > 12 || 0%{?rhel} > 5)
Thomas Spura 2cdb52e
%files -n python26-zmq-tests
Thomas Spura 2cdb52e
%else
Thomas Spura 0b1941e
%files tests
Thomas Spura 2cdb52e
%endif
Thomas Spura 0b1941e
%defattr(-,root,root,-)
Thomas Spura 0b1941e
%{python_sitearch}/zmq/tests
36179bc
36179bc
%if 0%{?with_python3}
36179bc
%files -n python3-zmq
36179bc
%defattr(-,root,root,-)
Thomas Spura ce1e63a
%doc README.md COPYING.* examples/
36179bc
# examples/
36179bc
%{python3_sitearch}/%{srcname}-*.egg-info
36179bc
%{python3_sitearch}/zmq
Thomas Spura 63e7506
%exclude %{python3_sitearch}/zmq/tests
Thomas Spura 0b1941e
Thomas Spura 0b1941e
%files -n python3-zmq-tests
Thomas Spura 0b1941e
%defattr(-,root,root,-)
Thomas Spura 0b1941e
%{python3_sitearch}/zmq/tests
36179bc
%endif
36179bc
36179bc
36179bc
%changelog
Thomas Spura ce1e63a
* Fri Aug 29 2014 Thomas Spura <tomspur@fedoraproject.org> - 14.3.1-1
Thomas Spura ce1e63a
- update to 14.3.1 (#1134571)
Thomas Spura ce1e63a
Thomas Spura 6d9942d
* Wed Dec 14 2011 Thomas Spura <tomspur@fedoraproject.org> - 2.1.9-3
Thomas Spura 6d9942d
- tests package requires main package
Thomas Spura 651b9cb
- filter python3
Thomas Spura 6d9942d
Thomas Spura 2cdb52e
* Thu Dec  8 2011 Thomas Spura <tomspur@fedoraproject.org> - 2.1.9-2
Thomas Spura 2cdb52e
- use proper buildroot macro
Thomas Spura 2cdb52e
- use python2.6 on el5 and below (only build intended for el5)
Thomas Spura 2cdb52e
- build python26-zmq and ignore python-zmq packages on el5
Thomas Spura 63e7506
- don't include tests twice
Thomas Spura 2cdb52e
Thomas Spura 9c45c1e
* Wed Sep 21 2011 Thomas Spura <tomspur@fedoraproject.org> - 2.1.9-1
Thomas Spura 9c45c1e
- update to new version
Thomas Spura 9c45c1e
- run testsuite on python3
Thomas Spura 9c45c1e
Thomas Spura 0b1941e
* Sun Jul 31 2011 Thomas Spura <tomspur@fedoraproject.org> - 2.1.4-2
Thomas Spura 0b1941e
- don't delete the tests, needed by ipython-tests on runtime
Thomas Spura 0b1941e
- don't use _sourcedir macro
Thomas Spura 0b1941e
48bbb9f
* Wed Apr  6 2011 Thomas Spura <tomspur@fedoraproject.org> - 2.1.4-1
48bbb9f
- update to new version (#690199)
48bbb9f
bc2b5f7
* Wed Mar 23 2011 Thomas Spura <tomspur@fedoraproject.org> - 2.1.1-1
bc2b5f7
- update to new version (#682201)
bc2b5f7
b9823d1
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.10.1-2
b9823d1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
b9823d1
d57ff9e
* Sun Jan 30 2011 Thomas Spura <tomspur@fedoraproject.org> - 2.0.10.1-1
d57ff9e
- update to new version (fixes memory leak)
d57ff9e
- no need to run 2to3 on python3 subpackage
d57ff9e
a0075ca
* Thu Jan 13 2011 Thomas Spura <tomspur@fedoraproject.org> - 2.0.10-1
a0075ca
- update to new version
a0075ca
- remove patch (is upstream)
a0075ca
- run tests differently
a0075ca
9454fd3
* Wed Dec 29 2010 David Malcolm <dmalcolm@redhat.com> - 2.0.8-2
9454fd3
- rebuild for newer python3
9454fd3
342c17d
* Thu Sep 23 2010 Thomas Spura <tomspur@fedoraproject.org> - 2.0.8-1
342c17d
- update to new version to be comply with zeromp
342c17d
5f758c2
* Sun Aug 22 2010 Thomas Spura <tomspur@fedoraproject.org> - 0.1.20100725git18f5d06-4
5f758c2
- rebuild with python3.2
5f758c2
  http://lists.fedoraproject.org/pipermail/devel/2010-August/141368.html
5f758c2
36179bc
* Thu Aug  5 2010 Thomas Spura <tomspur@fedoraproject.org> - 0.1.20100725git18f5d06-3
36179bc
- add missing BR for 2to3
36179bc
36179bc
* Tue Aug  3 2010 Thomas Spura <tomspur@fedoraproject.org> - 0.1.20100725git18f5d06-2
36179bc
- build python3 subpackage
36179bc
- rename to from pyzmq to python-zmq
36179bc
- change license
36179bc
36179bc
* Sun Jul 25 2010 Thomas Spura <tomspur@fedoraproject.org> - 0.1.20100725git18f5d06-1
36179bc
- renew git snapshot
36179bc
- start from version 0.1 like upstream (not the version from zeromq)
36179bc
- remove buildroot / %%clean
36179bc
36179bc
* Sat Jun 12 2010 Thomas Spura 
36179bc
- initial package (based on upstreams example one)