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
15 URL: http://github.com/ralphbean/fedmsg
16 BuildRequires: python-devel
17 BuildRequires: python-setuptools
18 BuildRequires: rpm-pythonprov
19 BuildRequires: rpmbuild(macros) >= 1.219
21 BuildRequires: python-mock
22 BuildRequires: python-nose
23 BuildRequires: python-six
24 # Only for the test-replay test which is patched out
25 BuildRequires: python-M2Crypto
26 BuildRequires: python-arrow
27 BuildRequires: python-bunch
28 BuildRequires: python-daemon
29 BuildRequires: python-fabulous
30 BuildRequires: python-fedora
31 BuildRequires: python-m2ext
32 BuildRequires: python-moksha-hub >= 1.3.2
33 BuildRequires: python-psutil
34 BuildRequires: python-pygments
35 BuildRequires: python-requests
36 #BuidlRequires: python-sqlalchemy
38 Requires: python-M2Crypto
39 Requires: python-arrow
40 #Requires: python-daemon
41 #Requires: python-fabulous
42 #Requires: python-fedora
43 Requires: python-kitchen
44 Requires: python-m2ext
45 Requires: python-moksha-hub >= 1.3.2
46 Requires: python-psutil
47 Requires: python-pygments
48 Requires: python-requests
49 #Requires: python-simplejson
53 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56 Python API used around Fedora Infrastructure to send and receive
57 messages with zeromq. Includes some CLI tools.
60 Summary: The fedmsg-announce command
61 Group: Applications/Networking
62 Requires: %{name} = %{version}-%{release}
65 This package contains the fedmsg-announce command for sending
69 Summary: A fedmsg plugin for collectd
70 Group: Applications/Networking
71 Requires: %{name} = %{version}-%{release}
74 This package contains the fedmsg-collectd command which produces
75 output suitable for consumption by a collectd plugin.
78 Summary: The FedMsg Hub
79 Group: Applications/Networking
80 Requires: %{name} = %{version}-%{release}
83 This package contains configuration and init scripts for the FedMsg
87 Summary: The FedMsg Relay
88 Group: Applications/Networking
89 Requires: %{name} = %{version}-%{release}
92 This package contains configuration and init scripts for the FedMsg
96 Summary: The FedMsg IRC Bot
97 Group: Applications/Networking
98 Requires: %{name} = %{version}-%{release}
101 This package contains configuration and init scripts for the FedMsg
105 Summary: The FedMsg Gateway daemon
106 Group: Applications/Networking
107 Requires: %{name} = %{version}-%{release}
110 This package contains configuration and init scripts for the FedMsg
111 Gateway. It will rebroadcast messages from the bus to a specially
112 designated ZMQ pub socket. Useful for repeating messages outside a
119 # This only got shipped with fedmsg-0.6.3
120 rm -f fedmsg.d/_tweet-real.py
122 # These are failing in mock for fedora. Investigate why.
123 # We probably just need a new BuildReq
124 rm -f fedmsg/tests/test_replay.py
125 rm -f fedmsg/tests/test_crypto_gpg.py
127 # Also, sqlalchemy is required for those tests we're knocking out,
128 # so knock it out too.
129 sed -i "/'sqlalchemy.*$/d" setup.py
131 # Temporarily disable signature validation while the timestamp precision bug is
132 # worked out upstream. -- https://github.com/fedora-infra/fedmsg/pull/186
133 sed -i "s/validate_signatures=True/validate_signatures=False/g" fedmsg.d/ssl.py
135 # Copy the development config into the tests dir for the check section
136 cp -rf fedmsg.d fedmsg/tests/
139 %{__python} setup.py build
141 # Create this temporary symlink that's only needed for the test suite.
142 ln -s fedmsg/tests/test_certs dev_certs
144 # Unfortunately, neither of these tests will run on koji since they require
145 # some network connectivity. With a note of sadness, we destroy them.
146 rm fedmsg/tests/test_hub.py
147 rm fedmsg/tests/test_threads.py
151 %if 0%{?rhel} && 0%{?rhel} <= 6
152 # Check section removed until a RHEL6 bug with python-repoze-what-plugins-sql
153 # can be fixed. It causes a fatal error in the test suite.
154 # https://bugzilla.redhat.com/show_bug.cgi?id=813925
156 PYTHONPATH=$(pwd) python setup.py test
161 rm -rf $RPM_BUILD_ROOT
162 %{__python} setup.py install \
165 --install-data=%{_datadir} \
166 --root $RPM_BUILD_ROOT
168 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/fedmsg/tests
172 install -d $RPM_BUILD_ROOT{/etc/{logrotate.d,rc.d/init.d},%{_sysconfdir}/fedmsg.d,%{systemdtmpfilesdir},%{systemdunitdir},/var/{run,log}/fedmsg}
173 cp -p fedmsg.d/*.py $RPM_BUILD_ROOT%{_sysconfdir}/fedmsg.d
175 cp -p initsys/sysv/fedmsg-hub.init $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-hub
176 cp -p initsys/sysv/fedmsg-relay.init $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-relay
177 cp -p initsys/sysv/fedmsg-irc.init $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-irc
178 cp -p initsys/sysv/fedmsg-gateway.init $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-gateway
180 cp -p initsys/systemd/fedmsg-hub.service $RPM_BUILD_ROOT%{systemdunitdir}
181 cp -p initsys/systemd/fedmsg-relay.service $RPM_BUILD_ROOT%{systemdunitdir}
182 cp -p initsys/systemd/fedmsg-irc.service $RPM_BUILD_ROOT%{systemdunitdir}
183 cp -p initsys/systemd/fedmsg-gateway.service $RPM_BUILD_ROOT%{systemdunitdir}
185 # Logrotate configuration
186 cp -p logrotate $RPM_BUILD_ROOT/etc/logrotate.d/fedmsg
189 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
192 rm -rf $RPM_BUILD_ROOT
195 %groupadd -g 313 -r fedmsg
196 %useradd -u 313 -r -s /sbin/nologin -d %{_datadir}/%{name} -M -c 'FedMsg' -g fedmsg fedmsg
199 if [ $1 -eq 0 ]; then
200 %service fedmsg-hub stop
201 /sbin/chkconfig --del fedmsg-hub
205 if [ $1 -eq 0 ]; then
206 %service fedmsg-relay stop
207 /sbin/chkconfig --del fedmsg-relay
211 if [ $1 -eq 0 ]; then
212 %service fedmsg-irc stop
213 /sbin/chkconfig --del fedmsg-irc
217 if [ $1 -eq 0 ]; then
218 %service fedmsg-gateway stop
219 /sbin/chkconfig --del fedmsg-gateway
223 %defattr(644,root,root,755)
224 %doc doc/* README.rst LICENSE
225 %dir %{_sysconfdir}/fedmsg.d
226 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/base.py*
227 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/endpoints.py*
228 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/logging.py*
229 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/ssl.py*
230 %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/fedmsg
231 %attr(755,root,root) %{_bindir}/fedmsg-logger
232 %attr(755,root,root) %{_bindir}/fedmsg-tail
233 %attr(755,root,root) %{_bindir}/fedmsg-trigger
234 %attr(755,root,root) %{_bindir}/fedmsg-config
235 %attr(755,root,root) %{_bindir}/fedmsg-dg-replay
236 %attr(755,fedmsg,fedmsg) %dir /var/log/fedmsg
237 %attr(775,fedmsg,fedmsg) %dir /var/run/fedmsg
238 %dir %{py_sitescriptdir}/fedmsg
239 %{py_sitescriptdir}/fedmsg/*.py[co]
240 %{py_sitescriptdir}/fedmsg/commands
241 %{py_sitescriptdir}/fedmsg/consumers
242 %{py_sitescriptdir}/fedmsg/crypto
243 %{py_sitescriptdir}/fedmsg/encoding
244 %{py_sitescriptdir}/fedmsg/meta
245 %{py_sitescriptdir}/fedmsg/replay
246 %{py_sitescriptdir}/fedmsg/text
247 %{py_sitescriptdir}/fedmsg-%{version}-py*.egg-info
248 %{systemdtmpfilesdir}/%{name}.conf
251 %defattr(644,root,root,755)
252 %attr(755,root,root) %{_bindir}/fedmsg-announce
255 %defattr(644,root,root,755)
256 %attr(755,root,root) %{_bindir}/fedmsg-collectd
259 %defattr(644,root,root,755)
260 %attr(755,root,root) %{_bindir}/fedmsg-hub
261 %attr(754,root,root) /etc/rc.d/init.d/fedmsg-hub
262 %{systemdunitdir}/fedmsg-hub.service
265 %defattr(644,root,root,755)
266 %attr(755,root,root) %{_bindir}/fedmsg-relay
267 %attr(754,root,root) /etc/rc.d/init.d/fedmsg-relay
268 %{systemdunitdir}/fedmsg-relay.service
269 %config(noreplace) %{_sysconfdir}/fedmsg.d/relay.py*
272 %defattr(644,root,root,755)
273 %attr(755,root,root) %{_bindir}/fedmsg-irc
274 %attr(754,root,root) /etc/rc.d/init.d/fedmsg-irc
275 %{systemdunitdir}/fedmsg-irc.service
277 %config(noreplace) %{_sysconfdir}/fedmsg.d/ircbot.py*
280 %defattr(644,root,root,755)
281 %attr(755,root,root) %{_bindir}/fedmsg-gateway
282 %attr(754,root,root) /etc/rc.d/init.d/fedmsg-gateway
283 %{systemdunitdir}/fedmsg-gateway.service
284 %config(noreplace) %{_sysconfdir}/fedmsg.d/gateway.py*