2 # - --daemonize crashes (works under systemd only): https://github.com/fedora-infra/fedmsg/issues/302
5 %bcond_with tests # build with tests
7 Summary: Tools for Fedora Infrastructure real-time messaging
12 Group: Applications/Networking
13 Source0: http://pypi.python.org/packages/source/f/fedmsg/%{name}-%{version}.tar.gz
14 # Source0-md5: c648950030cc801d22c3951c4046894e
15 Source1: %{name}-tmpfiles.conf
16 Source2: %{name}-gateway.init
17 Source3: %{name}-hub.init
18 Source4: %{name}-irc.init
19 Source5: %{name}-relay.init
21 URL: https://github.com/fedora-infra/fedmsg
22 BuildRequires: python-devel
23 BuildRequires: python-setuptools
24 BuildRequires: rpm-pythonprov
25 BuildRequires: rpmbuild(macros) >= 1.710
27 BuildRequires: python-mock
28 BuildRequires: python-nose
29 BuildRequires: python-six
30 # Only for the test-replay test which is patched out
31 BuildRequires: python-M2Crypto
32 BuildRequires: python-arrow
33 BuildRequires: python-bunch
34 BuildRequires: python-daemon
35 BuildRequires: python-fabulous
36 BuildRequires: python-fedora
37 BuildRequires: python-m2ext
38 BuildRequires: python-moksha-hub >= 1.3.2
39 BuildRequires: python-psutil
40 BuildRequires: python-pygments
41 BuildRequires: python-requests
42 #BuidlRequires: python-sqlalchemy
44 Requires: python-M2Crypto >= 0.22.5
45 Requires: python-arrow
46 #Requires: python-daemon
47 #Requires: python-fabulous
48 #Requires: python-fedora
49 Requires: python-kitchen
50 Requires: python-m2ext
51 Requires: python-moksha-hub >= 1.3.2
52 Requires: python-psutil
53 Requires: python-pygments
54 Requires: python-requests
55 #Requires: python-simplejson
59 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62 Python API used around Fedora Infrastructure to send and receive
63 messages with zeromq. Includes some CLI tools.
66 Summary: The fedmsg-announce command
67 Group: Applications/Networking
68 Requires: %{name} = %{version}-%{release}
71 This package contains the fedmsg-announce command for sending
75 Summary: A fedmsg plugin for collectd
76 Group: Applications/Networking
77 Requires: %{name} = %{version}-%{release}
80 This package contains the fedmsg-collectd command which produces
81 output suitable for consumption by a collectd plugin.
84 Summary: The FedMsg Hub
85 Group: Applications/Networking
86 Requires: rc-scripts >= 0.4.0.20
87 Requires(post,preun): /sbin/chkconfig
88 Requires: %{name} = %{version}-%{release}
91 This package contains configuration and init scripts for the FedMsg
95 Summary: The FedMsg Relay
96 Group: Applications/Networking
97 Requires: %{name} = %{version}-%{release}
98 Requires: rc-scripts >= 0.4.0.20
99 Requires(post,preun): /sbin/chkconfig
102 This package contains configuration and init scripts for the FedMsg
106 Summary: The FedMsg IRC Bot
107 Group: Applications/Networking
108 Requires: %{name} = %{version}-%{release}
109 Requires: rc-scripts >= 0.4.0.20
110 Requires(post,preun): /sbin/chkconfig
113 This package contains configuration and init scripts for the FedMsg
117 Summary: The FedMsg Gateway daemon
118 Group: Applications/Networking
119 Requires: %{name} = %{version}-%{release}
120 Requires: rc-scripts >= 0.4.0.20
121 Requires(post,preun): /sbin/chkconfig
124 This package contains configuration and init scripts for the FedMsg
125 Gateway. It will rebroadcast messages from the bus to a specially
126 designated ZMQ pub socket. Useful for repeating messages outside a
133 # This only got shipped with fedmsg-0.6.3
134 rm -f fedmsg.d/_tweet-real.py
136 # These are failing in mock for fedora. Investigate why.
137 # We probably just need a new BuildReq
138 rm -f fedmsg/tests/test_replay.py
139 rm -f fedmsg/tests/test_crypto_gpg.py
141 # Also, sqlalchemy is required for those tests we're knocking out,
142 # so knock it out too.
143 sed -i "/'sqlalchemy.*$/d" setup.py
145 sed -i "/cryptography/d" setup.py
146 sed -i "/daemon/d" setup.py
148 # Temporarily disable signature validation while the timestamp precision bug is
149 # worked out upstream. -- https://github.com/fedora-infra/fedmsg/pull/186
150 sed -i "s/validate_signatures=True/validate_signatures=False/g" fedmsg.d/ssl.py
152 # Copy the development config into the tests dir for the check section
153 cp -rf fedmsg.d fedmsg/tests/
158 # Create this temporary symlink that's only needed for the test suite.
159 ln -s fedmsg/tests/test_certs dev_certs
161 # Unfortunately, neither of these tests will run on koji since they require
162 # some network connectivity. With a note of sadness, we destroy them.
163 rm fedmsg/tests/test_hub.py
164 rm fedmsg/tests/test_threads.py
168 %if 0%{?rhel} && 0%{?rhel} <= 6
169 # Check section removed until a RHEL6 bug with python-repoze-what-plugins-sql
170 # can be fixed. It causes a fatal error in the test suite.
171 # https://bugzilla.redhat.com/show_bug.cgi?id=813925
173 PYTHONPATH=$(pwd) python setup.py test
178 rm -rf $RPM_BUILD_ROOT
180 --install-data=%{_datadir} \
181 --root $RPM_BUILD_ROOT
183 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/fedmsg/tests
187 install -d $RPM_BUILD_ROOT{/etc/{logrotate.d,rc.d/init.d},%{_sysconfdir}/fedmsg.d,%{systemdtmpfilesdir},%{systemdunitdir},/var/{run,log}/fedmsg}
188 cp -p fedmsg.d/*.py $RPM_BUILD_ROOT%{_sysconfdir}/fedmsg.d
190 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-gateway
191 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-hub
192 install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-irc
193 install -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-relay
195 cp -p initsys/systemd/fedmsg-hub.service $RPM_BUILD_ROOT%{systemdunitdir}
196 cp -p initsys/systemd/fedmsg-relay.service $RPM_BUILD_ROOT%{systemdunitdir}
197 cp -p initsys/systemd/fedmsg-irc.service $RPM_BUILD_ROOT%{systemdunitdir}
198 cp -p initsys/systemd/fedmsg-gateway.service $RPM_BUILD_ROOT%{systemdunitdir}
200 # Logrotate configuration
201 cp -p logrotate $RPM_BUILD_ROOT/etc/logrotate.d/fedmsg
204 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
207 rm -rf $RPM_BUILD_ROOT
210 %groupadd -g 313 -r fedmsg
211 %useradd -u 313 -r -s /sbin/nologin -d %{_datadir}/%{name} -M -c 'FedMsg' -g fedmsg fedmsg
214 /sbin/chkconfig --add fedmsg-hub
215 %service fedmsg-hub restart
218 if [ "$1" = "0" ]; then
219 %service fedmsg-hub stop
220 /sbin/chkconfig --del fedmsg-hub
224 /sbin/chkconfig --add fedmsg-relay
225 %service fedmsg-relay restart
228 if [ "$1" = "0" ]; then
229 %service fedmsg-relay stop
230 /sbin/chkconfig --del fedmsg-relay
234 /sbin/chkconfig --add fedmsg-irc
235 %service fedmsg-irc restart
238 if [ "$1" = "0" ]; then
239 %service fedmsg-irc stop
240 /sbin/chkconfig --del fedmsg-irc
244 /sbin/chkconfig --add fedmsg-gateway
245 %service fedmsg-gateway restart
248 if [ "$1" = "0" ]; then
249 %service fedmsg-gateway stop
250 /sbin/chkconfig --del fedmsg-gateway
254 %defattr(644,root,root,755)
255 %doc doc/* README.rst LICENSE
256 %dir %{_sysconfdir}/fedmsg.d
257 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/base.py*
258 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/endpoints.py*
259 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/logging.py*
260 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/ssl.py*
261 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/relay.py*
262 %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/fedmsg
263 %attr(755,root,root) %{_bindir}/fedmsg-logger
264 %attr(755,root,root) %{_bindir}/fedmsg-tail
265 %attr(755,root,root) %{_bindir}/fedmsg-trigger
266 %attr(755,root,root) %{_bindir}/fedmsg-config
267 %attr(755,root,root) %{_bindir}/fedmsg-dg-replay
268 %attr(755,fedmsg,fedmsg) %dir /var/log/fedmsg
269 %attr(775,fedmsg,fedmsg) %dir /var/run/fedmsg
270 %dir %{py_sitescriptdir}/fedmsg
271 %{py_sitescriptdir}/fedmsg/*.py[co]
272 %{py_sitescriptdir}/fedmsg/commands
273 %{py_sitescriptdir}/fedmsg/consumers
274 %{py_sitescriptdir}/fedmsg/crypto
275 %{py_sitescriptdir}/fedmsg/encoding
276 %{py_sitescriptdir}/fedmsg/meta
277 %{py_sitescriptdir}/fedmsg/replay
278 %{py_sitescriptdir}/fedmsg/text
279 %{py_sitescriptdir}/fedmsg-%{version}-py*.egg-info
280 %{systemdtmpfilesdir}/%{name}.conf
283 %defattr(644,root,root,755)
284 %attr(755,root,root) %{_bindir}/fedmsg-announce
287 %defattr(644,root,root,755)
288 %attr(755,root,root) %{_bindir}/fedmsg-collectd
291 %defattr(644,root,root,755)
292 %attr(755,root,root) %{_bindir}/fedmsg-hub
293 %attr(754,root,root) /etc/rc.d/init.d/fedmsg-hub
294 %{systemdunitdir}/fedmsg-hub.service
297 %defattr(644,root,root,755)
298 %attr(755,root,root) %{_bindir}/fedmsg-relay
299 %attr(754,root,root) /etc/rc.d/init.d/fedmsg-relay
300 %{systemdunitdir}/fedmsg-relay.service
303 %defattr(644,root,root,755)
304 %attr(755,root,root) %{_bindir}/fedmsg-irc
305 %attr(754,root,root) /etc/rc.d/init.d/fedmsg-irc
306 %{systemdunitdir}/fedmsg-irc.service
308 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/ircbot.py*
311 %defattr(644,root,root,755)
312 %attr(755,root,root) %{_bindir}/fedmsg-gateway
313 %attr(754,root,root) /etc/rc.d/init.d/fedmsg-gateway
314 %{systemdunitdir}/fedmsg-gateway.service
315 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/gateway.py*