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