4 # - add initscript post scriptlets
5 # - --daemonize crashes (works under systemd only): https://github.com/fedora-infra/fedmsg/issues/302
8 %bcond_with tests # build with tests
10 Summary: Tools for Fedora Infrastructure real-time messaging
15 Group: Applications/Networking
16 Source0: http://pypi.python.org/packages/source/f/fedmsg/%{name}-%{version}.tar.gz
17 # Source0-md5: 43fc8257724252b38b34608b0c9a2218
18 Source1: %{name}-tmpfiles.conf
20 URL: https://github.com/fedora-infra/fedmsg
21 BuildRequires: python-devel
22 BuildRequires: python-setuptools
23 BuildRequires: rpm-pythonprov
24 BuildRequires: rpmbuild(macros) >= 1.219
26 BuildRequires: python-mock
27 BuildRequires: python-nose
28 BuildRequires: python-six
29 # Only for the test-replay test which is patched out
30 BuildRequires: python-M2Crypto
31 BuildRequires: python-arrow
32 BuildRequires: python-bunch
33 BuildRequires: python-daemon
34 BuildRequires: python-fabulous
35 BuildRequires: python-fedora
36 BuildRequires: python-m2ext
37 BuildRequires: python-moksha-hub >= 1.3.2
38 BuildRequires: python-psutil
39 BuildRequires: python-pygments
40 BuildRequires: python-requests
41 #BuidlRequires: python-sqlalchemy
43 Requires: python-M2Crypto
44 Requires: python-arrow
45 #Requires: python-daemon
46 #Requires: python-fabulous
47 #Requires: python-fedora
48 Requires: python-kitchen
49 Requires: python-m2ext
50 Requires: python-moksha-hub >= 1.3.2
51 Requires: python-psutil
52 Requires: python-pygments
53 Requires: python-requests
54 #Requires: python-simplejson
58 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
61 Python API used around Fedora Infrastructure to send and receive
62 messages with zeromq. Includes some CLI tools.
65 Summary: The fedmsg-announce command
66 Group: Applications/Networking
67 Requires: %{name} = %{version}-%{release}
70 This package contains the fedmsg-announce command for sending
74 Summary: A fedmsg plugin for collectd
75 Group: Applications/Networking
76 Requires: %{name} = %{version}-%{release}
79 This package contains the fedmsg-collectd command which produces
80 output suitable for consumption by a collectd plugin.
83 Summary: The FedMsg Hub
84 Group: Applications/Networking
85 Requires: %{name} = %{version}-%{release}
88 This package contains configuration and init scripts for the FedMsg
92 Summary: The FedMsg Relay
93 Group: Applications/Networking
94 Requires: %{name} = %{version}-%{release}
97 This package contains configuration and init scripts for the FedMsg
101 Summary: The FedMsg IRC Bot
102 Group: Applications/Networking
103 Requires: %{name} = %{version}-%{release}
106 This package contains configuration and init scripts for the FedMsg
110 Summary: The FedMsg Gateway daemon
111 Group: Applications/Networking
112 Requires: %{name} = %{version}-%{release}
115 This package contains configuration and init scripts for the FedMsg
116 Gateway. It will rebroadcast messages from the bus to a specially
117 designated ZMQ pub socket. Useful for repeating messages outside a
124 # This only got shipped with fedmsg-0.6.3
125 rm -f fedmsg.d/_tweet-real.py
127 # These are failing in mock for fedora. Investigate why.
128 # We probably just need a new BuildReq
129 rm -f fedmsg/tests/test_replay.py
130 rm -f fedmsg/tests/test_crypto_gpg.py
132 # Also, sqlalchemy is required for those tests we're knocking out,
133 # so knock it out too.
134 sed -i "/'sqlalchemy.*$/d" setup.py
136 sed -i "/cryptography/d" setup.py
137 sed -i "/daemon/d" setup.py
139 # Temporarily disable signature validation while the timestamp precision bug is
140 # worked out upstream. -- https://github.com/fedora-infra/fedmsg/pull/186
141 sed -i "s/validate_signatures=True/validate_signatures=False/g" fedmsg.d/ssl.py
143 # Copy the development config into the tests dir for the check section
144 cp -rf fedmsg.d fedmsg/tests/
147 %{__python} setup.py build
149 # Create this temporary symlink that's only needed for the test suite.
150 ln -s fedmsg/tests/test_certs dev_certs
152 # Unfortunately, neither of these tests will run on koji since they require
153 # some network connectivity. With a note of sadness, we destroy them.
154 rm fedmsg/tests/test_hub.py
155 rm fedmsg/tests/test_threads.py
159 %if 0%{?rhel} && 0%{?rhel} <= 6
160 # Check section removed until a RHEL6 bug with python-repoze-what-plugins-sql
161 # can be fixed. It causes a fatal error in the test suite.
162 # https://bugzilla.redhat.com/show_bug.cgi?id=813925
164 PYTHONPATH=$(pwd) python setup.py test
169 rm -rf $RPM_BUILD_ROOT
170 %{__python} setup.py install \
173 --install-data=%{_datadir} \
174 --root $RPM_BUILD_ROOT
176 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/fedmsg/tests
180 install -d $RPM_BUILD_ROOT{/etc/{logrotate.d,rc.d/init.d},%{_sysconfdir}/fedmsg.d,%{systemdtmpfilesdir},%{systemdunitdir},/var/{run,log}/fedmsg}
181 cp -p fedmsg.d/*.py $RPM_BUILD_ROOT%{_sysconfdir}/fedmsg.d
183 cp -p initsys/sysv/fedmsg-hub.init $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-hub
184 cp -p initsys/sysv/fedmsg-relay.init $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-relay
185 cp -p initsys/sysv/fedmsg-irc.init $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-irc
186 cp -p initsys/sysv/fedmsg-gateway.init $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-gateway
188 cp -p initsys/systemd/fedmsg-hub.service $RPM_BUILD_ROOT%{systemdunitdir}
189 cp -p initsys/systemd/fedmsg-relay.service $RPM_BUILD_ROOT%{systemdunitdir}
190 cp -p initsys/systemd/fedmsg-irc.service $RPM_BUILD_ROOT%{systemdunitdir}
191 cp -p initsys/systemd/fedmsg-gateway.service $RPM_BUILD_ROOT%{systemdunitdir}
193 # Logrotate configuration
194 cp -p logrotate $RPM_BUILD_ROOT/etc/logrotate.d/fedmsg
197 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
200 rm -rf $RPM_BUILD_ROOT
203 %groupadd -g 313 -r fedmsg
204 %useradd -u 313 -r -s /sbin/nologin -d %{_datadir}/%{name} -M -c 'FedMsg' -g fedmsg fedmsg
207 if [ $1 -eq 0 ]; then
208 %service fedmsg-hub stop
209 /sbin/chkconfig --del fedmsg-hub
213 if [ $1 -eq 0 ]; then
214 %service fedmsg-relay stop
215 /sbin/chkconfig --del fedmsg-relay
219 if [ $1 -eq 0 ]; then
220 %service fedmsg-irc stop
221 /sbin/chkconfig --del fedmsg-irc
225 if [ $1 -eq 0 ]; then
226 %service fedmsg-gateway stop
227 /sbin/chkconfig --del fedmsg-gateway
231 %defattr(644,root,root,755)
232 %doc doc/* README.rst LICENSE
233 %dir %{_sysconfdir}/fedmsg.d
234 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/base.py*
235 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/endpoints.py*
236 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/logging.py*
237 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fedmsg.d/ssl.py*
238 %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/fedmsg
239 %attr(755,root,root) %{_bindir}/fedmsg-logger
240 %attr(755,root,root) %{_bindir}/fedmsg-tail
241 %attr(755,root,root) %{_bindir}/fedmsg-trigger
242 %attr(755,root,root) %{_bindir}/fedmsg-config
243 %attr(755,root,root) %{_bindir}/fedmsg-dg-replay
244 %attr(755,fedmsg,fedmsg) %dir /var/log/fedmsg
245 %attr(775,fedmsg,fedmsg) %dir /var/run/fedmsg
246 %dir %{py_sitescriptdir}/fedmsg
247 %{py_sitescriptdir}/fedmsg/*.py[co]
248 %{py_sitescriptdir}/fedmsg/commands
249 %{py_sitescriptdir}/fedmsg/consumers
250 %{py_sitescriptdir}/fedmsg/crypto
251 %{py_sitescriptdir}/fedmsg/encoding
252 %{py_sitescriptdir}/fedmsg/meta
253 %{py_sitescriptdir}/fedmsg/replay
254 %{py_sitescriptdir}/fedmsg/text
255 %{py_sitescriptdir}/fedmsg-%{version}-py*.egg-info
256 %{systemdtmpfilesdir}/%{name}.conf
259 %defattr(644,root,root,755)
260 %attr(755,root,root) %{_bindir}/fedmsg-announce
263 %defattr(644,root,root,755)
264 %attr(755,root,root) %{_bindir}/fedmsg-collectd
267 %defattr(644,root,root,755)
268 %attr(755,root,root) %{_bindir}/fedmsg-hub
269 %attr(754,root,root) /etc/rc.d/init.d/fedmsg-hub
270 %{systemdunitdir}/fedmsg-hub.service
273 %defattr(644,root,root,755)
274 %attr(755,root,root) %{_bindir}/fedmsg-relay
275 %attr(754,root,root) /etc/rc.d/init.d/fedmsg-relay
276 %{systemdunitdir}/fedmsg-relay.service
277 %config(noreplace) %{_sysconfdir}/fedmsg.d/relay.py*
280 %defattr(644,root,root,755)
281 %attr(755,root,root) %{_bindir}/fedmsg-irc
282 %attr(754,root,root) /etc/rc.d/init.d/fedmsg-irc
283 %{systemdunitdir}/fedmsg-irc.service
285 %config(noreplace) %{_sysconfdir}/fedmsg.d/ircbot.py*
288 %defattr(644,root,root,755)
289 %attr(755,root,root) %{_bindir}/fedmsg-gateway
290 %attr(754,root,root) /etc/rc.d/init.d/fedmsg-gateway
291 %{systemdunitdir}/fedmsg-gateway.service
292 %config(noreplace) %{_sysconfdir}/fedmsg.d/gateway.py*