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