3 %bcond_with tests # build with tests
5 Summary: Tools for Fedora Infrastructure real-time messaging
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
16 URL: http://github.com/ralphbean/fedmsg
17 BuildRequires: python-devel
18 BuildRequires: python-setuptools
19 BuildRequires: rpm-pythonprov
20 BuildRequires: rpmbuild(macros) >= 1.219
22 BuildRequires: python-mock
23 BuildRequires: python-nose
24 BuildRequires: python-six
25 # Only for the test-replay test which is patched out
26 BuildRequires: python-M2Crypto
27 BuildRequires: python-arrow
28 BuildRequires: python-bunch
29 BuildRequires: python-daemon
30 BuildRequires: python-fabulous
31 BuildRequires: python-fedora
32 BuildRequires: python-m2ext
33 BuildRequires: python-moksha-hub >= 1.3.2
34 BuildRequires: python-psutil
35 BuildRequires: python-pygments
36 BuildRequires: python-requests
37 #BuidlRequires: python-sqlalchemy
39 Requires: python-M2Crypto
40 Requires: python-arrow
41 #Requires: python-daemon
42 #Requires: python-fabulous
43 #Requires: python-fedora
44 Requires: python-kitchen
45 Requires: python-m2ext
46 Requires: python-moksha-hub >= 1.3.2
47 Requires: python-psutil
48 Requires: python-pygments
49 Requires: python-requests
50 #Requires: python-simplejson
54 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57 Python API used around Fedora Infrastructure to send and receive
58 messages with zeromq. Includes some CLI tools.
61 Summary: The fedmsg-announce command
62 Group: Applications/Networking
63 Requires: %{name} = %{version}-%{release}
66 This package contains the fedmsg-announce command for sending
70 Summary: A fedmsg plugin for collectd
71 Group: Applications/Networking
72 Requires: %{name} = %{version}-%{release}
75 This package contains the fedmsg-collectd command which produces
76 output suitable for consumption by a collectd plugin.
79 Summary: The FedMsg Hub
80 Group: Applications/Networking
81 Requires: %{name} = %{version}-%{release}
84 This package contains configuration and init scripts for the FedMsg
88 Summary: The FedMsg Relay
89 Group: Applications/Networking
90 Requires: %{name} = %{version}-%{release}
93 This package contains configuration and init scripts for the FedMsg
97 Summary: The FedMsg IRC Bot
98 Group: Applications/Networking
99 Requires: %{name} = %{version}-%{release}
102 This package contains configuration and init scripts for the FedMsg
106 Summary: The FedMsg Gateway daemon
107 Group: Applications/Networking
108 Requires: %{name} = %{version}-%{release}
111 This package contains configuration and init scripts for the FedMsg
112 Gateway. It will rebroadcast messages from the bus to a specially
113 designated ZMQ pub socket. Useful for repeating messages outside a
121 # This only got shipped with fedmsg-0.6.3
122 rm -f fedmsg.d/_tweet-real.py
124 # These are failing in mock for fedora. Investigate why.
125 # We probably just need a new BuildReq
126 rm -f fedmsg/tests/test_replay.py
127 rm -f fedmsg/tests/test_crypto_gpg.py
129 # Also, sqlalchemy is required for those tests we're knocking out,
130 # so knock it out too.
131 sed -i "/'sqlalchemy.*$/d" setup.py
133 # Temporarily disable signature validation while the timestamp precision bug is
134 # worked out upstream. -- https://github.com/fedora-infra/fedmsg/pull/186
135 sed -i "s/validate_signatures=True/validate_signatures=False/g" fedmsg.d/ssl.py
137 # Copy the development config into the tests dir for the check section
138 cp -rf fedmsg.d fedmsg/tests/
141 %{__python} setup.py build
143 # Create this temporary symlink that's only needed for the test suite.
144 ln -s fedmsg/tests/test_certs dev_certs
146 # Unfortunately, neither of these tests will run on koji since they require
147 # some network connectivity. With a note of sadness, we destroy them.
148 rm fedmsg/tests/test_hub.py
149 rm fedmsg/tests/test_threads.py
153 %if 0%{?rhel} && 0%{?rhel} <= 6
154 # Check section removed until a RHEL6 bug with python-repoze-what-plugins-sql
155 # can be fixed. It causes a fatal error in the test suite.
156 # https://bugzilla.redhat.com/show_bug.cgi?id=813925
158 PYTHONPATH=$(pwd) python setup.py test
163 rm -rf $RPM_BUILD_ROOT
164 %{__python} setup.py install \
167 --install-data=%{_datadir} \
168 --root $RPM_BUILD_ROOT
170 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/fedmsg/tests
174 install -d $RPM_BUILD_ROOT{/etc/{logrotate.d,rc.d/init.d},%{_sysconfdir}/fedmsg.d,%{systemdtmpfilesdir},%{systemdunitdir},/var/{run,log}/fedmsg}
175 cp -p fedmsg.d/*.py $RPM_BUILD_ROOT%{_sysconfdir}/fedmsg.d
177 cp -p initsys/sysv/fedmsg-hub.init $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-hub
178 cp -p initsys/sysv/fedmsg-relay.init $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-relay
179 cp -p initsys/sysv/fedmsg-irc.init $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-irc
180 cp -p initsys/sysv/fedmsg-gateway.init $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-gateway
182 cp -p initsys/systemd/fedmsg-hub.service $RPM_BUILD_ROOT%{systemdunitdir}
183 cp -p initsys/systemd/fedmsg-relay.service $RPM_BUILD_ROOT%{systemdunitdir}
184 cp -p initsys/systemd/fedmsg-irc.service $RPM_BUILD_ROOT%{systemdunitdir}
185 cp -p initsys/systemd/fedmsg-gateway.service $RPM_BUILD_ROOT%{systemdunitdir}
187 # Logrotate configuration
188 cp -p logrotate $RPM_BUILD_ROOT/etc/logrotate.d/fedmsg
191 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
194 rm -rf $RPM_BUILD_ROOT
197 %groupadd -g 313 -r fedmsg
198 %useradd -u 313 -r -s /sbin/nologin -d %{_datadir}/%{name} -M -c 'FedMsg' -g fedmsg fedmsg
201 if [ $1 -eq 0 ]; then
202 %service fedmsg-hub stop
203 /sbin/chkconfig --del fedmsg-hub
207 if [ $1 -eq 0 ]; then
208 %service fedmsg-relay stop
209 /sbin/chkconfig --del fedmsg-relay
213 if [ $1 -eq 0 ]; then
214 %service fedmsg-irc stop
215 /sbin/chkconfig --del fedmsg-irc
219 if [ $1 -eq 0 ]; then
220 %service fedmsg-gateway stop
221 /sbin/chkconfig --del fedmsg-gateway
225 %defattr(644,root,root,755)
226 %doc doc/* README.rst LICENSE
227 %dir %{_sysconfdir}/fedmsg.d
228 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/base.py*
229 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/endpoints.py*
230 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/logging.py*
231 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/ssl.py*
232 %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/fedmsg
233 %attr(755,root,root) %{_bindir}/fedmsg-logger
234 %attr(755,root,root) %{_bindir}/fedmsg-tail
235 %attr(755,root,root) %{_bindir}/fedmsg-trigger
236 %attr(755,root,root) %{_bindir}/fedmsg-config
237 %attr(755,root,root) %{_bindir}/fedmsg-dg-replay
238 %attr(755,fedmsg,fedmsg) %dir /var/log/fedmsg
239 %attr(775,fedmsg,fedmsg) %dir /var/run/fedmsg
240 %dir %{py_sitescriptdir}/fedmsg
241 %{py_sitescriptdir}/fedmsg/*.py[co]
242 %{py_sitescriptdir}/fedmsg/commands
243 %{py_sitescriptdir}/fedmsg/consumers
244 %{py_sitescriptdir}/fedmsg/crypto
245 %{py_sitescriptdir}/fedmsg/encoding
246 %{py_sitescriptdir}/fedmsg/meta
247 %{py_sitescriptdir}/fedmsg/replay
248 %{py_sitescriptdir}/fedmsg/text
249 %{py_sitescriptdir}/fedmsg-%{version}-py*.egg-info
250 %{systemdtmpfilesdir}/%{name}.conf
253 %defattr(644,root,root,755)
254 %attr(755,root,root) %{_bindir}/fedmsg-announce
257 %defattr(644,root,root,755)
258 %attr(755,root,root) %{_bindir}/fedmsg-collectd
261 %defattr(644,root,root,755)
262 %attr(755,root,root) %{_bindir}/fedmsg-hub
263 %attr(754,root,root) /etc/rc.d/init.d/fedmsg-hub
264 %{systemdunitdir}/fedmsg-hub.service
267 %defattr(644,root,root,755)
268 %attr(755,root,root) %{_bindir}/fedmsg-relay
269 %attr(754,root,root) /etc/rc.d/init.d/fedmsg-relay
270 %{systemdunitdir}/fedmsg-relay.service
271 %config(noreplace) %{_sysconfdir}/fedmsg.d/relay.py*
274 %defattr(644,root,root,755)
275 %attr(755,root,root) %{_bindir}/fedmsg-irc
276 %attr(754,root,root) /etc/rc.d/init.d/fedmsg-irc
277 %{systemdunitdir}/fedmsg-irc.service
279 %config(noreplace) %{_sysconfdir}/fedmsg.d/ircbot.py*
282 %defattr(644,root,root,755)
283 %attr(755,root,root) %{_bindir}/fedmsg-gateway
284 %attr(754,root,root) /etc/rc.d/init.d/fedmsg-gateway
285 %{systemdunitdir}/fedmsg-gateway.service
286 %config(noreplace) %{_sysconfdir}/fedmsg.d/gateway.py*