3 # - think about moving modules to subpackages. At least, those with extra
5 # - maybe there is no need to pack *.py (are *.pyc enough?)
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
13 Summary: Fast, Flexible and Lightweight Web server
14 Summary(pl.UTF-8): Cherokee - serwer WWW
19 Group: Networking/Daemons
20 Source0: https://github.com/cherokee/webserver/archive/v%{version}.zip
21 # Source0-md5: 1f4fe0f0317c07b93c9cbbf4f843e724
22 # the last snapshot from https://github.com/cherokee/CTK
23 Source1: CTK-20120806.tar.xz
24 # Source1-md5: 567f087cd6cdf10b89047535cbe94f8e
26 Source3: %{name}.sysconfig
27 Source4: %{name}.service
28 Patch0: %{name}-config.patch
29 Patch1: %{name}-panic_path.patch
30 Patch2: ffmpeg0.11.patch
31 Patch3: time_t_x32.patch
33 URL: http://www.cherokee-project.com/
34 %{?with_geoip:BuildRequires: GeoIP-devel}
35 BuildRequires: autoconf
36 BuildRequires: automake
37 %{?with_ffmpeg:BuildRequires: ffmpeg-devel >= 1.0}
38 BuildRequires: gettext-tools
39 BuildRequires: libtool
40 %{?with_mysql:BuildRequires: mysql-devel}
41 %{?with_ldap:BuildRequires: openldap-devel}
42 BuildRequires: openssl-devel
43 BuildRequires: pam-devel
44 BuildRequires: pcre-devel
45 BuildRequires: php(fcgi)
46 BuildRequires: pkgconfig
47 BuildRequires: python-docutils
48 BuildRequires: rpm-pythonprov
49 BuildRequires: rpmbuild(macros) >= 1.647
50 BuildRequires: zlib-devel
51 Requires(post,preun): /sbin/chkconfig
52 Requires(postun): /usr/sbin/groupdel
53 Requires(postun): /usr/sbin/userdel
54 Requires(pre): /bin/id
55 Requires(pre): /usr/bin/getgid
56 Requires(pre): /usr/sbin/groupadd
57 Requires(pre): /usr/sbin/useradd
58 Requires: %{name}-libs = %{version}-%{release}
59 Requires: rc-scripts >= 0.4.3.0
60 Requires: systemd-units >= 38
61 Suggests: %{name}-admin = %{version}-%{release}
63 Provides: group(cherokee)
65 Provides: user(cherokee)
67 Provides: webserver(indexfile)
68 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
70 %define _sysconfdir /etc/cherokee
71 %define _wwwhome /home/services/%{name}
72 %define _wwwroot %{_wwwhome}/html
75 Cherokee is a flexible, very fast, lightweight Web server. It is
76 implemented entirely in C, and has no dependencies beyond a standard C
77 library. It is embeddable and extensible with plug-ins. It supports
78 on-the-fly configuration by reading files or strings, TLS/SSL via
79 OpenSSL, virtual hosts, authentication, cache friendly features, PHP,
80 custom error management, and much more.
82 %description -l pl.UTF-8
83 Cherokee to elastyczny, bardzo szybki i lekki serwer WWW. Jest
84 zaimplementowany całkowicie w C i nie ma zależności poza standardową
85 biblioteką C. Jest osadzalny i rozbudowywalny poprzez wtyczki.
86 Obsługuje konfigurację w locie poprzez odczyt plików lub łańcuchów
87 znaków, TLS/SSL poprzez OpenSSL, hosty wirtualne, uwierzytelnianie,
88 opcje związane z pamięcią podręczną, PHP, własne zarządzanie błędami i
92 Summary: Cherokee web server administration interface
93 Summary(pl.UTF-8): Interfejs administracyjny serwera WWW Cherokee
94 Group: Networking/Daemons
95 Requires: %{name} = %{version}-%{release}
97 Requires: python-modules
100 Cherokee web server administration interface.
102 %description admin -l pl.UTF-8
103 Interfejs administracyjny serwera WWW Cherokee.
106 Summary: Header files for Cherokee web server
107 Summary(pl.UTF-8): Pliki nagłówkowe dla serwera WWW Cherokee
108 Group: Development/Libraries
109 Requires: %{name}-libs = %{version}-%{release}
112 Header files for Cherokee web server.
114 %description devel -l pl.UTF-8
115 Pliki nagłówkowe dla serwera WWW Cherokee.
118 Summary: Cherokee web server libraries
119 Summary(pl.UTF-8): Biblioteki serwera WWW Cherokee
123 Cherokee web server libraries.
125 %description libs -l pl.UTF-8
126 Biblioteki serwera WWW Cherokee.
129 %setup -qn webserver-%{version} -a1
136 %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python2(\s|$),#!%{__python}\1,' -e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python}\1,' \
137 admin/CTK/CTK-run.pre \
139 admin/upgrade_config.py \
140 cherokee/cherokee-admin-launcher \
141 cherokee/cherokee-tweak
149 po/admin/generate_POTFILESin.py > po/admin/POTFILES.in
151 --with-php=/usr/bin/php.cgi \
153 --enable-os-string="PLD Linux" \
155 --with-wwwroot=%{_wwwroot} \
156 --with-wwwuser=cherokee \
157 --with-wwwgroup=http \
158 %{!?with_geoip:--without-geoip} \
159 %{!?with_mysql:--without-mysql} \
160 %{!?with_ffmpeg:--without-ffmpeg} \
161 %{!?with_ldap:--without-ldap}
163 # workaround for missing pot file and no way to build it
164 touch po/admin/cherokee.pot
170 rm -rf $RPM_BUILD_ROOT
171 install -d $RPM_BUILD_ROOT/etc/{pam.d,sysconfig,rc.d/init.d} \
172 $RPM_BUILD_ROOT/var/log/%{name} \
173 $RPM_BUILD_ROOT%{systemdunitdir}
175 %{__make} -j1 install \
176 DESTDIR=$RPM_BUILD_ROOT
178 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
179 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
180 install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/cherokee.service
182 # users don't need this
183 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/cherokee-panic
185 # modules dlopened by *.so
186 rm -f $RPM_BUILD_ROOT%{_libdir}/cherokee/lib*.la
190 mv $RPM_BUILD_ROOT%{_docdir}/%{name} html
193 rm $RPM_BUILD_ROOT/etc/cherokee/cherokee.conf.perf_sample
195 # compile python modules, otherwise *.pyc may get generated on runtime
196 # and stay after package removal
197 %py_comp $RPM_BUILD_ROOT%{_datadir}/cherokee/admin/
199 # seems like this is not needed on Linux
200 rm $RPM_BUILD_ROOT%{_bindir}/cherokee-macos-askpass
202 mv $RPM_BUILD_ROOT%{_localedir}/{sv_SE,sv}
207 rm -rf $RPM_BUILD_ROOT
210 %groupadd -g 161 cherokee
212 %useradd -u 161 -d %{_wwwhome} -c "Cherokee User" -g cherokee cherokee
213 %addusertogroup cherokee http
216 if [ "$1" = "2" -a -e %{_sysconfdir}/cherokee.conf ]; then
217 %{_datadir}/%{name}/admin/upgrade_config.py %{_sysconfdir}/cherokee.conf
219 /sbin/chkconfig --add %{name}
220 %service %{name} restart "Cherokee webserver"
221 %systemd_post %{name}.service
224 if [ "$1" = "0" ]; then
225 %service %{name} stop
226 /sbin/chkconfig --del %{name}
228 %systemd_preun %{name}.service
231 if [ "$1" = "0" ]; then
233 %groupremove cherokee
238 %triggerpostun -- %{name} < 1.2.103-1
239 %systemd_trigger %{name}.service
241 %post libs -p /sbin/ldconfig
242 %postun libs -p /sbin/ldconfig
245 %defattr(644,root,root,755)
246 %doc AUTHORS html performance.conf.sample
247 %dir %attr(750,root,root) %{_sysconfdir}
248 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/cherokee.conf
250 %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/cherokee
251 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cherokee
252 %attr(754,root,root) /etc/rc.d/init.d/cherokee
253 %{systemdunitdir}/%{name}.service
255 %attr(755,root,root) %{_bindir}/CTK-run
256 %attr(755,root,root) %{_bindir}/cget
257 %attr(755,root,root) %{_bindir}/cherokee-tweak
258 %attr(755,root,root) %{_sbindir}/cherokee
259 %attr(755,root,root) %{_sbindir}/cherokee-panic
260 %attr(755,root,root) %{_sbindir}/cherokee-worker
262 %dir %{_libdir}/cherokee
263 %attr(755,root,root) %{_libdir}/cherokee/libplugin_admin.so
264 %attr(755,root,root) %{_libdir}/cherokee/libplugin_and.so
265 %attr(755,root,root) %{_libdir}/cherokee/libplugin_authlist.so
266 %attr(755,root,root) %{_libdir}/cherokee/libplugin_bind.so
267 %attr(755,root,root) %{_libdir}/cherokee/libplugin_cgi.so
268 %attr(755,root,root) %{_libdir}/cherokee/libplugin_combined.so
269 %attr(755,root,root) %{_libdir}/cherokee/libplugin_common.so
270 %attr(755,root,root) %{_libdir}/cherokee/libplugin_custom_error.so
271 %attr(755,root,root) %{_libdir}/cherokee/libplugin_custom.so
272 %{?with_mysql:%attr(755,root,root) %{_libdir}/cherokee/libplugin_dbslayer.so}
273 %attr(755,root,root) %{_libdir}/cherokee/libplugin_deflate.so
274 %attr(755,root,root) %{_libdir}/cherokee/libplugin_directory.so
275 %attr(755,root,root) %{_libdir}/cherokee/libplugin_dirlist.so
276 %attr(755,root,root) %{_libdir}/cherokee/libplugin_drop.so
277 %attr(755,root,root) %{_libdir}/cherokee/libplugin_empty_gif.so
278 %attr(755,root,root) %{_libdir}/cherokee/libplugin_error_nn.so
279 %attr(755,root,root) %{_libdir}/cherokee/libplugin_error_redir.so
280 %attr(755,root,root) %{_libdir}/cherokee/libplugin_evhost.so
281 %attr(755,root,root) %{_libdir}/cherokee/libplugin_exists.so
282 %attr(755,root,root) %{_libdir}/cherokee/libplugin_extensions.so
283 %attr(755,root,root) %{_libdir}/cherokee/libplugin_failover.so
284 %attr(755,root,root) %{_libdir}/cherokee/libplugin_fcgi.so
285 %attr(755,root,root) %{_libdir}/cherokee/libplugin_file.so
286 %attr(755,root,root) %{_libdir}/cherokee/libplugin_from.so
287 %attr(755,root,root) %{_libdir}/cherokee/libplugin_fullpath.so
288 %{?with_geoip:%attr(755,root,root) %{_libdir}/cherokee/libplugin_geoip.so}
289 %attr(755,root,root) %{_libdir}/cherokee/libplugin_gzip.so
290 %attr(755,root,root) %{_libdir}/cherokee/libplugin_header.so
291 %attr(755,root,root) %{_libdir}/cherokee/libplugin_htdigest.so
292 %attr(755,root,root) %{_libdir}/cherokee/libplugin_htpasswd.so
293 %attr(755,root,root) %{_libdir}/cherokee/libplugin_ip_hash.so
294 %{?with_ldap:%attr(755,root,root) %{_libdir}/cherokee/libplugin_ldap.so}
295 %attr(755,root,root) %{_libdir}/cherokee/libplugin_libssl.so
296 %attr(755,root,root) %{_libdir}/cherokee/libplugin_method.so
297 %{?with_mysql:%attr(755,root,root) %{_libdir}/cherokee/libplugin_mysql.so}
298 %attr(755,root,root) %{_libdir}/cherokee/libplugin_ncsa.so
299 %attr(755,root,root) %{_libdir}/cherokee/libplugin_not.so
300 %attr(755,root,root) %{_libdir}/cherokee/libplugin_or.so
301 %attr(755,root,root) %{_libdir}/cherokee/libplugin_pam.so
302 %attr(755,root,root) %{_libdir}/cherokee/libplugin_plain.so
303 %attr(755,root,root) %{_libdir}/cherokee/libplugin_post_report.so
304 %attr(755,root,root) %{_libdir}/cherokee/libplugin_post_track.so
305 %attr(755,root,root) %{_libdir}/cherokee/libplugin_proxy.so
306 %attr(755,root,root) %{_libdir}/cherokee/libplugin_redir.so
307 %attr(755,root,root) %{_libdir}/cherokee/libplugin_rehost.so
308 %attr(755,root,root) %{_libdir}/cherokee/libplugin_render_rrd.so
309 %attr(755,root,root) %{_libdir}/cherokee/libplugin_request.so
310 %attr(755,root,root) %{_libdir}/cherokee/libplugin_round_robin.so
311 %attr(755,root,root) %{_libdir}/cherokee/libplugin_rrd.so
312 %attr(755,root,root) %{_libdir}/cherokee/libplugin_scgi.so
313 %attr(755,root,root) %{_libdir}/cherokee/libplugin_secdownload.so
314 %attr(755,root,root) %{_libdir}/cherokee/libplugin_server_info.so
315 %attr(755,root,root) %{_libdir}/cherokee/libplugin_ssi.so
317 %attr(755,root,root) %{_libdir}/cherokee/libplugin_streaming.so
319 %attr(755,root,root) %{_libdir}/cherokee/libplugin_target_ip.so
320 %attr(755,root,root) %{_libdir}/cherokee/libplugin_tls.so
321 %attr(755,root,root) %{_libdir}/cherokee/libplugin_url_arg.so
322 %attr(755,root,root) %{_libdir}/cherokee/libplugin_uwsgi.so
323 %attr(755,root,root) %{_libdir}/cherokee/libplugin_v_or.so
324 %attr(755,root,root) %{_libdir}/cherokee/libplugin_wildcard.so
326 %{_mandir}/man1/cget.1*
327 %{_mandir}/man1/cherokee.1*
328 %{_mandir}/man1/cherokee-tweak.1*
329 %{_mandir}/man1/cherokee-worker.1*
331 %dir %{_datadir}/cherokee
332 %{_datadir}/cherokee/deps
333 %{_datadir}/cherokee/icons
334 %{_datadir}/cherokee/themes
338 %config(missingok) %{_wwwroot}/*
340 %dir %attr(750,cherokee,logs) /var/log/%{name}
342 %dir %attr(771,root,cherokee) /var/lib/%{name}
343 %dir %attr(771,cherokee,cherokee) /var/lib/%{name}/graphs
344 %dir %attr(771,cherokee,cherokee) /var/lib/%{name}/graphs/images
346 %files admin -f %{name}.lang
347 %defattr(644,root,root,755)
348 %attr(755,root,root) %{_sbindir}/cherokee-admin
349 %attr(755,root,root) %{_bindir}/cherokee-admin-launcher
350 %{_mandir}/man1/cherokee-admin.1*
351 %{_mandir}/man1/cherokee-admin-launcher.1*
352 %dir %{_datadir}/cherokee/admin
353 %{_datadir}/cherokee/admin/cherokee.conf.sample
354 %{_datadir}/cherokee/admin/performance.conf.sample
355 %{_datadir}/cherokee/admin/*.html
356 %attr(755,root,root) %{_datadir}/cherokee/admin/*.py
357 %{_datadir}/cherokee/admin/*.pyc
358 %{_datadir}/cherokee/admin/static
359 %dir %{_datadir}/cherokee/admin/CTK
360 %dir %{_datadir}/cherokee/admin/CTK/CTK
361 %{_datadir}/cherokee/admin/CTK/CTK/*.py
362 %{_datadir}/cherokee/admin/CTK/CTK/*.pyc
363 %{_datadir}/cherokee/admin/CTK/static
364 %dir %{_datadir}/cherokee/admin/plugins
365 %{_datadir}/cherokee/admin/plugins/*.py
366 %{_datadir}/cherokee/admin/plugins/*.pyc
367 %dir %{_datadir}/cherokee/admin/wizards
368 %{_datadir}/cherokee/admin/wizards/*.py
369 %{_datadir}/cherokee/admin/wizards/*.pyc
370 #%dir %{_datadir}/cherokee/admin/market
371 #%{_datadir}/cherokee/admin/market/*.py
372 #%{_datadir}/cherokee/admin/market/*.pyc
373 %dir %{_datadir}/cherokee/admin/icons
374 %{_datadir}/cherokee/admin/icons/*.png
375 %{_datadir}/cherokee/admin/icons/*.svg
378 %defattr(644,root,root,755)
379 %attr(755,root,root) %{_libdir}/libcherokee-base.so.*.*.*
380 %attr(755,root,root) %ghost %{_libdir}/libcherokee-base.so.0
381 %attr(755,root,root) %{_libdir}/libcherokee-client.so.*.*.*
382 %attr(755,root,root) %ghost %{_libdir}/libcherokee-client.so.0
383 %attr(755,root,root) %{_libdir}/libcherokee-server.so.*.*.*
384 %attr(755,root,root) %ghost %{_libdir}/libcherokee-server.so.0
387 %defattr(644,root,root,755)
388 %attr(755,root,root) %{_bindir}/cherokee-config
389 %attr(755,root,root) %{_libdir}/libcherokee-base.so
390 %attr(755,root,root) %{_libdir}/libcherokee-client.so
391 %attr(755,root,root) %{_libdir}/libcherokee-server.so
392 %{_libdir}/libcherokee-base.la
393 %{_libdir}/libcherokee-client.la
394 %{_libdir}/libcherokee-server.la
395 %{_includedir}/cherokee
396 %{_pkgconfigdir}/cherokee.pc
397 %{_aclocaldir}/cherokee.m4
398 %{_mandir}/man1/cherokee-config.1*