]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # TODO: | |
3 | # - think about moving modules to subpackages. At least, those with extra | |
4 | # dependencies. | |
5 | # - maybe there is no need to pack *.py (are *.pyc enough?) | |
6 | # | |
7 | # Conditional build: | |
8 | %bcond_without geoip # without GeoIP support | |
9 | %bcond_without mysql # without MySQL support | |
10 | %bcond_without ldap # without LDAP support | |
11 | %bcond_without ffmpeg # without ffmpeg support | |
12 | # | |
13 | Summary: Fast, Flexible and Lightweight Web server | |
14 | Summary(pl.UTF-8): Cherokee - serwer WWW | |
15 | Name: cherokee | |
16 | Version: 1.2.103 | |
17 | Release: 2 | |
18 | License: GPL v2 | |
19 | Group: Networking/Daemons | |
20 | Source0: https://github.com/cherokee/webserver/archive/v%{version}.zip | |
21 | # Source0-md5: 9e6d8e0dd95808d365d32ecb0a9b80fe | |
22 | # the last snapshot from https://github.com/cherokee/CTK | |
23 | Source1: CTK-20120806.tar.xz | |
24 | # Source1-md5: 567f087cd6cdf10b89047535cbe94f8e | |
25 | Source2: %{name}.init | |
26 | Source3: %{name}.sysconfig | |
27 | Source4: %{name}.upstart | |
28 | Source5: %{name}.service | |
29 | Patch0: %{name}-config.patch | |
30 | Patch1: %{name}-panic_path.patch | |
31 | Patch2: ffmpeg0.11.patch | |
32 | URL: http://www.cherokee-project.com/ | |
33 | %{?with_geoip:BuildRequires: GeoIP-devel} | |
34 | BuildRequires: autoconf | |
35 | BuildRequires: automake | |
36 | %{?with_ffmpeg:BuildRequires: ffmpeg-devel >= 1.0} | |
37 | BuildRequires: gettext-devel | |
38 | BuildRequires: libtool | |
39 | %{?with_mysql:BuildRequires: mysql-devel} | |
40 | %{?with_ldap:BuildRequires: openldap-devel} | |
41 | BuildRequires: openssl-devel | |
42 | BuildRequires: pam-devel | |
43 | BuildRequires: pcre-devel | |
44 | BuildRequires: php(fcgi) | |
45 | BuildRequires: pkgconfig | |
46 | BuildRequires: python-docutils | |
47 | BuildRequires: rpm-pythonprov | |
48 | BuildRequires: rpmbuild(macros) >= 1.647 | |
49 | BuildRequires: zlib-devel | |
50 | Requires(post,preun): /sbin/chkconfig | |
51 | Requires(postun): /usr/sbin/groupdel | |
52 | Requires(postun): /usr/sbin/userdel | |
53 | Requires(pre): /bin/id | |
54 | Requires(pre): /usr/bin/getgid | |
55 | Requires(pre): /usr/sbin/groupadd | |
56 | Requires(pre): /usr/sbin/useradd | |
57 | Requires: %{name}-libs = %{version}-%{release} | |
58 | Requires: rc-scripts >= 0.4.3.0 | |
59 | Requires: systemd-units >= 38 | |
60 | Suggests: %{name}-admin = %{version}-%{release} | |
61 | Suggests: php(fcgi) | |
62 | Provides: group(cherokee) | |
63 | Provides: group(http) | |
64 | Provides: user(cherokee) | |
65 | Provides: webserver | |
66 | Provides: webserver(indexfile) | |
67 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
68 | ||
69 | %define _sysconfdir /etc/cherokee | |
70 | %define _wwwhome /home/services/%{name} | |
71 | %define _wwwroot %{_wwwhome}/html | |
72 | ||
73 | %description | |
74 | Cherokee is a flexible, very fast, lightweight Web server. It is | |
75 | implemented entirely in C, and has no dependencies beyond a standard C | |
76 | library. It is embeddable and extensible with plug-ins. It supports | |
77 | on-the-fly configuration by reading files or strings, TLS/SSL via | |
78 | OpenSSL, virtual hosts, authentication, cache friendly features, PHP, | |
79 | custom error management, and much more. | |
80 | ||
81 | %description -l pl.UTF-8 | |
82 | Cherokee to elastyczny, bardzo szybki i lekki serwer WWW. Jest | |
83 | zaimplementowany całkowicie w C i nie ma zależności poza standardową | |
84 | biblioteką C. Jest osadzalny i rozbudowywalny poprzez wtyczki. | |
85 | Obsługuje konfigurację w locie poprzez odczyt plików lub łańcuchów | |
86 | znaków, TLS/SSL poprzez OpenSSL, hosty wirtualne, uwierzytelnianie, | |
87 | opcje związane z pamięcią podręczną, PHP, własne zarządzanie błędami i | |
88 | wiele więcej. | |
89 | ||
90 | %package upstart | |
91 | Summary: Upstart job description for the Cherokee web server | |
92 | Summary(pl.UTF-8): Opis zadania Upstart dla serwera Cherokee | |
93 | Group: Daemons | |
94 | Requires: %{name} = %{version}-%{release} | |
95 | Requires: upstart >= 0.6 | |
96 | ||
97 | %description upstart | |
98 | Upstart job description for the Cherokee web server. | |
99 | ||
100 | %description upstart -l pl.UTF-8 | |
101 | Opis zadania Upstart dla serwera WWW Cherokee. | |
102 | ||
103 | %package admin | |
104 | Summary: Cherokee web server administration interface | |
105 | Summary(pl.UTF-8): Interfejs administracyjny serwera WWW Cherokee | |
106 | Group: Networking/Daemons | |
107 | Requires: %{name} = %{version}-%{release} | |
108 | Requires: python | |
109 | Requires: python-modules | |
110 | ||
111 | %description admin | |
112 | Cherokee web server administration interface. | |
113 | ||
114 | %description admin -l pl.UTF-8 | |
115 | Interfejs administracyjny serwera WWW Cherokee. | |
116 | ||
117 | %package devel | |
118 | Summary: Header files for Cherokee web server | |
119 | Summary(pl.UTF-8): Pliki nagłówkowe dla serwera WWW Cherokee | |
120 | Group: Development/Libraries | |
121 | Requires: %{name}-libs = %{version}-%{release} | |
122 | ||
123 | %description devel | |
124 | Header files for Cherokee web server. | |
125 | ||
126 | %description devel -l pl.UTF-8 | |
127 | Pliki nagłówkowe dla serwera WWW Cherokee. | |
128 | ||
129 | %package libs | |
130 | Summary: Cherokee web server libraries | |
131 | Summary(pl.UTF-8): Biblioteki serwera WWW Cherokee | |
132 | Group: Libraries | |
133 | ||
134 | %description libs | |
135 | Cherokee web server libraries. | |
136 | ||
137 | %description libs -l pl.UTF-8 | |
138 | Biblioteki serwera WWW Cherokee. | |
139 | ||
140 | %prep | |
141 | %setup -qn webserver-%{version} -a1 | |
142 | %patch0 -p1 | |
143 | %patch1 -p1 | |
144 | #%patch2 -p1 | |
145 | ||
146 | %build | |
147 | %{__libtoolize} | |
148 | %{__aclocal} -I m4 | |
149 | %{__autoconf} | |
150 | %{__autoheader} | |
151 | %{__automake} | |
152 | po/admin/generate_POTFILESin.py > po/admin/POTFILES.in | |
153 | %configure \ | |
154 | --with-php=/usr/bin/php.cgi \ | |
155 | --disable-static \ | |
156 | --enable-os-string="PLD Linux" \ | |
157 | --sysconfdir=/etc \ | |
158 | --with-wwwroot=%{_wwwroot} \ | |
159 | --with-wwwuser=cherokee \ | |
160 | --with-wwwgroup=http \ | |
161 | %{!?with_geoip:--without-geoip} \ | |
162 | %{!?with_mysql:--without-mysql} \ | |
163 | %{!?with_ffmpeg:--without-ffmpeg} \ | |
164 | %{!?with_ldap:--without-ldap} | |
165 | ||
166 | # workaround for missing pot file and no way to build it | |
167 | touch po/admin/cherokee.pot | |
168 | touch po/admin/*.po | |
169 | ||
170 | %{__make} | |
171 | ||
172 | %install | |
173 | rm -rf $RPM_BUILD_ROOT | |
174 | install -d $RPM_BUILD_ROOT/etc/{init,pam.d,sysconfig,rc.d/init.d} \ | |
175 | $RPM_BUILD_ROOT/var/log/%{name} \ | |
176 | $RPM_BUILD_ROOT%{systemdunitdir} | |
177 | ||
178 | %{__make} -j1 install \ | |
179 | DESTDIR=$RPM_BUILD_ROOT | |
180 | ||
181 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} | |
182 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name} | |
183 | install %{SOURCE4} $RPM_BUILD_ROOT/etc/init/%{name}.conf | |
184 | install %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/cherokee.service | |
185 | ||
186 | # users don't need this | |
187 | mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/cherokee-panic | |
188 | ||
189 | # modules dlopened by *.so | |
190 | rm -f $RPM_BUILD_ROOT%{_libdir}/cherokee/lib*.la | |
191 | ||
192 | # unify manual dir | |
193 | rm -rf html | |
194 | mv $RPM_BUILD_ROOT%{_docdir}/%{name} html | |
195 | ||
196 | # provided via %doc | |
197 | rm $RPM_BUILD_ROOT/etc/cherokee/cherokee.conf.perf_sample | |
198 | ||
199 | # compile python modules, otherwise *.pyc may get generated on runtime | |
200 | # and stay after package removal | |
201 | %py_comp $RPM_BUILD_ROOT%{_datadir}/cherokee/admin/ | |
202 | ||
203 | # seems like this is not needed on Linux | |
204 | rm $RPM_BUILD_ROOT%{_bindir}/cherokee-macos-askpass | |
205 | ||
206 | mv $RPM_BUILD_ROOT%{_localedir}/{sv_SE,sv} | |
207 | mv $RPM_BUILD_ROOT%{_localedir}/{jp,ja} | |
208 | %find_lang %{name} | |
209 | ||
210 | ||
211 | %clean | |
212 | rm -rf $RPM_BUILD_ROOT | |
213 | ||
214 | %pre | |
215 | %groupadd -g 161 cherokee | |
216 | %groupadd -g 51 http | |
217 | %useradd -u 161 -d %{_wwwhome} -c "Cherokee User" -g cherokee cherokee | |
218 | %addusertogroup cherokee http | |
219 | ||
220 | %post | |
221 | if [ "$1" = "2" -a -e %{_sysconfdir}/cherokee.conf ]; then | |
222 | %{_datadir}/%{name}/admin/upgrade_config.py %{_sysconfdir}/cherokee.conf | |
223 | fi | |
224 | /sbin/chkconfig --add %{name} | |
225 | %service %{name} restart "Cherokee webserver" | |
226 | %systemd_post %{name}.service | |
227 | ||
228 | %preun | |
229 | if [ "$1" = "0" ]; then | |
230 | %service %{name} stop | |
231 | /sbin/chkconfig --del %{name} | |
232 | fi | |
233 | %systemd_preun %{name}.service | |
234 | ||
235 | %postun | |
236 | if [ "$1" = "0" ]; then | |
237 | %userremove cherokee | |
238 | %groupremove cherokee | |
239 | %groupremove http | |
240 | fi | |
241 | %systemd_reload | |
242 | ||
243 | %triggerpostun -- %{name} < 1.2.103-1 | |
244 | %systemd_trigger %{name}.service | |
245 | ||
246 | %post upstart | |
247 | %upstart_post %{name} | |
248 | ||
249 | %postun upstart | |
250 | %upstart_postun %{name} | |
251 | ||
252 | %post libs -p /sbin/ldconfig | |
253 | %postun libs -p /sbin/ldconfig | |
254 | ||
255 | %files | |
256 | %defattr(644,root,root,755) | |
257 | %doc AUTHORS html performance.conf.sample | |
258 | %dir %attr(750,root,root) %{_sysconfdir} | |
259 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/cherokee.conf | |
260 | ||
261 | %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/cherokee | |
262 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cherokee | |
263 | %attr(754,root,root) /etc/rc.d/init.d/cherokee | |
264 | %{systemdunitdir}/%{name}.service | |
265 | ||
266 | %attr(755,root,root) %{_bindir}/CTK-run | |
267 | %attr(755,root,root) %{_bindir}/cget | |
268 | %attr(755,root,root) %{_bindir}/cherokee-tweak | |
269 | %attr(755,root,root) %{_sbindir}/cherokee | |
270 | %attr(755,root,root) %{_sbindir}/cherokee-panic | |
271 | %attr(755,root,root) %{_sbindir}/cherokee-worker | |
272 | ||
273 | %dir %{_libdir}/cherokee | |
274 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_admin.so | |
275 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_and.so | |
276 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_authlist.so | |
277 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_bind.so | |
278 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_cgi.so | |
279 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_combined.so | |
280 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_common.so | |
281 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_custom_error.so | |
282 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_custom.so | |
283 | %{?with_mysql:%attr(755,root,root) %{_libdir}/cherokee/libplugin_dbslayer.so} | |
284 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_deflate.so | |
285 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_directory.so | |
286 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_dirlist.so | |
287 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_drop.so | |
288 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_empty_gif.so | |
289 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_error_nn.so | |
290 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_error_redir.so | |
291 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_evhost.so | |
292 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_exists.so | |
293 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_extensions.so | |
294 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_failover.so | |
295 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_fcgi.so | |
296 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_file.so | |
297 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_from.so | |
298 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_fullpath.so | |
299 | %{?with_geoip:%attr(755,root,root) %{_libdir}/cherokee/libplugin_geoip.so} | |
300 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_gzip.so | |
301 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_header.so | |
302 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_htdigest.so | |
303 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_htpasswd.so | |
304 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_ip_hash.so | |
305 | %{?with_ldap:%attr(755,root,root) %{_libdir}/cherokee/libplugin_ldap.so} | |
306 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_libssl.so | |
307 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_method.so | |
308 | %{?with_mysql:%attr(755,root,root) %{_libdir}/cherokee/libplugin_mysql.so} | |
309 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_ncsa.so | |
310 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_not.so | |
311 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_or.so | |
312 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_pam.so | |
313 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_plain.so | |
314 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_post_report.so | |
315 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_post_track.so | |
316 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_proxy.so | |
317 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_redir.so | |
318 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_rehost.so | |
319 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_render_rrd.so | |
320 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_request.so | |
321 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_round_robin.so | |
322 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_rrd.so | |
323 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_scgi.so | |
324 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_secdownload.so | |
325 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_server_info.so | |
326 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_ssi.so | |
327 | %if %{with ffmpeg} | |
328 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_streaming.so | |
329 | %endif | |
330 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_target_ip.so | |
331 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_tls.so | |
332 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_url_arg.so | |
333 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_uwsgi.so | |
334 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_v_or.so | |
335 | %attr(755,root,root) %{_libdir}/cherokee/libplugin_wildcard.so | |
336 | ||
337 | %{_mandir}/man1/cget.1* | |
338 | %{_mandir}/man1/cherokee.1* | |
339 | %{_mandir}/man1/cherokee-tweak.1* | |
340 | %{_mandir}/man1/cherokee-worker.1* | |
341 | ||
342 | %dir %{_datadir}/cherokee | |
343 | %{_datadir}/cherokee/deps | |
344 | %{_datadir}/cherokee/icons | |
345 | %{_datadir}/cherokee/themes | |
346 | ||
347 | %dir %{_wwwhome} | |
348 | %dir %{_wwwroot} | |
349 | %config(missingok) %{_wwwroot}/* | |
350 | ||
351 | %dir %attr(750,cherokee,logs) /var/log/%{name} | |
352 | ||
353 | %dir %attr(771,root,cherokee) /var/lib/%{name} | |
354 | %dir %attr(771,cherokee,cherokee) /var/lib/%{name}/graphs | |
355 | %dir %attr(771,cherokee,cherokee) /var/lib/%{name}/graphs/images | |
356 | ||
357 | %files upstart | |
358 | %defattr(644,root,root,755) | |
359 | %config(noreplace) %verify(not md5 mtime size) /etc/init/%{name}.conf | |
360 | ||
361 | %files admin -f %{name}.lang | |
362 | %defattr(644,root,root,755) | |
363 | %attr(755,root,root) %{_sbindir}/cherokee-admin | |
364 | %attr(755,root,root) %{_bindir}/cherokee-admin-launcher | |
365 | %{_mandir}/man1/cherokee-admin.1* | |
366 | %{_mandir}/man1/cherokee-admin-launcher.1* | |
367 | %dir %{_datadir}/cherokee/admin | |
368 | %{_datadir}/cherokee/admin/cherokee.conf.sample | |
369 | %{_datadir}/cherokee/admin/performance.conf.sample | |
370 | %{_datadir}/cherokee/admin/*.html | |
371 | %attr(755,root,root) %{_datadir}/cherokee/admin/*.py | |
372 | %{_datadir}/cherokee/admin/*.pyc | |
373 | %{_datadir}/cherokee/admin/static | |
374 | %dir %{_datadir}/cherokee/admin/CTK | |
375 | %dir %{_datadir}/cherokee/admin/CTK/CTK | |
376 | %{_datadir}/cherokee/admin/CTK/CTK/*.py | |
377 | %{_datadir}/cherokee/admin/CTK/CTK/*.pyc | |
378 | %{_datadir}/cherokee/admin/CTK/static | |
379 | %dir %{_datadir}/cherokee/admin/plugins | |
380 | %{_datadir}/cherokee/admin/plugins/*.py | |
381 | %{_datadir}/cherokee/admin/plugins/*.pyc | |
382 | %dir %{_datadir}/cherokee/admin/wizards | |
383 | %{_datadir}/cherokee/admin/wizards/*.py | |
384 | %{_datadir}/cherokee/admin/wizards/*.pyc | |
385 | #%dir %{_datadir}/cherokee/admin/market | |
386 | #%{_datadir}/cherokee/admin/market/*.py | |
387 | #%{_datadir}/cherokee/admin/market/*.pyc | |
388 | %dir %{_datadir}/cherokee/admin/icons | |
389 | %{_datadir}/cherokee/admin/icons/*.png | |
390 | %{_datadir}/cherokee/admin/icons/*.svg | |
391 | ||
392 | %files libs | |
393 | %defattr(644,root,root,755) | |
394 | %attr(755,root,root) %{_libdir}/libcherokee-base.so.*.*.* | |
395 | %attr(755,root,root) %ghost %{_libdir}/libcherokee-base.so.0 | |
396 | %attr(755,root,root) %{_libdir}/libcherokee-client.so.*.*.* | |
397 | %attr(755,root,root) %ghost %{_libdir}/libcherokee-client.so.0 | |
398 | %attr(755,root,root) %{_libdir}/libcherokee-server.so.*.*.* | |
399 | %attr(755,root,root) %ghost %{_libdir}/libcherokee-server.so.0 | |
400 | ||
401 | %files devel | |
402 | %defattr(644,root,root,755) | |
403 | %attr(755,root,root) %{_bindir}/cherokee-config | |
404 | %attr(755,root,root) %{_libdir}/libcherokee-base.so | |
405 | %attr(755,root,root) %{_libdir}/libcherokee-client.so | |
406 | %attr(755,root,root) %{_libdir}/libcherokee-server.so | |
407 | %{_libdir}/libcherokee-base.la | |
408 | %{_libdir}/libcherokee-client.la | |
409 | %{_libdir}/libcherokee-server.la | |
410 | %{_includedir}/cherokee | |
411 | %{_pkgconfigdir}/cherokee.pc | |
412 | %{_aclocaldir}/cherokee.m4 | |
413 | %{_mandir}/man1/cherokee-config.1* |