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