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
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
20 # Prerelease snapshot: DATE-TIME
21 ##define _snap 20050116-1743
24 %define _source http://www.lighttpd.net/download/%{name}-%{version}-%{_snap}.tar.gz
26 %define _source http://www.lighttpd.net/download/%{name}-%{version}.tar.gz
31 Summary: Fast and light HTTP server
32 Summary(pl): Szybki i lekki serwer HTTP
35 Release: %{_rel}%{?_snap:.%(echo %{_snap}|tr - _)}
36 Group: Networking/Daemons
39 # Source0-md5: 28623eff50653a9b104ddb20fe65aaf1
43 Source4: %{name}.logrotate
44 Source5: %{name}.sysconfig
45 URL: http://www.lighttpd.net/
46 BuildRequires: autoconf
47 BuildRequires: automake
48 BuildRequires: bzip2-devel
49 BuildRequires: libtool
50 %{?with_ssl:BuildRequires: openssl-devel}
51 BuildRequires: pcre-devel
52 BuildRequires: rpmbuild(macros) >= 1.159
53 BuildRequires: zlib-devel
55 BuildRequires: attr-devel
57 %{?with_ldap:BuildRequires: openldap-devel}
58 %{?with_mysql:BuildRequires: mysql-devel}
59 %{?with_valgrind:BuildRequires: valgrind}
60 %{!?with_valgrind:BuildConflicts: valgrind}
62 Requires(pre): sh-utils
63 Requires(pre): /bin/id
64 Requires(pre): /usr/bin/getgid
65 Requires(pre): /usr/sbin/groupadd
66 Requires(pre): /usr/sbin/useradd
67 Requires(post,preun): /sbin/chkconfig
68 Requires(postun): /usr/sbin/groupdel
69 Requires(postun): /usr/sbin/userdel
70 Provides: group(lighttpd)
72 Provides: user(lighttpd)
74 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
76 %define _libdir %{_prefix}/%{_lib}/%{name}
77 %define _lighttpddir /home/services/%{name}
78 %define _sysconfdir /etc/%{name}
81 lighttpd is a secure, fast, compliant and very flexible web-server
82 which has been optimized for high-performance environments. It has
83 a very low memory footprint compared to other webservers and takes
84 care of cpu-load. Its advanced feature-set (FastCGI, CGI, Auth,
85 Output-Compression, URL-Rewriting and many more) make lighttpd the
86 perfect webserver-software for every server that is suffering load
90 lighttpd jest bezpiecznym, szybkim, przyjaznym i bardzo elastycznym
91 serwerem WWW, który zosta³ zoptymalizowany pod k±tem
92 wysokowydajno¶ciowych ¶rodowisk. Zajmuje bardzo ma³± ilo¶æ pamiêci
93 w porównaniu do innych serwerów WWW oraz dba o zajêto¶æ procesora.
94 Szeroki zestaw opcji (FastCGI, CGI, uwierzytelnianie, kompresja
95 wyj¶cia, przepisywanie URL-i i wiele innych) czyni± z lighttpd
96 doskona³e oprogramowanie web-serwerowe na ka¿dy serwer cierpi±cy
97 z powodu problemów z obci±¿eniem.
99 %package -n spawn-fcgi
100 Summary: Spawn fcgi-process directly
101 Summary(pl): Bezpo¶rednie uruchamianie procesów fcgi
104 %description -n spawn-fcgi
105 spawn-fcgi is used to spawn fcgi-process directly without the help of
106 a webserver or the programm itself.
108 %description -n spawn-fcgi -l pl
109 spawn-fcgi s³u¿y do uruchamiania procesów fcgi bezpo¶rednio, bez
110 pomocy serwera WWW ani samego programu.
122 --enable-mod-localizer \
123 %{?with_xattr:--with-attr} \
124 %{?with_mysql:--with-mysql} \
125 %{?with_ldap:--with-ldap} \
126 %{!?with_ipv6:--disable-ipv6} \
127 %{!?with_largefile:--disable-lfs} \
128 %{?with_ssl:--with-openssl}
133 rm -rf $RPM_BUILD_ROOT
134 install -d $RPM_BUILD_ROOT{%{_lighttpddir}/{cgi-bin,html},/etc/{logrotate.d,rc.d/init.d,sysconfig},%{_sysconfdir}} \
135 $RPM_BUILD_ROOT/var/log/{%{name},archiv/%{name}}
138 DESTDIR=$RPM_BUILD_ROOT
140 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
141 install %{SOURCE2} %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}
142 install %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
143 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
145 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
147 # could use automake patch, but automake generation fails...
148 mv $RPM_BUILD_ROOT%{_bindir}/spawn-fcgi $RPM_BUILD_ROOT%{_sbindir}/spawn-fcgi
151 rm -rf $RPM_BUILD_ROOT
154 if [ -n "`/usr/bin/getgid lighttpd`" ]; then
155 if [ "`/usr/bin/getgid lighttpd`" != 109 ]; then
156 echo "Error: group lighttpd doesn't have gid=109. Correct this before installing %{name}." 1>&2
160 /usr/sbin/groupadd -g 109 lighttpd
162 if [ -n "`/bin/id -u lighttpd 2>/dev/null`" ]; then
163 if [ "`/bin/id -u lighttpd`" != 116 ]; then
164 echo "Error: user lighttpd doesn't have uid=116. Correct this before installing %{name}." 1>&2
168 /usr/sbin/useradd -u 116 -d %{_lighttpddir} -s /bin/false \
169 -c "HTTP User" -g lighttpd lighttpd 1>&2
173 /sbin/chkconfig --add %{name}
174 if [ -f /var/lock/subsys/%{name} ]; then
175 /etc/rc.d/init.d/%{name} restart 1>&2
177 echo "Run \"/etc/rc.d/init.d/%{name} start\" to start %{name} daemon."
181 if [ "$1" = "0" ]; then
182 if [ -f /var/lock/subsys/%{name} ]; then
183 /etc/rc.d/init.d/%{name} stop 1>&2
185 /sbin/chkconfig --del %{name}
189 if [ "$1" = "0" ]; then
191 %groupremove lighttpd
194 %triggerpostun -- %{name} <= 1.3.6-2
196 if [ "$1" = "2" ]; then
197 %banner %{name} -e <<EOF
198 spawn-fcgi program is now available separately from spawn-fcgi package.
204 %defattr(644,root,root,755)
205 %doc NEWS README ChangeLog doc/lighttpd.conf doc/*.txt doc/rrdtool-graph.sh
206 %attr(755,root,root) %{_sbindir}/*
208 %attr(755,root,root) %{_libdir}/*.so
209 %attr(750,root,root) %dir /var/log/archiv/%{name}
210 %dir %attr(750,lighttpd,root) /var/log/%{name}
211 %attr(755,lighttpd,lighttpd) %{_lighttpddir}
212 %attr(754,root,root) /etc/rc.d/init.d/%{name}
213 %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/*
214 %dir %attr(750,root,lighttpd) %{_sysconfdir}
215 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}.conf
216 %attr(640,root,lighttpd) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/*.user
217 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/%{name}
221 %defattr(644,root,root,755)
222 %doc doc/spawn-php.sh
223 %attr(755,root,root) %{_sbindir}/spawn-fcgi