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