]>
Commit | Line | Data |
---|---|---|
700057e3 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # build with tests | |
4 | ||
5 | Summary: Tools for Fedora Infrastructure real-time messaging | |
6 | Name: fedmsg | |
7 | Version: 0.11.1 | |
8 | Release: 0.4 | |
9 | License: LGPL v2+ | |
10 | Group: Applications/Networking | |
11 | Source0: http://pypi.python.org/packages/source/f/fedmsg/%{name}-%{version}.tar.gz | |
12 | # Source0-md5: 3074d89b779929b338ac609081e10340 | |
13 | Source1: %{name}-tmpfiles.conf | |
14 | Patch0: %{name}-kojitests.patch | |
15 | URL: http://github.com/ralphbean/fedmsg | |
16 | BuildRequires: python-devel | |
700057e3 | 17 | BuildRequires: python-setuptools |
de043d79 | 18 | BuildRequires: rpm-pythonprov |
700057e3 ER |
19 | %if %{with tests} |
20 | BuildRequires: python-mock | |
21 | BuildRequires: python-nose | |
22 | BuildRequires: python-six | |
23 | # Only for the test-replay test which is patched out | |
24 | BuildRequires: python-M2Crypto | |
25 | BuildRequires: python-arrow | |
26 | BuildRequires: python-bunch | |
27 | BuildRequires: python-daemon | |
28 | BuildRequires: python-fabulous | |
29 | BuildRequires: python-fedora | |
30 | BuildRequires: python-m2ext | |
31 | BuildRequires: python-moksha-hub >= 1.3.2 | |
32 | BuildRequires: python-psutil | |
33 | BuildRequires: python-pygments | |
34 | BuildRequires: python-requests | |
35 | #BuidlRequires: python-sqlalchemy | |
36 | %endif | |
37 | Requires: python-M2Crypto | |
38 | Requires: python-arrow | |
39 | #Requires: python-daemon | |
40 | #Requires: python-fabulous | |
41 | #Requires: python-fedora | |
42 | Requires: python-kitchen | |
43 | Requires: python-m2ext | |
44 | Requires: python-moksha-hub >= 1.3.2 | |
45 | Requires: python-psutil | |
46 | Requires: python-pygments | |
47 | Requires: python-requests | |
48 | #Requires: python-simplejson | |
49 | Requires: python-six | |
50 | Requires: python-zmq | |
51 | BuildArch: noarch | |
52 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
53 | ||
54 | %description | |
55 | Python API used around Fedora Infrastructure to send and receive | |
56 | messages with zeromq. Includes some CLI tools. | |
57 | ||
58 | %package announce | |
59 | Summary: The fedmsg-announce command | |
60 | Group: Applications/Networking | |
61 | Requires: %{name} = %{version}-%{release} | |
62 | ||
63 | %description announce | |
64 | This package contains the fedmsg-announce command for sending | |
65 | announcements. | |
66 | ||
67 | %package collectd | |
68 | Summary: A fedmsg plugin for collectd | |
69 | Group: Applications/Networking | |
70 | Requires: %{name} = %{version}-%{release} | |
71 | ||
72 | %description collectd | |
73 | This package contains the fedmsg-collectd command which produces | |
74 | output suitable for consumption by a collectd plugin. | |
75 | ||
76 | %package hub | |
77 | Summary: The FedMsg Hub | |
78 | Group: Applications/Networking | |
79 | Requires: %{name} = %{version}-%{release} | |
80 | ||
81 | %description hub | |
82 | This package contains configuration and init scripts for the FedMsg | |
83 | hub. | |
84 | ||
85 | %package relay | |
86 | Summary: The FedMsg Relay | |
87 | Group: Applications/Networking | |
88 | Requires: %{name} = %{version}-%{release} | |
89 | ||
90 | %description relay | |
91 | This package contains configuration and init scripts for the FedMsg | |
92 | relay. | |
93 | ||
94 | %package irc | |
95 | Summary: The FedMsg IRC Bot | |
96 | Group: Applications/Networking | |
97 | Requires: %{name} = %{version}-%{release} | |
98 | ||
99 | %description irc | |
100 | This package contains configuration and init scripts for the FedMsg | |
101 | IRC bot. | |
102 | ||
103 | %package gateway | |
104 | Summary: The FedMsg Gateway daemon | |
105 | Group: Applications/Networking | |
106 | Requires: %{name} = %{version}-%{release} | |
107 | ||
108 | %description gateway | |
109 | This package contains configuration and init scripts for the FedMsg | |
110 | Gateway. It will rebroadcast messages from the bus to a specially | |
111 | designated ZMQ pub socket. Useful for repeating messages outside a | |
112 | firewall. | |
113 | ||
114 | %prep | |
115 | %setup -q | |
116 | %patch0 -p1 | |
117 | ||
118 | # This only got shipped with fedmsg-0.6.3 | |
119 | rm -f fedmsg.d/_tweet-real.py | |
120 | ||
121 | # These are failing in mock for fedora. Investigate why. | |
122 | # We probably just need a new BuildReq | |
123 | rm -f fedmsg/tests/test_replay.py | |
124 | rm -f fedmsg/tests/test_crypto_gpg.py | |
125 | ||
126 | # Also, sqlalchemy is required for those tests we're knocking out, | |
127 | # so knock it out too. | |
128 | sed -i "/'sqlalchemy.*$/d" setup.py | |
129 | ||
130 | # Temporarily disable signature validation while the timestamp precision bug is | |
131 | # worked out upstream. -- https://github.com/fedora-infra/fedmsg/pull/186 | |
132 | sed -i "s/validate_signatures=True/validate_signatures=False/g" fedmsg.d/ssl.py | |
133 | ||
134 | # Copy the development config into the tests dir for the check section | |
135 | cp -rf fedmsg.d fedmsg/tests/ | |
136 | ||
137 | %build | |
138 | %{__python} setup.py build | |
139 | ||
140 | # Create this temporary symlink that's only needed for the test suite. | |
141 | ln -s fedmsg/tests/test_certs dev_certs | |
142 | ||
143 | # Unfortunately, neither of these tests will run on koji since they require | |
144 | # some network connectivity. With a note of sadness, we destroy them. | |
145 | rm fedmsg/tests/test_hub.py | |
146 | rm fedmsg/tests/test_threads.py | |
147 | ||
148 | %if %{with tests} | |
149 | %check | |
150 | %if 0%{?rhel} && 0%{?rhel} <= 6 | |
151 | # Check section removed until a RHEL6 bug with python-repoze-what-plugins-sql | |
152 | # can be fixed. It causes a fatal error in the test suite. | |
153 | # https://bugzilla.redhat.com/show_bug.cgi?id=813925 | |
154 | %else | |
155 | PYTHONPATH=$(pwd) python setup.py test | |
156 | %endif | |
157 | %endif | |
158 | ||
159 | %install | |
160 | rm -rf $RPM_BUILD_ROOT | |
161 | %{__python} setup.py install \ | |
162 | --skip-build \ | |
163 | --optimize=2 \ | |
164 | --install-data=%{_datadir} \ | |
165 | --root $RPM_BUILD_ROOT | |
166 | ||
167 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/fedmsg/tests | |
168 | ||
169 | install -d $RPM_BUILD_ROOT{/etc/{logrotate.d,rc.d/init.d},%{_sysconfdir}/fedmsg.d,%{systemdtmpfilesdir},%{systemdunitdir},/var/{run,log}/fedmsg} | |
170 | cp -p fedmsg.d/*.py $RPM_BUILD_ROOT%{_sysconfdir}/fedmsg.d | |
171 | ||
172 | cp -p initsys/sysv/fedmsg-hub.init $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-hub | |
173 | cp -p initsys/sysv/fedmsg-relay.init $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-relay | |
174 | cp -p initsys/sysv/fedmsg-irc.init $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-irc | |
175 | cp -p initsys/sysv/fedmsg-gateway.init $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-gateway | |
176 | ||
177 | cp -p initsys/systemd/fedmsg-hub.service $RPM_BUILD_ROOT%{systemdunitdir} | |
178 | cp -p initsys/systemd/fedmsg-relay.service $RPM_BUILD_ROOT%{systemdunitdir} | |
179 | cp -p initsys/systemd/fedmsg-irc.service $RPM_BUILD_ROOT%{systemdunitdir} | |
180 | cp -p initsys/systemd/fedmsg-gateway.service $RPM_BUILD_ROOT%{systemdunitdir} | |
181 | ||
182 | # Logrotate configuration | |
183 | cp -p logrotate $RPM_BUILD_ROOT/etc/logrotate.d/fedmsg | |
184 | ||
185 | # tmpfiles.d | |
186 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf | |
187 | ||
188 | %clean | |
189 | rm -rf $RPM_BUILD_ROOT | |
190 | ||
191 | %pre | |
192 | %groupadd -g 313 -r fedmsg | |
193 | %useradd -u 313 -r -s /sbin/nologin -d %{_datadir}/%{name} -M -c 'FedMsg' -g fedmsg fedmsg | |
194 | ||
195 | %preun hub | |
196 | if [ $1 -eq 0 ]; then | |
197 | %service fedmsg-hub stop | |
198 | /sbin/chkconfig --del fedmsg-hub | |
199 | fi | |
200 | ||
201 | %preun relay | |
202 | if [ $1 -eq 0 ]; then | |
203 | %service fedmsg-relay stop | |
204 | /sbin/chkconfig --del fedmsg-relay | |
205 | fi | |
206 | ||
207 | %preun irc | |
208 | if [ $1 -eq 0 ]; then | |
209 | %service fedmsg-irc stop | |
210 | /sbin/chkconfig --del fedmsg-irc | |
211 | fi | |
212 | ||
213 | %preun gateway | |
214 | if [ $1 -eq 0 ]; then | |
215 | %service fedmsg-gateway stop | |
216 | /sbin/chkconfig --del fedmsg-gateway | |
217 | fi | |
218 | ||
219 | %files | |
220 | %defattr(644,root,root,755) | |
221 | %doc doc/* README.rst LICENSE | |
222 | %dir %{_sysconfdir}/fedmsg.d | |
223 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/base.py* | |
224 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/endpoints.py* | |
225 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/logging.py* | |
226 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/ssl.py* | |
227 | %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/fedmsg | |
228 | %attr(755,root,root) %{_bindir}/fedmsg-logger | |
229 | %attr(755,root,root) %{_bindir}/fedmsg-tail | |
230 | %attr(755,root,root) %{_bindir}/fedmsg-trigger | |
231 | %attr(755,root,root) %{_bindir}/fedmsg-config | |
232 | %attr(755,root,root) %{_bindir}/fedmsg-dg-replay | |
233 | %attr(755,fedmsg,fedmsg) %dir /var/log/fedmsg | |
234 | %attr(775,fedmsg,fedmsg) %dir /var/run/fedmsg | |
235 | %dir %{py_sitescriptdir}/fedmsg | |
236 | %{py_sitescriptdir}/fedmsg/*.py[co] | |
237 | %{py_sitescriptdir}/fedmsg/commands | |
238 | %{py_sitescriptdir}/fedmsg/consumers | |
239 | %{py_sitescriptdir}/fedmsg/crypto | |
240 | %{py_sitescriptdir}/fedmsg/encoding | |
241 | %{py_sitescriptdir}/fedmsg/meta | |
242 | %{py_sitescriptdir}/fedmsg/replay | |
243 | %{py_sitescriptdir}/fedmsg/text | |
244 | %{py_sitescriptdir}/fedmsg-%{version}-py*.egg-info | |
245 | %{systemdtmpfilesdir}/%{name}.conf | |
246 | ||
247 | %files announce | |
248 | %defattr(644,root,root,755) | |
249 | %attr(755,root,root) %{_bindir}/fedmsg-announce | |
250 | ||
251 | %files collectd | |
252 | %defattr(644,root,root,755) | |
253 | %attr(755,root,root) %{_bindir}/fedmsg-collectd | |
254 | ||
255 | %files hub | |
256 | %defattr(644,root,root,755) | |
257 | %attr(755,root,root) %{_bindir}/fedmsg-hub | |
258 | %attr(754,root,root) /etc/rc.d/init.d/fedmsg-hub | |
259 | %{systemdunitdir}/fedmsg-hub.service | |
260 | ||
261 | %files relay | |
262 | %defattr(644,root,root,755) | |
263 | %attr(755,root,root) %{_bindir}/fedmsg-relay | |
264 | %attr(754,root,root) /etc/rc.d/init.d/fedmsg-relay | |
265 | %{systemdunitdir}/fedmsg-relay.service | |
266 | %config(noreplace) %{_sysconfdir}/fedmsg.d/relay.py* | |
267 | ||
268 | %files irc | |
269 | %defattr(644,root,root,755) | |
270 | %attr(755,root,root) %{_bindir}/fedmsg-irc | |
271 | %attr(754,root,root) /etc/rc.d/init.d/fedmsg-irc | |
272 | %{systemdunitdir}/fedmsg-irc.service | |
273 | ||
274 | %config(noreplace) %{_sysconfdir}/fedmsg.d/ircbot.py* | |
275 | ||
276 | %files gateway | |
277 | %defattr(644,root,root,755) | |
278 | %attr(755,root,root) %{_bindir}/fedmsg-gateway | |
279 | %attr(754,root,root) /etc/rc.d/init.d/fedmsg-gateway | |
280 | %{systemdunitdir}/fedmsg-gateway.service | |
281 | %config(noreplace) %{_sysconfdir}/fedmsg.d/gateway.py* |