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