]>
Commit | Line | Data |
---|---|---|
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 | ||
9 | Summary: Tools for Fedora Infrastructure real-time messaging | |
10 | Name: fedmsg | |
c19fecfc | 11 | Version: 0.16.4 |
5fff4a25 | 12 | Release: 1 |
700057e3 ER |
13 | License: LGPL v2+ |
14 | Group: Applications/Networking | |
15 | Source0: http://pypi.python.org/packages/source/f/fedmsg/%{name}-%{version}.tar.gz | |
c19fecfc | 16 | # Source0-md5: 43f00d123669f6a0506ee0f37035c5d7 |
700057e3 | 17 | Source1: %{name}-tmpfiles.conf |
319bc186 ER |
18 | Source2: fedmsg-gateway.init |
19 | Source3: fedmsg-hub.init | |
20 | Source4: fedmsg-irc.init | |
21 | Source5: fedmsg-relay.init | |
d803d01c | 22 | Patch1: config.patch |
5fff4a25 | 23 | URL: https://github.com/fedora-infra/fedmsg |
700057e3 | 24 | BuildRequires: python-devel |
700057e3 | 25 | BuildRequires: python-setuptools |
de043d79 | 26 | BuildRequires: rpm-pythonprov |
f3fe7ede | 27 | BuildRequires: rpmbuild(macros) >= 1.710 |
700057e3 ER |
28 | %if %{with tests} |
29 | BuildRequires: python-mock | |
30 | BuildRequires: python-nose | |
31 | BuildRequires: python-six | |
32 | # Only for the test-replay test which is patched out | |
33 | BuildRequires: python-M2Crypto | |
34 | BuildRequires: python-arrow | |
35 | BuildRequires: python-bunch | |
36 | BuildRequires: python-daemon | |
37 | BuildRequires: python-fabulous | |
38 | BuildRequires: python-fedora | |
39 | BuildRequires: python-m2ext | |
40 | BuildRequires: python-moksha-hub >= 1.3.2 | |
41 | BuildRequires: python-psutil | |
42 | BuildRequires: python-pygments | |
43 | BuildRequires: python-requests | |
44 | #BuidlRequires: python-sqlalchemy | |
45 | %endif | |
fc495cef | 46 | Requires: python-M2Crypto >= 0.22.5 |
700057e3 ER |
47 | Requires: python-arrow |
48 | #Requires: python-daemon | |
49 | #Requires: python-fabulous | |
50 | #Requires: python-fedora | |
51 | Requires: python-kitchen | |
52 | Requires: python-m2ext | |
53 | Requires: python-moksha-hub >= 1.3.2 | |
54 | Requires: python-psutil | |
55 | Requires: python-pygments | |
56 | Requires: python-requests | |
57 | #Requires: python-simplejson | |
58 | Requires: python-six | |
59 | Requires: python-zmq | |
60 | BuildArch: noarch | |
61 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
62 | ||
63 | %description | |
64 | Python API used around Fedora Infrastructure to send and receive | |
65 | messages with zeromq. Includes some CLI tools. | |
66 | ||
67 | %package announce | |
68 | Summary: The fedmsg-announce command | |
69 | Group: Applications/Networking | |
70 | Requires: %{name} = %{version}-%{release} | |
71 | ||
72 | %description announce | |
73 | This package contains the fedmsg-announce command for sending | |
74 | announcements. | |
75 | ||
76 | %package collectd | |
77 | Summary: A fedmsg plugin for collectd | |
78 | Group: Applications/Networking | |
79 | Requires: %{name} = %{version}-%{release} | |
80 | ||
81 | %description collectd | |
82 | This package contains the fedmsg-collectd command which produces | |
83 | output suitable for consumption by a collectd plugin. | |
84 | ||
85 | %package hub | |
86 | Summary: The FedMsg Hub | |
87 | Group: Applications/Networking | |
88 | Requires: %{name} = %{version}-%{release} | |
89 | ||
90 | %description hub | |
91 | This package contains configuration and init scripts for the FedMsg | |
92 | hub. | |
93 | ||
94 | %package relay | |
95 | Summary: The FedMsg Relay | |
96 | Group: Applications/Networking | |
97 | Requires: %{name} = %{version}-%{release} | |
98 | ||
99 | %description relay | |
100 | This package contains configuration and init scripts for the FedMsg | |
101 | relay. | |
102 | ||
103 | %package irc | |
104 | Summary: The FedMsg IRC Bot | |
105 | Group: Applications/Networking | |
106 | Requires: %{name} = %{version}-%{release} | |
107 | ||
108 | %description irc | |
109 | This package contains configuration and init scripts for the FedMsg | |
110 | IRC bot. | |
111 | ||
112 | %package gateway | |
113 | Summary: The FedMsg Gateway daemon | |
114 | Group: Applications/Networking | |
115 | Requires: %{name} = %{version}-%{release} | |
116 | ||
117 | %description gateway | |
118 | This package contains configuration and init scripts for the FedMsg | |
119 | Gateway. It will rebroadcast messages from the bus to a specially | |
120 | designated ZMQ pub socket. Useful for repeating messages outside a | |
121 | firewall. | |
122 | ||
123 | %prep | |
124 | %setup -q | |
d803d01c | 125 | %patch1 -p1 |
700057e3 ER |
126 | |
127 | # This only got shipped with fedmsg-0.6.3 | |
128 | rm -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 | |
132 | rm -f fedmsg/tests/test_replay.py | |
133 | rm -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. | |
137 | sed -i "/'sqlalchemy.*$/d" setup.py | |
138 | ||
21b2b826 | 139 | sed -i "/cryptography/d" setup.py |
e3069903 ER |
140 | sed -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 | |
144 | sed -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 | |
147 | cp -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. | |
153 | ln -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. | |
157 | rm fedmsg/tests/test_hub.py | |
158 | rm 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 | |
167 | PYTHONPATH=$(pwd) python setup.py test | |
168 | %endif | |
169 | %endif | |
170 | ||
171 | %install | |
172 | rm -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 |
181 | install -d $RPM_BUILD_ROOT{/etc/{logrotate.d,rc.d/init.d},%{_sysconfdir}/fedmsg.d,%{systemdtmpfilesdir},%{systemdunitdir},/var/{run,log}/fedmsg} |
182 | cp -p fedmsg.d/*.py $RPM_BUILD_ROOT%{_sysconfdir}/fedmsg.d | |
183 | ||
319bc186 ER |
184 | install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-gateway |
185 | install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-hub | |
186 | install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-irc | |
187 | install -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/fedmsg-relay | |
700057e3 ER |
188 | |
189 | cp -p initsys/systemd/fedmsg-hub.service $RPM_BUILD_ROOT%{systemdunitdir} | |
190 | cp -p initsys/systemd/fedmsg-relay.service $RPM_BUILD_ROOT%{systemdunitdir} | |
191 | cp -p initsys/systemd/fedmsg-irc.service $RPM_BUILD_ROOT%{systemdunitdir} | |
192 | cp -p initsys/systemd/fedmsg-gateway.service $RPM_BUILD_ROOT%{systemdunitdir} | |
193 | ||
194 | # Logrotate configuration | |
195 | cp -p logrotate $RPM_BUILD_ROOT/etc/logrotate.d/fedmsg | |
196 | ||
197 | # tmpfiles.d | |
198 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf | |
199 | ||
200 | %clean | |
201 | rm -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 | |
208 | if [ $1 -eq 0 ]; then | |
209 | %service fedmsg-hub stop | |
210 | /sbin/chkconfig --del fedmsg-hub | |
211 | fi | |
212 | ||
213 | %preun relay | |
214 | if [ $1 -eq 0 ]; then | |
215 | %service fedmsg-relay stop | |
216 | /sbin/chkconfig --del fedmsg-relay | |
217 | fi | |
218 | ||
219 | %preun irc | |
220 | if [ $1 -eq 0 ]; then | |
221 | %service fedmsg-irc stop | |
222 | /sbin/chkconfig --del fedmsg-irc | |
223 | fi | |
224 | ||
225 | %preun gateway | |
226 | if [ $1 -eq 0 ]; then | |
227 | %service fedmsg-gateway stop | |
228 | /sbin/chkconfig --del fedmsg-gateway | |
229 | fi | |
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* |