]> git.pld-linux.org Git - packages/lighttpd.git/blob - lighttpd.spec
- call initgroups(); rel 3
[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 3
40
41 Summary:        Fast and light HTTP server
42 Summary(pl):    Szybki i lekki serwer HTTP
43 Name:           lighttpd
44 Version:        1.4.11
45 Release:        %{_rel}%{?_snap:.%(echo %{_snap}|tr - _)}
46 License:        BSD
47 Group:          Networking/Daemons
48 Source0:        %{_source}
49 # Source0-md5:  f55eebb9815c94a7de35906bb557ecd3
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}-use_bin_sh.patch
67 Patch2:         %{name}-initgroups.patch
68 URL:            http://www.lighttpd.net/
69 %{?with_xattr:BuildRequires:    attr-devel}
70 BuildRequires:  autoconf
71 BuildRequires:  automake
72 BuildRequires:  bzip2-devel
73 %{?with_gamin:BuildRequires:    gamin-devel}
74 %{?with_gdbm:BuildRequires:     gdbm-devel}
75 %{?with_memcache:BuildRequires: libmemcache-devel}
76 BuildRequires:  libtool
77 %{?with_webdav_props:BuildRequires:     libxml2-devel}
78 %{?with_lua:BuildRequires:      lua50-devel >= 5.0.2-5.1}
79 BuildRequires:  mailcap >= 2.1.14-4.4
80 %{?with_mysql:BuildRequires:    mysql-devel}
81 %{?with_ldap:BuildRequires:     openldap-devel}
82 %{?with_ssl:BuildRequires:      openssl-devel}
83 BuildRequires:  pcre-devel
84 BuildRequires:  pkgconfig
85 BuildRequires:  rpmbuild(macros) >= 1.268
86 %{?with_webdav_props:BuildRequires:     sqlite3-devel}
87 %{?with_valgrind:BuildRequires: valgrind}
88 BuildRequires:  zlib-devel
89 Requires(post,preun):   /sbin/chkconfig
90 Requires(postun):       /usr/sbin/groupdel
91 Requires(postun):       /usr/sbin/userdel
92 Requires(pre):  /bin/id
93 Requires(pre):  /usr/bin/getgid
94 Requires(pre):  /usr/sbin/groupadd
95 Requires(pre):  /usr/sbin/useradd
96 Requires:       rc-scripts
97 Provides:       group(http)
98 Provides:       group(lighttpd)
99 Provides:       user(lighttpd)
100 Provides:       webserver
101 # for the posttrans scriptlet, conflicts because in vserver environment rpm package is not installed.
102 Conflicts:      rpm < 4.4.2-0.2
103 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
104
105 %define         _libdir         %{_prefix}/%{_lib}/%{name}
106 %define         _lighttpddir    /home/services/%{name}
107 %define         _sysconfdir     /etc/%{name}
108
109 %description
110 lighttpd is a secure, fast, compliant and very flexible web-server
111 which has been optimized for high-performance environments. It has a
112 very low memory footprint compared to other webservers and takes care
113 of cpu-load. Its advanced feature-set (FastCGI, CGI, Auth,
114 Output-Compression, URL-Rewriting and many more) make lighttpd the
115 perfect webserver-software for every server that is suffering load
116 problems.
117
118 %description -l pl
119 lighttpd jest bezpiecznym, szybkim, przyjaznym i bardzo elastycznym
120 serwerem WWW, który zosta³ zoptymalizowany pod k±tem
121 wysokowydajno¶ciowych ¶rodowisk. Zajmuje bardzo ma³± ilo¶æ pamiêci w
122 porównaniu do innych serwerów WWW oraz dba o zajêto¶æ procesora.
123 Szeroki zestaw opcji (FastCGI, CGI, uwierzytelnianie, kompresja
124 wyj¶cia, przepisywanie URL-i i wiele innych) czyni± z lighttpd
125 doskona³e oprogramowanie web-serwerowe na ka¿dy serwer cierpi±cy z
126 powodu problemów z obci±¿eniem.
127
128 %package mod_compress
129 Summary:        Output Compression
130 Summary(pl):    Kompresja wyj¶cia
131 Group:          Networking/Daemons
132 URL:            http://www.lighttpd.net/documentation/compress.html
133 Requires:       %{name} = %{version}-%{release}
134
135 %description mod_compress
136 Output compression reduces the network load and can improve the
137 overall throughput of the webserver.
138
139 Only static content is supported up to now.
140
141 The server negotiates automatically which compression method is used.
142 Supported are gzip, deflate, bzip.
143
144 %description mod_compress -l pl
145 Kompresja wyj¶cia zmniejsza obci±¿enie sieci i mo¿e poprawiæ ca³kowit±
146 przepustowo¶æ serwera WWW.
147
148 Jak na razie obs³ugiwana jest tylko statyczna tre¶æ.
149
150 Serwer automatycznie negocjuje, która metoda kompresji jest u¿ywana.
151 Obs³ugiwane s± gzip, deflate i bzip.
152
153 %package mod_cml
154 Summary:        Cache Meta Language module
155 Summary(pl):    Modu³ Cache Meta Language
156 Group:          Networking/Daemons
157 URL:            http://www.lighttpd.net/documentation/cml.html
158 Requires:       %{name} = %{version}-%{release}
159
160 %description mod_cml
161 CML is a Meta language to describe the dependencies of a page at one
162 side and building a page from its fragments on the other side using
163 LUA.
164
165 %description mod_cml -l pl
166 CML to metajêzyk s³u¿±cy z jednej strony do opisu zale¿no¶ci strony i
167 z drugiej strony do budowania strony z fragmentów przy u¿yciu LUA.
168
169 %package mod_mysql_vhost
170 Summary:        MySQL based vhosting
171 Summary(pl):    vhosty oparte na MySQL-u
172 Group:          Networking/Daemons
173 URL:            http://www.lighttpd.net/documentation/mysqlvhost.html
174 Requires:       %{name} = %{version}-%{release}
175
176 %description mod_mysql_vhost
177 This module provides virtual hosts (vhosts) based on a MySQL table.
178
179 %description mod_mysql_vhost -l pl
180 Ten modu³ udostêpnia wirtualne hosty (vhosty) oparte na tabeli MySQL.
181
182 %package mod_trigger_b4_dl
183 Summary:        Trigger before Download
184 Summary(pl):    Wyzwalacz przed ¶ci±ganiem
185 Group:          Networking/Daemons
186 URL:            http://www.lighttpd.net/documentation/trigger_b4_dl.html
187 Requires:       %{name} = %{version}-%{release}
188
189 %description mod_trigger_b4_dl
190 Another anti hot-linking module.
191
192 %description mod_trigger_b4_dl -l pl
193 Jeszcze jeden modu³ blokuj±cy bezpo¶rednie linkowanie.
194
195 %package mod_webdav
196 Summary:        WebDAV module for lighttpd
197 Summary(pl):    Modu³ WebDAV dla libghttpd
198 Group:          Networking/Daemons
199 URL:            http://www.lighttpd.net/documentation/webdav.html
200 Requires:       %{name} = %{version}-%{release}
201
202 %description mod_webdav
203 The WebDAV module is a very minimalistic implementation of RFC 2518.
204 Minimalistic means that not all operations are implementated yet.
205
206 So far we have
207 - PROPFIND
208 - OPTIONS
209 - MKCOL
210 - DELETE
211 - PUT
212
213 and the usual GET, POST, HEAD from HTTP/1.1.
214
215 So far mounting a webdav resource into Windows XP works and the basic
216 litmus tests are passed.
217
218 %description mod_webdav -l pl
219 Modu³ WebDAV to bardzo minimalistyczna implementacja RFC 2518.
220 Minimalistyczna oznacza, ¿e jeszcze nie wszystkie operacje s±
221 zaimplementowane. Jak na razie s±:
222 - PROPFIND
223 - OPTIONS
224 - MKCOL
225 - DELETE
226 - PUT
227 oraz zwyk³e GET, POST, HEAD z HTTP/1.1.
228
229 Jak na razie montowanie zasobu webdav pod Windows XP dzia³a i
230 podstawowe testy lakmusowe przechodz±.
231
232 %package -n spawn-fcgi
233 Summary:        Spawn fcgi-process directly
234 Summary(pl):    Bezpo¶rednie uruchamianie procesów fcgi
235 Group:          Applications
236
237 %description -n spawn-fcgi
238 spawn-fcgi is used to spawn fcgi-process directly without the help of
239 a webserver or the programm itself.
240
241 %description -n spawn-fcgi -l pl
242 spawn-fcgi s³u¿y do uruchamiania procesów fcgi bezpo¶rednio, bez
243 pomocy serwera WWW ani samego programu.
244
245 %prep
246 %setup -q
247 %patch0 -p1
248 %patch1 -p1
249 %patch2 -p1
250 install %{SOURCE6} mime.types.sh
251
252 # build mime.types.conf
253 ./mime.types.sh /etc/mime.types
254
255 %build
256 %{__libtoolize}
257 %{__aclocal}
258 %{__autoconf}
259 %{__automake}
260
261 %configure \
262         %{!?with_ipv6:--disable-ipv6} \
263         %{!?with_largefile:--disable-lfs} \
264         %{?with_valgrind:--with-valgrind} \
265         %{?with_xattr:--with-attr} \
266         %{?with_mysql:--with-mysql} \
267         %{?with_ldap:--with-ldap} \
268         %{?with_ssl:--with-openssl} \
269         %{?with_lua:--with-lua} \
270         %{?with_memcache:--with-memcache} \
271         %{?with_webdav_props:--with-webdav-props} \
272         %{?with_gamin:--with-gamin} \
273         %{?with_gdbm:--with-gdbm}
274
275 %{__make}
276
277 %install
278 rm -rf $RPM_BUILD_ROOT
279 install -d $RPM_BUILD_ROOT{%{_lighttpddir}/{cgi-bin,html},/etc/{logrotate.d,rc.d/init.d,sysconfig}} \
280         $RPM_BUILD_ROOT%{_sysconfdir}/webapps.d \
281         $RPM_BUILD_ROOT{/var/log/{%{name},archiv/%{name}},/var/run/%{name}}
282
283 %{__make} install \
284         DESTDIR=$RPM_BUILD_ROOT
285
286 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
287 install %{SOURCE2} %{SOURCE3} mime.types.conf $RPM_BUILD_ROOT%{_sysconfdir}
288 install %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
289 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
290
291 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
292
293 # could use automake patch, but automake generation fails...
294 mv $RPM_BUILD_ROOT%{_bindir}/spawn-fcgi $RPM_BUILD_ROOT%{_sbindir}/spawn-fcgi
295
296 %if %{without mysql}
297 rm -f $RPM_BUILD_ROOT%{_libdir}/mod_mysql_vhost.so
298 %endif
299
300 # Install lighttpd images
301 install %{SOURCE7} %{SOURCE8} %{SOURCE9} $RPM_BUILD_ROOT%{_lighttpddir}/html
302 install %{SOURCE10} $RPM_BUILD_ROOT%{_lighttpddir}/html/pld_button.png
303 install %{SOURCE11} $RPM_BUILD_ROOT%{_lighttpddir}/html/index.html
304
305 %clean
306 rm -rf $RPM_BUILD_ROOT
307
308 %pre
309 %groupadd -g 109 lighttpd
310 %groupadd -g 51 http
311 %useradd -u 116 -d %{_lighttpddir} -c "LigHTTPd User" -g lighttpd lighttpd
312 %addusertogroup lighttpd http
313
314 %post
315 /sbin/chkconfig --add %{name}
316
317 %preun
318 if [ "$1" = "0" ]; then
319         %service %{name} stop
320         /sbin/chkconfig --del %{name}
321 fi
322
323 %postun
324 if [ "$1" = "0" ]; then
325         %userremove lighttpd
326         %groupremove lighttpd
327         %groupremove http
328 fi
329
330 %posttrans
331 # minimizing lighttpd restarts logics. we restart webserver:
332 #
333 # 1. at the end of transaction. (posttrans, feature from rpm 4.4.2)
334 # 2. first install of module (post: $1 = 1)
335 # 2. uninstall of module (postun: $1 == 0)
336 #
337 # the strict internal deps between lighttpd modules and
338 # main package are very important for all this to work.
339 %service %{name} restart "LigHTTPd webserver"
340 exit 0
341
342 # macro called at module post scriptlet
343 %define module_post \
344 if [ "$1" = "1" ]; then \
345         %service -q lighttpd restart \
346 fi
347
348 # macro called at module postun scriptlet
349 %define module_postun \
350 if [ "$1" = "0" ]; then \
351         %service -q lighttpd restart \
352 fi
353
354 # it's sooo annoying to write them
355 %define module_scripts() \
356 %post %1 \
357 %module_post \
358 \
359 %postun %1 \
360 %module_postun
361
362 %module_scripts mod_compress
363 %module_scripts mod_cml
364 %module_scripts mod_mysql_vhost
365 %module_scripts mod_trigger_b4_dl
366 %module_scripts mod_webdav
367
368 %triggerpostun -- %{name} <= 1.3.6-2
369 # upgraded
370 if [ "$1" = "2" ]; then
371 %banner %{name} -e <<EOF
372 spawn-fcgi program is now available separately from spawn-fcgi package.
373
374 EOF
375 fi
376
377 %files
378 %defattr(644,root,root,755)
379 %doc NEWS README ChangeLog doc/lighttpd.conf doc/*.txt doc/rrdtool-graph.sh
380 %dir %attr(750,root,lighttpd) %{_sysconfdir}
381 %dir %attr(750,root,root) %{_sysconfdir}/webapps.d
382 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
383 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mime.types.conf
384 %attr(640,root,lighttpd) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.user
385
386 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
387 %attr(750,root,root) %dir /var/log/archiv/%{name}
388 %dir %attr(770,root,lighttpd) /var/log/%{name}
389 %dir %attr(770,root,lighttpd) /var/run/%{name}
390 %attr(754,root,root) /etc/rc.d/init.d/%{name}
391 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/*
392 %attr(755,root,root) %{_sbindir}/*
393 %dir %{_libdir}
394 %attr(755,root,root) %{_libdir}/mod_access.so
395 %attr(755,root,root) %{_libdir}/mod_accesslog.so
396 %attr(755,root,root) %{_libdir}/mod_alias.so
397 %attr(755,root,root) %{_libdir}/mod_auth.so
398 %attr(755,root,root) %{_libdir}/mod_cgi.so
399 %attr(755,root,root) %{_libdir}/mod_deflate.so
400 %attr(755,root,root) %{_libdir}/mod_dirlisting.so
401 %attr(755,root,root) %{_libdir}/mod_evasive.so
402 %attr(755,root,root) %{_libdir}/mod_evhost.so
403 %attr(755,root,root) %{_libdir}/mod_expire.so
404 %attr(755,root,root) %{_libdir}/mod_fastcgi.so
405 %attr(755,root,root) %{_libdir}/mod_flv_streaming.so
406 %attr(755,root,root) %{_libdir}/mod_indexfile.so
407 %attr(755,root,root) %{_libdir}/mod_proxy.so
408 %attr(755,root,root) %{_libdir}/mod_redirect.so
409 %attr(755,root,root) %{_libdir}/mod_rewrite.so
410 %attr(755,root,root) %{_libdir}/mod_rrdtool.so
411 %attr(755,root,root) %{_libdir}/mod_scgi.so
412 %attr(755,root,root) %{_libdir}/mod_secdownload.so
413 %attr(755,root,root) %{_libdir}/mod_setenv.so
414 %attr(755,root,root) %{_libdir}/mod_simple_vhost.so
415 %attr(755,root,root) %{_libdir}/mod_ssi.so
416 %attr(755,root,root) %{_libdir}/mod_staticfile.so
417 %attr(755,root,root) %{_libdir}/mod_status.so
418 %attr(755,root,root) %{_libdir}/mod_userdir.so
419 %attr(755,root,root) %{_libdir}/mod_usertrack.so
420 %{_mandir}/man?/*
421
422 %dir %{_lighttpddir}
423 %dir %{_lighttpddir}/cgi-bin
424 %dir %{_lighttpddir}/html
425 %{_lighttpddir}/html/*
426
427 %files mod_compress
428 %defattr(644,root,root,755)
429 %attr(755,root,root) %{_libdir}/mod_compress.so
430
431 %files mod_cml
432 %defattr(644,root,root,755)
433 %attr(755,root,root) %{_libdir}/mod_cml.so
434
435 %if %{with mysql}
436 %files mod_mysql_vhost
437 %defattr(644,root,root,755)
438 %attr(755,root,root) %{_libdir}/mod_mysql_vhost.so
439 %endif
440
441 %files mod_trigger_b4_dl
442 %defattr(644,root,root,755)
443 %attr(755,root,root) %{_libdir}/mod_trigger_b4_dl.so
444
445 %files mod_webdav
446 %defattr(644,root,root,755)
447 %attr(755,root,root) %{_libdir}/mod_webdav.so
448
449 %files -n spawn-fcgi
450 %defattr(644,root,root,755)
451 %doc doc/spawn-php.sh
452 %attr(755,root,root) %{_sbindir}/spawn-fcgi
This page took 0.061652 seconds and 3 git commands to generate.