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