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: 51e42c2cc98a1f9986b9f232ff5a01f2
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}-memory_leak.patch
67 URL: http://www.lighttpd.net/
68 %{?with_xattr:BuildRequires: attr-devel}
69 BuildRequires: autoconf
70 BuildRequires: automake
71 BuildRequires: bzip2-devel
72 %{?with_gamin:BuildRequires: gamin-devel}
73 %{?with_gdbm:BuildRequires: gdbm-devel}
74 %{?with_memcache:BuildRequires: libmemcache-devel}
75 BuildRequires: libtool
76 %{?with_webdav_props:BuildRequires: libxml2-devel}
77 %{?with_lua:BuildRequires: lua50-devel >= 5.0.2-5.1}
78 BuildRequires: mailcap >= 2.1.14-4.4
79 %{?with_mysql:BuildRequires: mysql-devel}
80 %{?with_ldap:BuildRequires: openldap-devel}
81 %{?with_ssl:BuildRequires: openssl-devel}
82 BuildRequires: pcre-devel
83 BuildRequires: pkgconfig
84 BuildRequires: rpmbuild(macros) >= 1.268
85 %{?with_webdav_props:BuildRequires: sqlite3-devel}
86 %{?with_valgrind:BuildRequires: valgrind}
87 BuildRequires: zlib-devel
88 Requires(post,preun): /sbin/chkconfig
89 Requires(postun): /usr/sbin/groupdel
90 Requires(postun): /usr/sbin/userdel
91 Requires(pre): /bin/id
92 Requires(pre): /usr/bin/getgid
93 Requires(pre): /usr/sbin/groupadd
94 Requires(pre): /usr/sbin/useradd
97 Provides: group(lighttpd)
98 Provides: user(lighttpd)
100 # for the posttrans scriptlet, conflicts because in vserver environment rpm package is not installed.
101 Conflicts: rpm < 4.4.2-0.2
102 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
104 %define _libdir %{_prefix}/%{_lib}/%{name}
105 %define _lighttpddir /home/services/%{name}
106 %define _sysconfdir /etc/%{name}
109 lighttpd is a secure, fast, compliant and very flexible web-server
110 which has been optimized for high-performance environments. It has a
111 very low memory footprint compared to other webservers and takes care
112 of cpu-load. Its advanced feature-set (FastCGI, CGI, Auth,
113 Output-Compression, URL-Rewriting and many more) make lighttpd the
114 perfect webserver-software for every server that is suffering load
118 lighttpd jest bezpiecznym, szybkim, przyjaznym i bardzo elastycznym
119 serwerem WWW, który zosta³ zoptymalizowany pod k±tem
120 wysokowydajno¶ciowych ¶rodowisk. Zajmuje bardzo ma³± ilo¶æ pamiêci w
121 porównaniu do innych serwerów WWW oraz dba o zajêto¶æ procesora.
122 Szeroki zestaw opcji (FastCGI, CGI, uwierzytelnianie, kompresja
123 wyj¶cia, przepisywanie URL-i i wiele innych) czyni± z lighttpd
124 doskona³e oprogramowanie web-serwerowe na ka¿dy serwer cierpi±cy z
125 powodu problemów z obci±¿eniem.
127 %package mod_compress
128 Summary: Output Compression
129 Summary(pl): Kompresja wyj¶cia
130 Group: Networking/Daemons
131 URL: http://www.lighttpd.net/documentation/compress.html
132 Requires: %{name} = %{version}-%{release}
134 %description mod_compress
135 Output compression reduces the network load and can improve the
136 overall throughput of the webserver.
138 Only static content is supported up to now.
140 The server negotiates automatically which compression method is used.
141 Supported are gzip, deflate, bzip.
143 %description mod_compress -l pl
144 Kompresja wyj¶cia zmniejsza obci±¿enie sieci i mo¿e poprawiæ ca³kowit±
145 przepustowo¶æ serwera WWW.
147 Jak na razie obs³ugiwana jest tylko statyczna tre¶æ.
149 Serwer automatycznie negocjuje, która metoda kompresji jest u¿ywana.
150 Obs³ugiwane s± gzip, deflate i bzip.
153 Summary: Cache Meta Language module
154 Summary(pl): Modu³ Cache Meta Language
155 Group: Networking/Daemons
156 URL: http://www.lighttpd.net/documentation/cml.html
157 Requires: %{name} = %{version}-%{release}
160 CML is a Meta language to describe the dependencies of a page at one
161 side and building a page from its fragments on the other side using
164 %description mod_cml -l pl
165 CML to metajêzyk s³u¿±cy z jednej strony do opisu zale¿no¶ci strony i
166 z drugiej strony do budowania strony z fragmentów przy u¿yciu LUA.
168 %package mod_mysql_vhost
169 Summary: MySQL based vhosting
170 Summary(pl): vhosty oparte na MySQL-u
171 Group: Networking/Daemons
172 URL: http://www.lighttpd.net/documentation/mysqlvhost.html
173 Requires: %{name} = %{version}-%{release}
175 %description mod_mysql_vhost
176 This module provides virtual hosts (vhosts) based on a MySQL table.
178 %description mod_mysql_vhost -l pl
179 Ten modu³ udostêpnia wirtualne hosty (vhosty) oparte na tabeli MySQL.
181 %package mod_trigger_b4_dl
182 Summary: Trigger before Download
183 Summary(pl): Wyzwalacz przed ¶ci±ganiem
184 Group: Networking/Daemons
185 URL: http://www.lighttpd.net/documentation/trigger_b4_dl.html
186 Requires: %{name} = %{version}-%{release}
188 %description mod_trigger_b4_dl
189 Another anti hot-linking module.
191 %description mod_trigger_b4_dl -l pl
192 Jeszcze jeden modu³ blokuj±cy bezpo¶rednie linkowanie.
195 Summary: WebDAV module for lighttpd
196 Summary(pl): Modu³ WebDAV dla libghttpd
197 Group: Networking/Daemons
198 URL: http://www.lighttpd.net/documentation/webdav.html
199 Requires: %{name} = %{version}-%{release}
201 %description mod_webdav
202 The WebDAV module is a very minimalistic implementation of RFC 2518.
203 Minimalistic means that not all operations are implementated yet.
212 and the usual GET, POST, HEAD from HTTP/1.1.
214 So far mounting a webdav resource into Windows XP works and the basic
215 litmus tests are passed.
217 %description mod_webdav -l pl
218 Modu³ WebDAV to bardzo minimalistyczna implementacja RFC 2518.
219 Minimalistyczna oznacza, ¿e jeszcze nie wszystkie operacje s±
220 zaimplementowane. Jak na razie s±:
226 oraz zwyk³e GET, POST, HEAD z HTTP/1.1.
228 Jak na razie montowanie zasobu webdav pod Windows XP dzia³a i
229 podstawowe testy lakmusowe przechodz±.
231 %package -n spawn-fcgi
232 Summary: Spawn fcgi-process directly
233 Summary(pl): Bezpo¶rednie uruchamianie procesów fcgi
236 %description -n spawn-fcgi
237 spawn-fcgi is used to spawn fcgi-process directly without the help of
238 a webserver or the programm itself.
240 %description -n spawn-fcgi -l pl
241 spawn-fcgi s³u¿y do uruchamiania procesów fcgi bezpo¶rednio, bez
242 pomocy serwera WWW ani samego programu.
248 install %{SOURCE6} mime.types.sh
250 # build mime.types.conf
251 ./mime.types.sh /etc/mime.types
260 %{!?with_ipv6:--disable-ipv6} \
261 %{!?with_largefile:--disable-lfs} \
262 %{?with_valgrind:--with-valgrind} \
263 %{?with_xattr:--with-attr} \
264 %{?with_mysql:--with-mysql} \
265 %{?with_ldap:--with-ldap} \
266 %{?with_ssl:--with-openssl} \
267 %{?with_lua:--with-lua} \
268 %{?with_memcache:--with-memcache} \
269 %{?with_webdav_props:--with-webdav-props} \
270 %{?with_gamin:--with-gamin} \
271 %{?with_gdbm:--with-gdbm}
276 rm -rf $RPM_BUILD_ROOT
277 install -d $RPM_BUILD_ROOT{%{_lighttpddir}/{cgi-bin,html},/etc/{logrotate.d,rc.d/init.d,sysconfig}} \
278 $RPM_BUILD_ROOT%{_sysconfdir}/webapps.d \
279 $RPM_BUILD_ROOT{/var/log/{%{name},archiv/%{name}},/var/run/%{name}}
282 DESTDIR=$RPM_BUILD_ROOT
284 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
285 install %{SOURCE2} %{SOURCE3} mime.types.conf $RPM_BUILD_ROOT%{_sysconfdir}
286 install %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
287 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
289 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
291 # could use automake patch, but automake generation fails...
292 mv $RPM_BUILD_ROOT%{_bindir}/spawn-fcgi $RPM_BUILD_ROOT%{_sbindir}/spawn-fcgi
295 rm -f $RPM_BUILD_ROOT%{_libdir}/mod_mysql_vhost.so
298 # Install lighttpd images
299 install %{SOURCE7} %{SOURCE8} %{SOURCE9} $RPM_BUILD_ROOT%{_lighttpddir}/html
300 install %{SOURCE10} $RPM_BUILD_ROOT%{_lighttpddir}/html/pld_button.png
301 install %{SOURCE11} $RPM_BUILD_ROOT%{_lighttpddir}/html/index.html
304 rm -rf $RPM_BUILD_ROOT
307 %groupadd -g 109 lighttpd
309 %useradd -u 116 -d %{_lighttpddir} -c "LigHTTPd User" -g lighttpd lighttpd
310 %addusertogroup lighttpd http
313 /sbin/chkconfig --add %{name}
316 if [ "$1" = "0" ]; then
317 %service %{name} stop
318 /sbin/chkconfig --del %{name}
322 if [ "$1" = "0" ]; then
324 %groupremove lighttpd
329 # minimizing lighttpd restarts logics. we restart webserver:
331 # 1. at the end of transaction. (posttrans, feature from rpm 4.4.2)
332 # 2. first install of module (post: $1 = 1)
333 # 2. uninstall of module (postun: $1 == 0)
335 # the strict internal deps between lighttpd modules and
336 # main package are very important for all this to work.
337 %service %{name} restart "LigHTTPd webserver"
340 # macro called at module post scriptlet
341 %define module_post \
342 if [ "$1" = "1" ]; then \
343 %service -q lighttpd restart \
346 # macro called at module postun scriptlet
347 %define module_postun \
348 if [ "$1" = "0" ]; then \
349 %service -q lighttpd restart \
352 # it's sooo annoying to write them
353 %define module_scripts() \
360 %module_scripts mod_compress
361 %module_scripts mod_cml
362 %module_scripts mod_mysql_vhost
363 %module_scripts mod_trigger_b4_dl
364 %module_scripts mod_webdav
366 %triggerpostun -- %{name} <= 1.3.6-2
368 if [ "$1" = "2" ]; then
369 %banner %{name} -e <<EOF
370 spawn-fcgi program is now available separately from spawn-fcgi package.
376 %defattr(644,root,root,755)
377 %doc NEWS README ChangeLog doc/lighttpd.conf doc/*.txt doc/rrdtool-graph.sh
378 %dir %attr(750,root,lighttpd) %{_sysconfdir}
379 %dir %attr(750,root,root) %{_sysconfdir}/webapps.d
380 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
381 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mime.types.conf
382 %attr(640,root,lighttpd) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.user
384 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
385 %attr(750,root,root) %dir /var/log/archiv/%{name}
386 %dir %attr(770,root,lighttpd) /var/log/%{name}
387 %dir %attr(770,root,lighttpd) /var/run/%{name}
388 %attr(754,root,root) /etc/rc.d/init.d/%{name}
389 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/*
390 %attr(755,root,root) %{_sbindir}/*
392 %attr(755,root,root) %{_libdir}/mod_access.so
393 %attr(755,root,root) %{_libdir}/mod_accesslog.so
394 %attr(755,root,root) %{_libdir}/mod_alias.so
395 %attr(755,root,root) %{_libdir}/mod_auth.so
396 %attr(755,root,root) %{_libdir}/mod_cgi.so
397 %attr(755,root,root) %{_libdir}/mod_deflate.so
398 %attr(755,root,root) %{_libdir}/mod_dirlisting.so
399 %attr(755,root,root) %{_libdir}/mod_evasive.so
400 %attr(755,root,root) %{_libdir}/mod_evhost.so
401 %attr(755,root,root) %{_libdir}/mod_expire.so
402 %attr(755,root,root) %{_libdir}/mod_fastcgi.so
403 %attr(755,root,root) %{_libdir}/mod_indexfile.so
404 %attr(755,root,root) %{_libdir}/mod_proxy.so
405 %attr(755,root,root) %{_libdir}/mod_redirect.so
406 %attr(755,root,root) %{_libdir}/mod_rewrite.so
407 %attr(755,root,root) %{_libdir}/mod_rrdtool.so
408 %attr(755,root,root) %{_libdir}/mod_scgi.so
409 %attr(755,root,root) %{_libdir}/mod_secdownload.so
410 %attr(755,root,root) %{_libdir}/mod_setenv.so
411 %attr(755,root,root) %{_libdir}/mod_simple_vhost.so
412 %attr(755,root,root) %{_libdir}/mod_ssi.so
413 %attr(755,root,root) %{_libdir}/mod_staticfile.so
414 %attr(755,root,root) %{_libdir}/mod_status.so
415 %attr(755,root,root) %{_libdir}/mod_userdir.so
416 %attr(755,root,root) %{_libdir}/mod_usertrack.so
420 %dir %{_lighttpddir}/cgi-bin
421 %dir %{_lighttpddir}/html
422 %{_lighttpddir}/html/*
425 %defattr(644,root,root,755)
426 %attr(755,root,root) %{_libdir}/mod_compress.so
429 %defattr(644,root,root,755)
430 %attr(755,root,root) %{_libdir}/mod_cml.so
433 %files mod_mysql_vhost
434 %defattr(644,root,root,755)
435 %attr(755,root,root) %{_libdir}/mod_mysql_vhost.so
438 %files mod_trigger_b4_dl
439 %defattr(644,root,root,755)
440 %attr(755,root,root) %{_libdir}/mod_trigger_b4_dl.so
443 %defattr(644,root,root,755)
444 %attr(755,root,root) %{_libdir}/mod_webdav.so
447 %defattr(644,root,root,755)
448 %doc doc/spawn-php.sh
449 %attr(755,root,root) %{_sbindir}/spawn-fcgi