]>
Commit | Line | Data |
---|---|---|
6b0fdbcb ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_with python3 # CPython 3.x module | |
6 | ||
7 | %define module txZMQ | |
8 | Summary: Twisted bindings for ZeroMQ | |
9 | Name: python-txzmq | |
10 | Version: 0.7.3 | |
4488988a | 11 | Release: 2 |
6b0fdbcb ER |
12 | License: GPL v2 |
13 | Group: Development/Languages | |
14 | Source0: http://pypi.python.org/packages/source/t/%{module}/%{module}-%{version}.tar.gz | |
15 | # Source0-md5: 8064422e590f859bf9c5aedf94af5a5c | |
16 | URL: http://pypi.python.org/pypi/txZMQ | |
17 | Patch0: 0001-Disable-epgm-test.patch | |
18 | BuildRequires: rpm-pythonprov | |
19 | %if %{with python2} | |
20 | BuildRequires: python-TwistedCore | |
21 | BuildRequires: python-devel | |
22 | BuildRequires: python-nose | |
23 | BuildRequires: python-setuptools | |
24 | BuildRequires: python-six | |
25 | BuildRequires: python-zmq >= 13.0.0 | |
26 | %endif | |
27 | Requires: python-TwistedCore >= 10.0 | |
28 | Requires: python-six | |
29 | Requires: python-zmq >= 13.0.0 | |
30 | %if %{with python3} | |
31 | BuildRequires: python3-devel | |
32 | BuildRequires: python3-nose | |
33 | BuildRequires: python3-setuptools | |
34 | BuildRequires: python3-six | |
35 | BuildRequires: python3-twisted-core | |
36 | BuildRequires: python3-zmq >= 13.0.0 | |
37 | %endif | |
38 | BuildArch: noarch | |
39 | ||
40 | %description | |
41 | txZMQ allows to integrate easily ZeroMQ sockets into Twisted event | |
42 | loop (reactor). | |
43 | ||
44 | %package -n python3-txzmq | |
45 | Summary: Twisted bindings for ZeroMQ | |
46 | Group: Development/Languages | |
47 | Requires: python3-six | |
48 | Requires: python3-twisted-core | |
49 | Requires: python3-zmq >= 13.0.0 | |
50 | ||
51 | %description -n python3-txzmq | |
52 | txZMQ allows to integrate easily ZeroMQ sockets into Twisted event | |
53 | loop (reactor). | |
54 | ||
55 | %prep | |
56 | %setup -q -n %{module}-%{version} | |
57 | %patch0 -p1 | |
58 | ||
59 | # getting this error with python-setuptools and python-distribute: http://stackoverflow.com/q/8295644 | |
60 | %{__sed} -i -e '/install_requires/d' setup.py | |
61 | ||
62 | %build | |
63 | %if %{with python2} | |
e09ebd22 | 64 | %py_build |
6b0fdbcb ER |
65 | %endif |
66 | ||
67 | %if %{with python3} | |
e09ebd22 | 68 | %py3_build |
6b0fdbcb ER |
69 | %endif |
70 | ||
71 | %if %{with tests} | |
72 | PYTHONPATH=$(pwd) nosetests-%{py_ver} | |
73 | ||
74 | %if %{with python3} | |
75 | PYTHONPATH=$(pwd) nosetests-%{py3_ver} | |
76 | %endif | |
77 | %endif | |
78 | ||
79 | %install | |
80 | rm -rf $RPM_BUILD_ROOT | |
81 | %if %{with python2} | |
e09ebd22 | 82 | %py_install |
6b0fdbcb ER |
83 | |
84 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/txzmq/test | |
85 | ||
86 | %py_postclean | |
87 | %endif | |
88 | ||
89 | %if %{with python3} | |
e09ebd22 | 90 | %py3_install |
6b0fdbcb ER |
91 | |
92 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/txzmq/test | |
93 | %endif | |
94 | ||
95 | %clean | |
96 | rm -rf $RPM_BUILD_ROOT | |
97 | ||
98 | %if %{with python2} | |
99 | %files | |
100 | %defattr(644,root,root,755) | |
101 | %doc README.rst LICENSE.txt | |
102 | %{py_sitescriptdir}/txzmq | |
103 | %{py_sitescriptdir}/txZMQ-%{version}-py*.egg-info | |
104 | %endif | |
105 | ||
106 | %if %{with python3} | |
107 | %files -n python3-txzmq | |
108 | %defattr(644,root,root,755) | |
109 | %doc README.rst LICENSE.txt | |
110 | %{py3_sitescriptdir}/txzmq | |
111 | %{py3_sitescriptdir}/txZMQ-%{version}*.egg-info | |
112 | %endif |