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