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