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