]> git.pld-linux.org Git - packages/lighttpd.git/blob - lighttpd.spec
- added patch to enable mod_deflate
[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 1
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 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
94 Requires:       rc-scripts
95 Provides:       group(http)
96 Provides:       group(lighttpd)
97 Provides:       user(lighttpd)
98 Provides:       webserver
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)
102
103 %define         _libdir         %{_prefix}/%{_lib}/%{name}
104 %define         _lighttpddir    /home/services/%{name}
105 %define         _sysconfdir     /etc/%{name}
106
107 %description
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
114 problems.
115
116 %description -l pl
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.
125
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}
132
133 %description mod_compress
134 Output compression reduces the network load and can improve the
135 overall throughput of the webserver.
136
137 Only static content is supported up to now.
138
139 The server negotiates automatically which compression method is used.
140 Supported are gzip, deflate, bzip.
141
142 %description mod_compress -l pl
143 Kompresja wyj¶cia zmniejsza obci±¿enie sieci i mo¿e poprawiæ ca³kowit±
144 przepustowo¶æ serwera WWW.
145
146 Jak na razie obs³ugiwana jest tylko statyczna tre¶æ.
147
148 Serwer automatycznie negocjuje, która metoda kompresji jest u¿ywana.
149 Obs³ugiwane s± gzip, deflate i bzip.
150
151 %package mod_cml
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}
157
158 %description mod_cml
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
161 LUA.
162
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.
166
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}
173
174 %description mod_mysql_vhost
175 This module provides virtual hosts (vhosts) based on a MySQL table.
176
177 %description mod_mysql_vhost -l pl
178 Ten modu³ udostêpnia wirtualne hosty (vhosty) oparte na tabeli MySQL.
179
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}
186
187 %description mod_trigger_b4_dl
188 Another anti hot-linking module.
189
190 %description mod_trigger_b4_dl -l pl
191 Jeszcze jeden modu³ blokuj±cy bezpo¶rednie linkowanie.
192
193 %package mod_webdav
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}
199
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.
203
204 So far we have
205 - PROPFIND
206 - OPTIONS
207 - MKCOL
208 - DELETE
209 - PUT
210
211 and the usual GET, POST, HEAD from HTTP/1.1.
212
213 So far mounting a webdav resource into Windows XP works and the basic
214 litmus tests are passed.
215
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±:
220 - PROPFIND
221 - OPTIONS
222 - MKCOL
223 - DELETE
224 - PUT
225 oraz zwyk³e GET, POST, HEAD z HTTP/1.1.
226
227 Jak na razie montowanie zasobu webdav pod Windows XP dzia³a i
228 podstawowe testy lakmusowe przechodz±.
229
230 %package -n spawn-fcgi
231 Summary:        Spawn fcgi-process directly
232 Summary(pl):    Bezpo¶rednie uruchamianie procesów fcgi
233 Group:          Applications
234
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.
238
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.
242
243 %prep
244 %setup -q
245 %patch0 -p1
246 install %{SOURCE6} mime.types.sh
247
248 # build mime.types.conf
249 ./mime.types.sh /etc/mime.types
250
251 %build
252 %{__libtoolize}
253 %{__aclocal}
254 %{__autoconf}
255 %{__automake}
256
257 %configure \
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}
270
271 %{__make}
272
273 %install
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}}
278
279 %{__make} install \
280         DESTDIR=$RPM_BUILD_ROOT
281
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}
286
287 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
288
289 # could use automake patch, but automake generation fails...
290 mv $RPM_BUILD_ROOT%{_bindir}/spawn-fcgi $RPM_BUILD_ROOT%{_sbindir}/spawn-fcgi
291
292 %if %{without mysql}
293 rm -f $RPM_BUILD_ROOT%{_libdir}/mod_mysql_vhost.so
294 %endif
295
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
300
301 %clean
302 rm -rf $RPM_BUILD_ROOT
303
304 %pre
305 %groupadd -g 109 lighttpd
306 %groupadd -g 51 http
307 %useradd -u 116 -d %{_lighttpddir} -c "LigHTTPd User" -g lighttpd lighttpd
308 %addusertogroup lighttpd http
309
310 %post
311 /sbin/chkconfig --add %{name}
312
313 %preun
314 if [ "$1" = "0" ]; then
315         %service %{name} stop
316         /sbin/chkconfig --del %{name}
317 fi
318
319 %postun
320 if [ "$1" = "0" ]; then
321         %userremove lighttpd
322         %groupremove lighttpd
323         %groupremove http
324 fi
325
326 %posttrans
327 # minimizing lighttpd restarts logics. we restart webserver:
328 #
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)
332 #
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"
336 exit 0
337
338 # macro called at module post scriptlet
339 %define module_post \
340 if [ "$1" = "1" ]; then \
341         %service -q lighttpd restart \
342 fi
343
344 # macro called at module postun scriptlet
345 %define module_postun \
346 if [ "$1" = "0" ]; then \
347         %service -q lighttpd restart \
348 fi
349
350 # it's sooo annoying to write them
351 %define module_scripts() \
352 %post %1 \
353 %module_post \
354 \
355 %postun %1 \
356 %module_postun
357
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
363
364 %triggerpostun -- %{name} <= 1.3.6-2
365 # upgraded
366 if [ "$1" = "2" ]; then
367 %banner %{name} -e <<EOF
368 spawn-fcgi program is now available separately from spawn-fcgi package.
369
370 EOF
371 fi
372
373 %files
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
381
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}/*
389 %dir %{_libdir}
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_deflate.so
396 %attr(755,root,root) %{_libdir}/mod_dirlisting.so
397 %attr(755,root,root) %{_libdir}/mod_evasive.so
398 %attr(755,root,root) %{_libdir}/mod_evhost.so
399 %attr(755,root,root) %{_libdir}/mod_expire.so
400 %attr(755,root,root) %{_libdir}/mod_fastcgi.so
401 %attr(755,root,root) %{_libdir}/mod_indexfile.so
402 %attr(755,root,root) %{_libdir}/mod_proxy.so
403 %attr(755,root,root) %{_libdir}/mod_redirect.so
404 %attr(755,root,root) %{_libdir}/mod_rewrite.so
405 %attr(755,root,root) %{_libdir}/mod_rrdtool.so
406 %attr(755,root,root) %{_libdir}/mod_scgi.so
407 %attr(755,root,root) %{_libdir}/mod_secdownload.so
408 %attr(755,root,root) %{_libdir}/mod_setenv.so
409 %attr(755,root,root) %{_libdir}/mod_simple_vhost.so
410 %attr(755,root,root) %{_libdir}/mod_ssi.so
411 %attr(755,root,root) %{_libdir}/mod_staticfile.so
412 %attr(755,root,root) %{_libdir}/mod_status.so
413 %attr(755,root,root) %{_libdir}/mod_userdir.so
414 %attr(755,root,root) %{_libdir}/mod_usertrack.so
415 %{_mandir}/man?/*
416
417 %dir %{_lighttpddir}
418 %dir %{_lighttpddir}/cgi-bin
419 %dir %{_lighttpddir}/html
420 %{_lighttpddir}/html/*
421
422 %files mod_compress
423 %defattr(644,root,root,755)
424 %attr(755,root,root) %{_libdir}/mod_compress.so
425
426 %files mod_cml
427 %defattr(644,root,root,755)
428 %attr(755,root,root) %{_libdir}/mod_cml.so
429
430 %if %{with mysql}
431 %files mod_mysql_vhost
432 %defattr(644,root,root,755)
433 %attr(755,root,root) %{_libdir}/mod_mysql_vhost.so
434 %endif
435
436 %files mod_trigger_b4_dl
437 %defattr(644,root,root,755)
438 %attr(755,root,root) %{_libdir}/mod_trigger_b4_dl.so
439
440 %files mod_webdav
441 %defattr(644,root,root,755)
442 %attr(755,root,root) %{_libdir}/mod_webdav.so
443
444 %files -n spawn-fcgi
445 %defattr(644,root,root,755)
446 %doc doc/spawn-php.sh
447 %attr(755,root,root) %{_sbindir}/spawn-fcgi
This page took 0.067265 seconds and 4 git commands to generate.