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