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