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