summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--0001-Disable-epgm-test.patch60
-rw-r--r--python-txzmq.spec120
2 files changed, 180 insertions, 0 deletions
diff --git a/0001-Disable-epgm-test.patch b/0001-Disable-epgm-test.patch
new file mode 100644
index 0000000..69bdc85
--- /dev/null
+++ b/0001-Disable-epgm-test.patch
@@ -0,0 +1,60 @@
+From b9cc1b4832f4ebdc644a5aa2cf02e4ac40c56451 Mon Sep 17 00:00:00 2001
+From: Ralph Bean <rbean@redhat.com>
+Date: Tue, 28 Jan 2014 16:18:17 -0500
+Subject: [PATCH] Disable epgm test
+
+---
+ txzmq/test/test_pubsub.py | 26 --------------------------
+ 1 file changed, 26 deletions(-)
+
+diff --git a/txzmq/test/test_pubsub.py b/txzmq/test/test_pubsub.py
+index 86a0238..f2fb12e 100644
+--- a/txzmq/test/test_pubsub.py
++++ b/txzmq/test/test_pubsub.py
+@@ -19,21 +19,6 @@ class ZmqTestSubConnection(ZmqSubConnection):
+ self.messages.append([tag, message])
+
+
+-def _detect_epgm():
+- """
+- Utility function to test for presence of epgm:// in zeromq.
+- """
+- import zmq
+-
+- context = zmq.Context()
+- socket = zmq.Socket(context, zmq.constants.PUB)
+-
+- try:
+- socket.bind("epgm://127.0.0.1;239.192.1.1:5557")
+-
+- return True
+- except ZMQError:
+- return False
+
+
+ class ZmqConnectionTestCase(unittest.TestCase):
+@@ -81,14 +66,6 @@ class ZmqConnectionTestCase(unittest.TestCase):
+ return _wait(0.01).addCallback(publish) \
+ .addCallback(lambda _: _wait(0.01)).addCallback(check)
+
+- def test_send_recv_pgm(self):
+- r = ZmqTestSubConnection(self.factory, ZmqEndpoint(
+- ZmqEndpointType.bind, "epgm://127.0.0.1;239.192.1.1:5556"))
+-
+- s = ZmqPubConnection(self.factory, ZmqEndpoint(
+- ZmqEndpointType.connect, "epgm://127.0.0.1;239.192.1.1:5556"))
+-
+- r.subscribe('tag')
+
+ def publish(ignore):
+ s.publish('xyz', 'different-tag')
+@@ -130,6 +107,3 @@ class ZmqConnectionTestCase(unittest.TestCase):
+
+ return _wait(0.1).addCallback(publish) \
+ .addCallback(lambda _: _wait(0.1)).addCallback(check)
+-
+- if not _detect_epgm():
+- test_send_recv_pgm.skip = "epgm:// not available"
+--
+1.8.5.3
+
diff --git a/python-txzmq.spec b/python-txzmq.spec
new file mode 100644
index 0000000..793e867
--- /dev/null
+++ b/python-txzmq.spec
@@ -0,0 +1,120 @@
+#
+# Conditional build:
+%bcond_without tests # do not perform "make test"
+%bcond_without python2 # CPython 2.x module
+%bcond_with python3 # CPython 3.x module
+
+%define module txZMQ
+Summary: Twisted bindings for ZeroMQ
+Name: python-txzmq
+Version: 0.7.3
+Release: 1
+License: GPL v2
+Group: Development/Languages
+Source0: http://pypi.python.org/packages/source/t/%{module}/%{module}-%{version}.tar.gz
+# Source0-md5: 8064422e590f859bf9c5aedf94af5a5c
+URL: http://pypi.python.org/pypi/txZMQ
+Patch0: 0001-Disable-epgm-test.patch
+BuildRequires: rpm-pythonprov
+%if %{with python2}
+BuildRequires: python-TwistedCore
+BuildRequires: python-devel
+BuildRequires: python-nose
+BuildRequires: python-setuptools
+BuildRequires: python-six
+BuildRequires: python-zmq >= 13.0.0
+%endif
+Requires: python-TwistedCore >= 10.0
+Requires: python-six
+Requires: python-zmq >= 13.0.0
+%if %{with python3}
+BuildRequires: python3-devel
+BuildRequires: python3-nose
+BuildRequires: python3-setuptools
+BuildRequires: python3-six
+BuildRequires: python3-twisted-core
+BuildRequires: python3-zmq >= 13.0.0
+%endif
+BuildArch: noarch
+
+%description
+txZMQ allows to integrate easily ZeroMQ sockets into Twisted event
+loop (reactor).
+
+%package -n python3-txzmq
+Summary: Twisted bindings for ZeroMQ
+Group: Development/Languages
+Requires: python3-six
+Requires: python3-twisted-core
+Requires: python3-zmq >= 13.0.0
+
+%description -n python3-txzmq
+txZMQ allows to integrate easily ZeroMQ sockets into Twisted event
+loop (reactor).
+
+%prep
+%setup -q -n %{module}-%{version}
+%patch0 -p1
+
+# getting this error with python-setuptools and python-distribute: http://stackoverflow.com/q/8295644
+%{__sed} -i -e '/install_requires/d' setup.py
+
+%build
+%if %{with python2}
+%{__python} setup.py build --build-base build-2
+%endif
+
+%if %{with python3}
+%{__python3} setup.py build --build-base build-3
+%endif
+
+%if %{with tests}
+PYTHONPATH=$(pwd) nosetests-%{py_ver}
+
+%if %{with python3}
+PYTHONPATH=$(pwd) nosetests-%{py3_ver}
+%endif
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%if %{with python2}
+%{__python} setup.py \
+ build --build-base build-2 \
+ install --skip-build \
+ --optimize=2 \
+ --root=$RPM_BUILD_ROOT
+
+%{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/txzmq/test
+
+%py_postclean
+%endif
+
+%if %{with python3}
+%{__python3} setup.py \
+ build --build-base build-3 \
+ install --skip-build \
+ --optimize=2 \
+ --root=$RPM_BUILD_ROOT
+
+%{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/txzmq/test
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%files
+%defattr(644,root,root,755)
+%doc README.rst LICENSE.txt
+%{py_sitescriptdir}/txzmq
+%{py_sitescriptdir}/txZMQ-%{version}-py*.egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-txzmq
+%defattr(644,root,root,755)
+%doc README.rst LICENSE.txt
+%{py3_sitescriptdir}/txzmq
+%{py3_sitescriptdir}/txZMQ-%{version}*.egg-info
+%endif