]> git.pld-linux.org Git - packages/lighttpd.git/blob - lighttpd.spec
- added memory leak patch ; rel 2
[packages/lighttpd.git] / lighttpd.spec
1 # TODO:
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)
6 #
7 # NOTES:
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)
14 #
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.
29
30 # Prerelease snapshot: DATE-TIME
31 #define _snap 20060104-1523
32
33 %if 0%{?_snap}
34 %define _source http://www.lighttpd.net/download/%{name}-%{version}-%{_snap}.tar.gz
35 %else
36 %define _source http://www.lighttpd.net/download/%{name}-%{version}.tar.gz
37 %endif
38
39 %define         _rel 2
40
41 Summary:        Fast and light HTTP server
42 Summary(pl):    Szybki i lekki serwer HTTP
43 Name:           lighttpd
44 Version:        1.4.10
45 Release:        %{_rel}%{?_snap:.%(echo %{_snap}|tr - _)}
46 License:        BSD
47 Group:          Networking/Daemons
48 Source0:        %{_source}
49 # Source0-md5:  51e42c2cc98a1f9986b9f232ff5a01f2
50 Source1:        %{name}.init
51 Source2:        %{name}.conf
52 Source3:        %{name}.user
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
95 Requires:       rc-scripts
96 Provides:       group(http)
97 Provides:       group(lighttpd)
98 Provides:       user(lighttpd)
99 Provides:       webserver
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)
103
104 %define         _libdir         %{_prefix}/%{_lib}/%{name}
105 %define         _lighttpddir    /home/services/%{name}
106 %define         _sysconfdir     /etc/%{name}
107
108 %description
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
115 problems.
116
117 %description -l pl
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.
126
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}
133
134 %description mod_compress
135 Output compression reduces the network load and can improve the
136 overall throughput of the webserver.
137
138 Only static content is supported up to now.
139
140 The server negotiates automatically which compression method is used.
141 Supported are gzip, deflate, bzip.
142
143 %description mod_compress -l pl
144 Kompresja wyj¶cia zmniejsza obci±¿enie sieci i mo¿e poprawiæ ca³kowit±
145 przepustowo¶æ serwera WWW.
146
147 Jak na razie obs³ugiwana jest tylko statyczna tre¶æ.
148
149 Serwer automatycznie negocjuje, która metoda kompresji jest u¿ywana.
150 Obs³ugiwane s± gzip, deflate i bzip.
151
152 %package mod_cml
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}
158
159 %description mod_cml
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
162 LUA.
163
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.
167
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}
174
175 %description mod_mysql_vhost
176 This module provides virtual hosts (vhosts) based on a MySQL table.
177
178 %description mod_mysql_vhost -l pl
179 Ten modu³ udostêpnia wirtualne hosty (vhosty) oparte na tabeli MySQL.
180
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}
187
188 %description mod_trigger_b4_dl
189 Another anti hot-linking module.
190
191 %description mod_trigger_b4_dl -l pl
192 Jeszcze jeden modu³ blokuj±cy bezpo¶rednie linkowanie.
193
194 %package mod_webdav
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}
200
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.
204
205 So far we have
206 - PROPFIND
207 - OPTIONS
208 - MKCOL
209 - DELETE
210 - PUT
211
212 and the usual GET, POST, HEAD from HTTP/1.1.
213
214 So far mounting a webdav resource into Windows XP works and the basic
215 litmus tests are passed.
216
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±:
221 - PROPFIND
222 - OPTIONS
223 - MKCOL
224 - DELETE
225 - PUT
226 oraz zwyk³e GET, POST, HEAD z HTTP/1.1.
227
228 Jak na razie montowanie zasobu webdav pod Windows XP dzia³a i
229 podstawowe testy lakmusowe przechodz±.
230
231 %package -n spawn-fcgi
232 Summary:        Spawn fcgi-process directly
233 Summary(pl):    Bezpo¶rednie uruchamianie procesów fcgi
234 Group:          Applications
235
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.
239
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.
243
244 %prep
245 %setup -q
246 %patch0 -p1
247 %patch1 -p1
248 install %{SOURCE6} mime.types.sh
249
250 # build mime.types.conf
251 ./mime.types.sh /etc/mime.types
252
253 %build
254 %{__libtoolize}
255 %{__aclocal}
256 %{__autoconf}
257 %{__automake}
258
259 %configure \
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}
272
273 %{__make}
274
275 %install
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}}
280
281 %{__make} install \
282         DESTDIR=$RPM_BUILD_ROOT
283
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}
288
289 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
290
291 # could use automake patch, but automake generation fails...
292 mv $RPM_BUILD_ROOT%{_bindir}/spawn-fcgi $RPM_BUILD_ROOT%{_sbindir}/spawn-fcgi
293
294 %if %{without mysql}
295 rm -f $RPM_BUILD_ROOT%{_libdir}/mod_mysql_vhost.so
296 %endif
297
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
302
303 %clean
304 rm -rf $RPM_BUILD_ROOT
305
306 %pre
307 %groupadd -g 109 lighttpd
308 %groupadd -g 51 http
309 %useradd -u 116 -d %{_lighttpddir} -c "LigHTTPd User" -g lighttpd lighttpd
310 %addusertogroup lighttpd http
311
312 %post
313 /sbin/chkconfig --add %{name}
314
315 %preun
316 if [ "$1" = "0" ]; then
317         %service %{name} stop
318         /sbin/chkconfig --del %{name}
319 fi
320
321 %postun
322 if [ "$1" = "0" ]; then
323         %userremove lighttpd
324         %groupremove lighttpd
325         %groupremove http
326 fi
327
328 %posttrans
329 # minimizing lighttpd restarts logics. we restart webserver:
330 #
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)
334 #
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"
338 exit 0
339
340 # macro called at module post scriptlet
341 %define module_post \
342 if [ "$1" = "1" ]; then \
343         %service -q lighttpd restart \
344 fi
345
346 # macro called at module postun scriptlet
347 %define module_postun \
348 if [ "$1" = "0" ]; then \
349         %service -q lighttpd restart \
350 fi
351
352 # it's sooo annoying to write them
353 %define module_scripts() \
354 %post %1 \
355 %module_post \
356 \
357 %postun %1 \
358 %module_postun
359
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
365
366 %triggerpostun -- %{name} <= 1.3.6-2
367 # upgraded
368 if [ "$1" = "2" ]; then
369 %banner %{name} -e <<EOF
370 spawn-fcgi program is now available separately from spawn-fcgi package.
371
372 EOF
373 fi
374
375 %files
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
383
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}/*
391 %dir %{_libdir}
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
417 %{_mandir}/man?/*
418
419 %dir %{_lighttpddir}
420 %dir %{_lighttpddir}/cgi-bin
421 %dir %{_lighttpddir}/html
422 %{_lighttpddir}/html/*
423
424 %files mod_compress
425 %defattr(644,root,root,755)
426 %attr(755,root,root) %{_libdir}/mod_compress.so
427
428 %files mod_cml
429 %defattr(644,root,root,755)
430 %attr(755,root,root) %{_libdir}/mod_cml.so
431
432 %if %{with mysql}
433 %files mod_mysql_vhost
434 %defattr(644,root,root,755)
435 %attr(755,root,root) %{_libdir}/mod_mysql_vhost.so
436 %endif
437
438 %files mod_trigger_b4_dl
439 %defattr(644,root,root,755)
440 %attr(755,root,root) %{_libdir}/mod_trigger_b4_dl.so
441
442 %files mod_webdav
443 %defattr(644,root,root,755)
444 %attr(755,root,root) %{_libdir}/mod_webdav.so
445
446 %files -n spawn-fcgi
447 %defattr(644,root,root,755)
448 %doc doc/spawn-php.sh
449 %attr(755,root,root) %{_sbindir}/spawn-fcgi
This page took 0.108144 seconds and 4 git commands to generate.