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