2 # - test ldap and mysql (failed at this time)
3 # - mysql issue: http://www.freebsd.org/cgi/query-pr.cgi?pr=76866
4 # - fam over gamin is possible, just configure doesn't check other than gamin
5 # - feature stat-cache-fam (doesn't work)
8 # - fcgi-devel is only used for the test-scripts
9 # - disable largefile, if you have 2.4 kernel to get sendfile() support, and don't need > 2GB file requests,
10 # see http://article.gmane.org/gmane.comp.web.lighttpd:722
11 # - please make subpackages of modules that depend other modules than:
12 # - pcre (core binary needs it too)
13 # - openssl (core binary needs it too)
15 # Conditional build for lighttpd:
16 %bcond_without xattr # support of extended attributes
17 %bcond_without ipv6 # IPv4-only version (doesn't require IPv6 in kernel)
18 %bcond_without largefile # largefile support (see notes above)
19 %bcond_without ssl # ssl support
20 %bcond_with mysql # mysql support in mod_mysql_vhost
21 %bcond_with ldap # ldap support in mod_auth
22 %bcond_without lua # LUA support in mod_cml
23 %bcond_with memcache # memcached support in mod_cml / mod_trigger_b4_dl
24 %bcond_with gamin # gamin for reducing number of stat() calls.
25 # NOTE: must be enabled in config: server.stat-cache-engine = "fam"
26 %bcond_with gdbm # gdbm in mod_trigger_b4_dl
27 %bcond_with webdav_props # properties in mod_webdav (includes extra sqlite3/libxml deps)
28 %bcond_with valgrind # compile code with valgrind support.
30 # Prerelease snapshot: DATE-TIME
31 #define _snap 20060104-1523
34 %define _source http://www.lighttpd.net/download/%{name}-%{version}-%{_snap}.tar.gz
36 %define _source http://www.lighttpd.net/download/%{name}-%{version}.tar.gz
41 Summary: Fast and light HTTP server
42 Summary(pl): Szybki i lekki serwer HTTP
45 Release: %{_rel}%{?_snap:.%(echo %{_snap}|tr - _)}
47 Group: Networking/Daemons
49 # Source0-md5: f55eebb9815c94a7de35906bb557ecd3
53 Source4: %{name}.logrotate
54 Source5: %{name}.sysconfig
55 Source6: %{name}-mime.types.sh
56 Source7: http://www.lighttpd.net/favicon.ico
57 # Source7-md5: a358994becabd4060393a5454bde505d
58 Source8: http://www.lighttpd.net/light_button.png
59 # Source8-md5: 02330e2313fadc29144edfd6000879f8
60 Source9: http://www.lighttpd.net/light_logo.png
61 # Source9-md5: ac20784510e420d5cbe5fc1cdb53d7a7
62 Source10: http://gdl.hopto.org/~spider/pldstats/gfx/pld1.png
63 # Source10-md5: 486ecec3f6f4fe7f9bf7cee757b864f4
64 Source11: %{name}-pld.html
65 Patch0: %{name}-mod_deflate.patch
66 Patch1: %{name}-use_bin_sh.patch
67 Patch2: %{name}-initgroups.patch
68 URL: http://www.lighttpd.net/
69 %{?with_xattr:BuildRequires: attr-devel}
70 BuildRequires: autoconf
71 BuildRequires: automake
72 BuildRequires: bzip2-devel
73 %{?with_gamin:BuildRequires: gamin-devel}
74 %{?with_gdbm:BuildRequires: gdbm-devel}
75 %{?with_memcache:BuildRequires: libmemcache-devel}
76 BuildRequires: libtool
77 %{?with_webdav_props:BuildRequires: libxml2-devel}
78 %{?with_lua:BuildRequires: lua50-devel >= 5.0.2-5.1}
79 BuildRequires: mailcap >= 2.1.14-4.4
80 %{?with_mysql:BuildRequires: mysql-devel}
81 %{?with_ldap:BuildRequires: openldap-devel}
82 %{?with_ssl:BuildRequires: openssl-devel}
83 BuildRequires: pcre-devel
84 BuildRequires: pkgconfig
85 BuildRequires: rpmbuild(macros) >= 1.268
86 %{?with_webdav_props:BuildRequires: sqlite3-devel}
87 %{?with_valgrind:BuildRequires: valgrind}
88 BuildRequires: zlib-devel
89 Requires(post,preun): /sbin/chkconfig
90 Requires(postun): /usr/sbin/groupdel
91 Requires(postun): /usr/sbin/userdel
92 Requires(pre): /bin/id
93 Requires(pre): /usr/bin/getgid
94 Requires(pre): /usr/sbin/groupadd
95 Requires(pre): /usr/sbin/useradd
98 Provides: group(lighttpd)
99 Provides: user(lighttpd)
101 # for the posttrans scriptlet, conflicts because in vserver environment rpm package is not installed.
102 Conflicts: rpm < 4.4.2-0.2
103 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
105 %define _libdir %{_prefix}/%{_lib}/%{name}
106 %define _lighttpddir /home/services/%{name}
107 %define _sysconfdir /etc/%{name}
110 lighttpd is a secure, fast, compliant and very flexible web-server
111 which has been optimized for high-performance environments. It has a
112 very low memory footprint compared to other webservers and takes care
113 of cpu-load. Its advanced feature-set (FastCGI, CGI, Auth,
114 Output-Compression, URL-Rewriting and many more) make lighttpd the
115 perfect webserver-software for every server that is suffering load
119 lighttpd jest bezpiecznym, szybkim, przyjaznym i bardzo elastycznym
120 serwerem WWW, który zosta³ zoptymalizowany pod k±tem
121 wysokowydajno¶ciowych ¶rodowisk. Zajmuje bardzo ma³± ilo¶æ pamiêci w
122 porównaniu do innych serwerów WWW oraz dba o zajêto¶æ procesora.
123 Szeroki zestaw opcji (FastCGI, CGI, uwierzytelnianie, kompresja
124 wyj¶cia, przepisywanie URL-i i wiele innych) czyni± z lighttpd
125 doskona³e oprogramowanie web-serwerowe na ka¿dy serwer cierpi±cy z
126 powodu problemów z obci±¿eniem.
128 %package mod_compress
129 Summary: Output Compression
130 Summary(pl): Kompresja wyj¶cia
131 Group: Networking/Daemons
132 URL: http://www.lighttpd.net/documentation/compress.html
133 Requires: %{name} = %{version}-%{release}
135 %description mod_compress
136 Output compression reduces the network load and can improve the
137 overall throughput of the webserver.
139 Only static content is supported up to now.
141 The server negotiates automatically which compression method is used.
142 Supported are gzip, deflate, bzip.
144 %description mod_compress -l pl
145 Kompresja wyj¶cia zmniejsza obci±¿enie sieci i mo¿e poprawiæ ca³kowit±
146 przepustowo¶æ serwera WWW.
148 Jak na razie obs³ugiwana jest tylko statyczna tre¶æ.
150 Serwer automatycznie negocjuje, która metoda kompresji jest u¿ywana.
151 Obs³ugiwane s± gzip, deflate i bzip.
154 Summary: Cache Meta Language module
155 Summary(pl): Modu³ Cache Meta Language
156 Group: Networking/Daemons
157 URL: http://www.lighttpd.net/documentation/cml.html
158 Requires: %{name} = %{version}-%{release}
161 CML is a Meta language to describe the dependencies of a page at one
162 side and building a page from its fragments on the other side using
165 %description mod_cml -l pl
166 CML to metajêzyk s³u¿±cy z jednej strony do opisu zale¿no¶ci strony i
167 z drugiej strony do budowania strony z fragmentów przy u¿yciu LUA.
169 %package mod_mysql_vhost
170 Summary: MySQL based vhosting
171 Summary(pl): vhosty oparte na MySQL-u
172 Group: Networking/Daemons
173 URL: http://www.lighttpd.net/documentation/mysqlvhost.html
174 Requires: %{name} = %{version}-%{release}
176 %description mod_mysql_vhost
177 This module provides virtual hosts (vhosts) based on a MySQL table.
179 %description mod_mysql_vhost -l pl
180 Ten modu³ udostêpnia wirtualne hosty (vhosty) oparte na tabeli MySQL.
182 %package mod_trigger_b4_dl
183 Summary: Trigger before Download
184 Summary(pl): Wyzwalacz przed ¶ci±ganiem
185 Group: Networking/Daemons
186 URL: http://www.lighttpd.net/documentation/trigger_b4_dl.html
187 Requires: %{name} = %{version}-%{release}
189 %description mod_trigger_b4_dl
190 Another anti hot-linking module.
192 %description mod_trigger_b4_dl -l pl
193 Jeszcze jeden modu³ blokuj±cy bezpo¶rednie linkowanie.
196 Summary: WebDAV module for lighttpd
197 Summary(pl): Modu³ WebDAV dla libghttpd
198 Group: Networking/Daemons
199 URL: http://www.lighttpd.net/documentation/webdav.html
200 Requires: %{name} = %{version}-%{release}
202 %description mod_webdav
203 The WebDAV module is a very minimalistic implementation of RFC 2518.
204 Minimalistic means that not all operations are implementated yet.
213 and the usual GET, POST, HEAD from HTTP/1.1.
215 So far mounting a webdav resource into Windows XP works and the basic
216 litmus tests are passed.
218 %description mod_webdav -l pl
219 Modu³ WebDAV to bardzo minimalistyczna implementacja RFC 2518.
220 Minimalistyczna oznacza, ¿e jeszcze nie wszystkie operacje s±
221 zaimplementowane. Jak na razie s±:
227 oraz zwyk³e GET, POST, HEAD z HTTP/1.1.
229 Jak na razie montowanie zasobu webdav pod Windows XP dzia³a i
230 podstawowe testy lakmusowe przechodz±.
232 %package -n spawn-fcgi
233 Summary: Spawn fcgi-process directly
234 Summary(pl): Bezpo¶rednie uruchamianie procesów fcgi
237 %description -n spawn-fcgi
238 spawn-fcgi is used to spawn fcgi-process directly without the help of
239 a webserver or the programm itself.
241 %description -n spawn-fcgi -l pl
242 spawn-fcgi s³u¿y do uruchamiania procesów fcgi bezpo¶rednio, bez
243 pomocy serwera WWW ani samego programu.
250 install %{SOURCE6} mime.types.sh
252 # build mime.types.conf
253 ./mime.types.sh /etc/mime.types
262 %{!?with_ipv6:--disable-ipv6} \
263 %{!?with_largefile:--disable-lfs} \
264 %{?with_valgrind:--with-valgrind} \
265 %{?with_xattr:--with-attr} \
266 %{?with_mysql:--with-mysql} \
267 %{?with_ldap:--with-ldap} \
268 %{?with_ssl:--with-openssl} \
269 %{?with_lua:--with-lua} \
270 %{?with_memcache:--with-memcache} \
271 %{?with_webdav_props:--with-webdav-props} \
272 %{?with_gamin:--with-gamin} \
273 %{?with_gdbm:--with-gdbm}
278 rm -rf $RPM_BUILD_ROOT
279 install -d $RPM_BUILD_ROOT{%{_lighttpddir}/{cgi-bin,html},/etc/{logrotate.d,rc.d/init.d,sysconfig}} \
280 $RPM_BUILD_ROOT%{_sysconfdir}/webapps.d \
281 $RPM_BUILD_ROOT{/var/log/{%{name},archiv/%{name}},/var/run/%{name}}
284 DESTDIR=$RPM_BUILD_ROOT
286 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
287 install %{SOURCE2} %{SOURCE3} mime.types.conf $RPM_BUILD_ROOT%{_sysconfdir}
288 install %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
289 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
291 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
293 # could use automake patch, but automake generation fails...
294 mv $RPM_BUILD_ROOT%{_bindir}/spawn-fcgi $RPM_BUILD_ROOT%{_sbindir}/spawn-fcgi
297 rm -f $RPM_BUILD_ROOT%{_libdir}/mod_mysql_vhost.so
300 # Install lighttpd images
301 install %{SOURCE7} %{SOURCE8} %{SOURCE9} $RPM_BUILD_ROOT%{_lighttpddir}/html
302 install %{SOURCE10} $RPM_BUILD_ROOT%{_lighttpddir}/html/pld_button.png
303 install %{SOURCE11} $RPM_BUILD_ROOT%{_lighttpddir}/html/index.html
306 rm -rf $RPM_BUILD_ROOT
309 %groupadd -g 109 lighttpd
311 %useradd -u 116 -d %{_lighttpddir} -c "LigHTTPd User" -g lighttpd lighttpd
312 %addusertogroup lighttpd http
315 /sbin/chkconfig --add %{name}
318 if [ "$1" = "0" ]; then
319 %service %{name} stop
320 /sbin/chkconfig --del %{name}
324 if [ "$1" = "0" ]; then
326 %groupremove lighttpd
331 # minimizing lighttpd restarts logics. we restart webserver:
333 # 1. at the end of transaction. (posttrans, feature from rpm 4.4.2)
334 # 2. first install of module (post: $1 = 1)
335 # 2. uninstall of module (postun: $1 == 0)
337 # the strict internal deps between lighttpd modules and
338 # main package are very important for all this to work.
339 %service %{name} restart "LigHTTPd webserver"
342 # macro called at module post scriptlet
343 %define module_post \
344 if [ "$1" = "1" ]; then \
345 %service -q lighttpd restart \
348 # macro called at module postun scriptlet
349 %define module_postun \
350 if [ "$1" = "0" ]; then \
351 %service -q lighttpd restart \
354 # it's sooo annoying to write them
355 %define module_scripts() \
362 %module_scripts mod_compress
363 %module_scripts mod_cml
364 %module_scripts mod_mysql_vhost
365 %module_scripts mod_trigger_b4_dl
366 %module_scripts mod_webdav
368 %triggerpostun -- %{name} <= 1.3.6-2
370 if [ "$1" = "2" ]; then
371 %banner %{name} -e <<EOF
372 spawn-fcgi program is now available separately from spawn-fcgi package.
378 %defattr(644,root,root,755)
379 %doc NEWS README ChangeLog doc/lighttpd.conf doc/*.txt doc/rrdtool-graph.sh
380 %dir %attr(750,root,lighttpd) %{_sysconfdir}
381 %dir %attr(750,root,root) %{_sysconfdir}/webapps.d
382 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
383 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mime.types.conf
384 %attr(640,root,lighttpd) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.user
386 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
387 %attr(750,root,root) %dir /var/log/archiv/%{name}
388 %dir %attr(770,root,lighttpd) /var/log/%{name}
389 %dir %attr(770,root,lighttpd) /var/run/%{name}
390 %attr(754,root,root) /etc/rc.d/init.d/%{name}
391 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/*
392 %attr(755,root,root) %{_sbindir}/*
394 %attr(755,root,root) %{_libdir}/mod_access.so
395 %attr(755,root,root) %{_libdir}/mod_accesslog.so
396 %attr(755,root,root) %{_libdir}/mod_alias.so
397 %attr(755,root,root) %{_libdir}/mod_auth.so
398 %attr(755,root,root) %{_libdir}/mod_cgi.so
399 %attr(755,root,root) %{_libdir}/mod_deflate.so
400 %attr(755,root,root) %{_libdir}/mod_dirlisting.so
401 %attr(755,root,root) %{_libdir}/mod_evasive.so
402 %attr(755,root,root) %{_libdir}/mod_evhost.so
403 %attr(755,root,root) %{_libdir}/mod_expire.so
404 %attr(755,root,root) %{_libdir}/mod_fastcgi.so
405 %attr(755,root,root) %{_libdir}/mod_flv_streaming.so
406 %attr(755,root,root) %{_libdir}/mod_indexfile.so
407 %attr(755,root,root) %{_libdir}/mod_proxy.so
408 %attr(755,root,root) %{_libdir}/mod_redirect.so
409 %attr(755,root,root) %{_libdir}/mod_rewrite.so
410 %attr(755,root,root) %{_libdir}/mod_rrdtool.so
411 %attr(755,root,root) %{_libdir}/mod_scgi.so
412 %attr(755,root,root) %{_libdir}/mod_secdownload.so
413 %attr(755,root,root) %{_libdir}/mod_setenv.so
414 %attr(755,root,root) %{_libdir}/mod_simple_vhost.so
415 %attr(755,root,root) %{_libdir}/mod_ssi.so
416 %attr(755,root,root) %{_libdir}/mod_staticfile.so
417 %attr(755,root,root) %{_libdir}/mod_status.so
418 %attr(755,root,root) %{_libdir}/mod_userdir.so
419 %attr(755,root,root) %{_libdir}/mod_usertrack.so
423 %dir %{_lighttpddir}/cgi-bin
424 %dir %{_lighttpddir}/html
425 %{_lighttpddir}/html/*
428 %defattr(644,root,root,755)
429 %attr(755,root,root) %{_libdir}/mod_compress.so
432 %defattr(644,root,root,755)
433 %attr(755,root,root) %{_libdir}/mod_cml.so
436 %files mod_mysql_vhost
437 %defattr(644,root,root,755)
438 %attr(755,root,root) %{_libdir}/mod_mysql_vhost.so
441 %files mod_trigger_b4_dl
442 %defattr(644,root,root,755)
443 %attr(755,root,root) %{_libdir}/mod_trigger_b4_dl.so
446 %defattr(644,root,root,755)
447 %attr(755,root,root) %{_libdir}/mod_webdav.so
450 %defattr(644,root,root,755)
451 %doc doc/spawn-php.sh
452 %attr(755,root,root) %{_sbindir}/spawn-fcgi