]> git.pld-linux.org Git - packages/lighttpd.git/blob - lighttpd.spec
- add patch to prevent crashing when fcgi process dies
[packages/lighttpd.git] / lighttpd.spec
1 #
2 # TODO
3 # - fix modules:
4 #  mod_localizer   : disabled (liblocalizer missing)
5 #  mod_maps        : disabled (liblocalizer missing)
6 #  mod_chat        : disabled, buy your license :)
7 #  mod_cache       : disabled, buy your license :)
8 # - test ldap and mysql (failed at this time)
9 # - documentroot specified in config doesn't exist
10 #
11 # Conditional build for lighttpd:
12 %bcond_without  xattr   # without support of extended attributes
13 %bcond_with     mysql   # with mysql
14 %bcond_with     ldap    # with ldap
15 %bcond_with     valgrind        # enable valgrind fixes in code.
16 %bcond_without  largefile       # without largefile support,
17 # use it if you have 2.4 kernel to get sendfile() support,
18 # and don't need > 2GB file requests,
19 # see http://article.gmane.org/gmane.comp.web.lighttpd:722
20 #
21 Summary:        Fast and light HTTP server
22 Summary(pl):    Szybki i lekki serwer HTTP
23 Name:           lighttpd
24 Version:        1.3.7
25 Release:        0.11
26 Group:          Networking/Daemons
27 License:        BSD
28 ## do not remove next two lines because atomic revisions are common in lighttpd
29 #%define                _rel    20050106-1954
30 #Source0:       http://www.lighttpd.net/download/%{name}-%{version}-%{_rel}.tar.gz
31 Source0:        http://www.lighttpd.net/download/%{name}-%{version}.tar.gz
32 # Source0-md5:  40ac1d07d9efb0366720d081c3e02224
33 Source1:        %{name}.init
34 Source2:        %{name}.conf
35 Source3:        %{name}.user
36 Source4:        %{name}.logrotate
37 Source5:        %{name}.sysconfig
38 Patch0:         %{name}-mod_status.patch
39 Patch1:         %{name}-doublefree.patch
40 URL:            http://www.lighttpd.net/
41 BuildRequires:  autoconf
42 BuildRequires:  automake
43 BuildRequires:  bzip2-devel
44 BuildRequires:  libtool
45 BuildRequires:  openssl-devel
46 BuildRequires:  pcre-devel
47 BuildRequires:  rpmbuild(macros) >= 1.159
48 BuildRequires:  zlib-devel
49 %if %{with xattr}
50 BuildRequires:  attr-devel
51 %endif
52 %{?with_ldap:BuildRequires:     openldap-devel}
53 %{?with_mysql:BuildRequires:    mysql-devel}
54 %{?with_valgrind:BuildRequires: valgrind}
55 %{!?with_valgrind:BuildConflicts:       valgrind}
56 PreReq:         rc-scripts
57 Requires(pre):  sh-utils
58 Requires(pre):  /bin/id
59 Requires(pre):  /usr/bin/getgid
60 Requires(pre):  /usr/sbin/groupadd
61 Requires(pre):  /usr/sbin/useradd
62 Requires(post,preun):   /sbin/chkconfig
63 Requires(postun):       /usr/sbin/groupdel
64 Requires(postun):       /usr/sbin/userdel
65 Provides:       group(lighttpd)
66 Provides:       httpd
67 Provides:       user(lighttpd)
68 Provides:       webserver
69 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
70
71 %define         _libdir         %{_prefix}/%{_lib}/%{name}
72 %define         _lighttpddir    /home/services/%{name}
73 %define         _sysconfdir     /etc/%{name}
74
75 %description
76 lighttpd is a secure, fast, compliant and very flexible web-server
77 which has been optimized for high-performance environments. It has
78 a very low memory footprint compared to other webservers and takes
79 care of cpu-load. Its advanced feature-set (FastCGI, CGI, Auth,
80 Output-Compression, URL-Rewriting and many more) make lighttpd the
81 perfect webserver-software for every server that is suffering load
82 problems.
83
84 %description -l pl
85 lighttpd jest bezpiecznym, szybkim, przyjaznym i bardzo elastycznym
86 serwerem WWW, który zosta³ zoptymalizowany pod k±tem
87 wysokowydajno¶ciowych ¶rodowisk. Zajmuje bardzo ma³± ilo¶æ pamiêci
88 w porównaniu do innych serwerów WWW oraz dba o zajêto¶æ procesora.
89 Szeroki zestaw opcji (FastCGI, CGI, uwierzytelnianie, kompresja
90 wyj¶cia, przepisywanie URL-i i wiele innych) czyni± z lighttpd
91 doskona³e oprogramowanie web-serwerowe na ka¿dy serwer cierpi±cy
92 z powodu problemów z obci±¿eniem.
93
94 %package -n spawn-fcgi
95 Summary:        Spawn fcgi-process directly
96 Summary(pl):    Bezpo¶rednie uruchamianie procesów fcgi
97 Group:          Applications
98
99 %description -n spawn-fcgi
100 spawn-fcgi is used to spawn fcgi-process directly without the help of
101 a webserver or the programm itself.
102
103 %description -n spawn-fcgi -l pl
104 spawn-fcgi s³u¿y do uruchamiania procesów fcgi bezpo¶rednio, bez
105 pomocy serwera WWW ani samego programu.
106
107 %prep
108 %setup -q
109 %patch0 -p1
110 %patch1 -p1
111
112 %build
113 %{__libtoolize}
114 %{__aclocal}
115 %{__autoconf}
116 %configure \
117         --enable-mod-chat \
118         --enable-mod-cache \
119         --enable-mod-localizer \
120         %{?with_xattr:--with-attr} \
121         %{?with_mysql:--with-mysql} \
122         %{?with_ldap:--with-ldap} \
123         %{!?with_largefile:--disable-lfs} \
124         --with-openssl
125         
126 %{__make}
127
128 %install
129 rm -rf $RPM_BUILD_ROOT
130 install -d $RPM_BUILD_ROOT{%{_lighttpddir}/cgi-bin,/etc/{logrotate.d,rc.d/init.d,sysconfig},%{_sysconfdir}} \
131         $RPM_BUILD_ROOT/var/log/{%{name},archiv/%{name}}
132
133 %{__make} install \
134         DESTDIR=$RPM_BUILD_ROOT
135
136 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
137 install %{SOURCE2} %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}
138 install %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
139 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
140
141 # could use automake patch, but automake generation fails...
142 mv $RPM_BUILD_ROOT%{_bindir}/spawn-fcgi $RPM_BUILD_ROOT%{_sbindir}/spawn-fcgi
143
144 %clean
145 rm -rf $RPM_BUILD_ROOT
146
147 %pre
148 if [ -n "`/usr/bin/getgid lighttpd`" ]; then
149         if [ "`/usr/bin/getgid lighttpd`" != 109 ]; then
150                 echo "Error: group lighttpd doesn't have gid=109. Correct this before installing %{name}." 1>&2
151                 exit 1
152         fi
153 else
154         /usr/sbin/groupadd -g 109 lighttpd
155 fi
156 if [ -n "`/bin/id -u lighttpd 2>/dev/null`" ]; then
157         if [ "`/bin/id -u lighttpd`" != 116 ]; then
158                 echo "Error: user lighttpd doesn't have uid=116. Correct this before installing %{name}." 1>&2
159                 exit 1
160         fi
161 else
162         /usr/sbin/useradd -u 116 -d %{_lighttpddir} -s /bin/false \
163                 -c "HTTP User" -g lighttpd lighttpd 1>&2
164 fi
165
166 %post
167 /sbin/chkconfig --add %{name}
168 if [ -f /var/lock/subsys/%{name} ]; then
169         /etc/rc.d/init.d/%{name} restart 1>&2
170 else
171         echo "Run \"/etc/rc.d/init.d/%{name} start\" to start %{name} daemon."
172 fi
173
174 %preun
175 if [ "$1" = "0" ]; then
176         if [ -f /var/lock/subsys/%{name} ]; then
177                 /etc/rc.d/init.d/%{name} stop 1>&2
178         fi
179         /sbin/chkconfig --del %{name}
180 fi
181
182 %postun
183 if [ "$1" = "0" ]; then
184         %userremove lighttpd
185         %groupremove lighttpd
186 fi
187
188 %triggerpostun -- %{name} <= 1.3.6-2
189 # upgraded
190 if [ "$1" = "2" ]; then
191 %banner %{name} -e <<EOF
192 spawn-fcgi program is now available separately from spawn-fcgi package.
193
194 EOF
195 fi
196
197
198 %files
199 %defattr(644,root,root,755)
200 %doc NEWS README ChangeLog doc/lighttpd.conf doc/*.txt doc/rrdtool-graph.sh
201 %attr(755,root,root) %{_sbindir}/*
202 %dir %{_libdir}
203 %attr(755,root,root) %{_libdir}/*.so
204 %attr(750,root,root) %dir /var/log/archiv/%{name}
205 %dir %attr(750,lighttpd,root) /var/log/%{name}
206 %attr(755,lighttpd,lighttpd) %{_lighttpddir}
207 %attr(754,root,root) /etc/rc.d/init.d/%{name}
208 %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/*
209 %dir %attr(750,root,lighttpd) %{_sysconfdir}
210 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}.conf
211 %attr(640,root,lighttpd) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/*.user
212 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/%{name}
213 %{_mandir}/man?/*
214
215 %files -n spawn-fcgi
216 %defattr(644,root,root,755)
217 %attr(755,root,root) %{_sbindir}/spawn-fcgi
This page took 0.070332 seconds and 4 git commands to generate.