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