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