#
-# Conditional build for freebsd:
-%bcond_without xattr # without support of extended attributes
+# TODO
+# - test ldap and mysql (failed at this time)
+# - documentroot specified in config doesn't exist
+# - mysql issue: http://www.freebsd.org/cgi/query-pr.cgi?pr=76866
#
-Summary: Fast and light http server
-Summary(pl): Szybki i lekki serwer http
+# Conditional build for lighttpd:
+%bcond_without xattr # without support of extended attributes
+%bcond_without ipv6 # IPv4-only version (doesn't require IPv6 in kernel)
+# use it if you have 2.4 kernel to get sendfile() support,
+# and don't need > 2GB file requests,
+# see http://article.gmane.org/gmane.comp.web.lighttpd:722
+%bcond_without largefile # without largefile support
+%bcond_without ssl # disable ssl support
+%bcond_with mysql # with mysql
+%bcond_with ldap # with ldap
+%bcond_with valgrind # compile code with valgrind support.
+%bcond_with dirhide # with 'hide from dirlisting' hack
+#
+# Prerelease snapshot: DATE-TIME
+##define _snap 20050116-1743
+
+%if 0%{?_snap}
+%define _source http://www.lighttpd.net/download/%{name}-%{version}-%{_snap}.tar.gz
+%else
+%define _source http://www.lighttpd.net/download/%{name}-%{version}.tar.gz
+%endif
+
+%define _rel 3.5
+
+Summary: Fast and light HTTP server
+Summary(pl): Szybki i lekki serwer HTTP
Name: lighttpd
-Version: 1.3.3
-Release: 0.1
+Version: 1.3.13
+Release: %{_rel}%{?_snap:.%(echo %{_snap}|tr - _)}
Group: Networking/Daemons
License: BSD
-## do not remove next two lines because atomic revisions are common in lighttpd
-%define _rel 20041010
-Source0: http://jan.kneschke.de/projects/lighttpd/download/%{name}-%{version}-%{_rel}.tar.gz
-# Source0-md5: 35516505f41718088e18e93e3a8bc0c7
-#Source0: http://jan.kneschke.de/projects/lighttpd/download/%{name}-%{version}.tar.gz
+Source0: %{_source}
+# Source0-md5: 2f017b936be376ad6f6c2ee26db93467
Source1: %{name}.init
Source2: %{name}.conf
Source3: %{name}.user
Source4: %{name}.logrotate
-Patch1: lighttpd-amd64-LINUX_SENDFILE-temporary.patch
-URL: http://jan.kneschke.de/projects/lighttpd/
+Source5: %{name}.sysconfig
+Patch0: http://minghetti.ch/blob/dirlist-hide.patch
+Patch1: %{name}-fcgi-verbose.patch
+Patch2: %{name}-proxy-error-handler.patch
+Patch3: %{name}-fcgi-retry-timeout.patch
+Patch4: http://glen.alkohol.ee/pld/lighttpd-request_header-print.patch
+URL: http://www.lighttpd.net/
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: bzip2-devel
BuildRequires: libtool
-BuildRequires: openssl-devel
+%{?with_ssl:BuildRequires: openssl-devel}
BuildRequires: pcre-devel
BuildRequires: rpmbuild(macros) >= 1.159
BuildRequires: zlib-devel
%if %{with xattr}
BuildRequires: attr-devel
%endif
+%{?with_ldap:BuildRequires: openldap-devel}
+%{?with_mysql:BuildRequires: mysql-devel}
+%{?debug:BuildRequires: valgrind}
+BuildRequires: rpmbuild(macros) >= 1.202
PreReq: rc-scripts
Requires(pre): sh-utils
Requires(pre): /bin/id
%description
lighttpd is a secure, fast, compliant and very flexible web-server
-which has been optimized for high-performance environments. It has
-a very low memory footprint compared to other webservers and takes
-care of cpu-load. Its advanced feature-set (FastCGI, CGI, Auth,
+which has been optimized for high-performance environments. It has a
+very low memory footprint compared to other webservers and takes care
+of cpu-load. Its advanced feature-set (FastCGI, CGI, Auth,
Output-Compression, URL-Rewriting and many more) make lighttpd the
perfect webserver-software for every server that is suffering load
problems.
%description -l pl
lighttpd jest bezpiecznym, szybkim, przyjaznym i bardzo elastycznym
serwerem WWW, który zosta³ zoptymalizowany pod k±tem
-wysokowydajno¶ciowych ¶rodowisk. Zajmuje bardzo ma³± ilo¶æ pamiêci
-w porównaniu do innych serwerów WWW oraz dba o zajêto¶æ procesora.
+wysokowydajno¶ciowych ¶rodowisk. Zajmuje bardzo ma³± ilo¶æ pamiêci w
+porównaniu do innych serwerów WWW oraz dba o zajêto¶æ procesora.
Szeroki zestaw opcji (FastCGI, CGI, uwierzytelnianie, kompresja
wyj¶cia, przepisywanie URL-i i wiele innych) czyni± z lighttpd
-doskona³e oprogramowanie web-serwerowe na ka¿dy serwer cierpi±cy
-z powodu problemów z obci±¿eniem.
+doskona³e oprogramowanie web-serwerowe na ka¿dy serwer cierpi±cy z
+powodu problemów z obci±¿eniem.
+
+%package -n spawn-fcgi
+Summary: Spawn fcgi-process directly
+Summary(pl): Bezpo¶rednie uruchamianie procesów fcgi
+Group: Applications
+
+%description -n spawn-fcgi
+spawn-fcgi is used to spawn fcgi-process directly without the help of
+a webserver or the programm itself.
+
+%description -n spawn-fcgi -l pl
+spawn-fcgi s³u¿y do uruchamiania procesów fcgi bezpo¶rednio, bez
+pomocy serwera WWW ani samego programu.
%prep
%setup -q
-
-%ifarch amd64
-%patch1
-%endif
+%{?with_dirhide:%patch0 -p0}
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
%build
%{__libtoolize}
%{__aclocal}
%{__autoconf}
-#%{__automake}
%configure \
- --enable-mod-chat \
- --enable-mod-cache \
- --enable-mod-localizer \
+ CFLAGS="%{rpmcflags} -DFCGI_RETRY_TIMEOUT=20" \
+ %{?with_valgrind:--with-valgrind} \
%{?with_xattr:--with-attr} \
- --with-openssl
-
+ %{?with_mysql:--with-mysql} \
+ %{?with_ldap:--with-ldap} \
+ %{!?with_ipv6:--disable-ipv6} \
+ %{!?with_largefile:--disable-lfs} \
+ %{?with_ssl:--with-openssl}
+
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_lighttpddir}/cgi-bin,/etc/{logrotate.d,rc.d/init.d},%{_sysconfdir}} \
+install -d $RPM_BUILD_ROOT{%{_lighttpddir}/{cgi-bin,html},/etc/{logrotate.d,rc.d/init.d,sysconfig},%{_sysconfdir}} \
$RPM_BUILD_ROOT/var/log/{%{name},archiv/%{name}}
%{__make} install \
install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
install %{SOURCE2} %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}
install %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
+install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
+
+rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
+
+# could use automake patch, but automake generation fails...
+mv $RPM_BUILD_ROOT%{_bindir}/spawn-fcgi $RPM_BUILD_ROOT%{_sbindir}/spawn-fcgi
%clean
rm -rf $RPM_BUILD_ROOT
%pre
-if [ -n "`/usr/bin/getgid lighttpd`" ]; then
- if [ "`/usr/bin/getgid lighttpd`" != 109 ]; then
- echo "Error: group lighttpd doesn't have gid=109. Correct this before installing %{name}." 1>&2
- exit 1
- fi
-else
- /usr/sbin/groupadd -g 109 lighttpd
-fi
-if [ -n "`/bin/id -u lighttpd 2>/dev/null`" ]; then
- if [ "`/bin/id -u lighttpd`" != 116 ]; then
- echo "Error: user lighhttpd doesn't have uid=116. Correct this before installing %{name}." 1>&2
- exit 1
- fi
-else
- /usr/sbin/useradd -u 116 -d %{_lighttpddir} -s /bin/false \
- -c "HTTP User" -g lighttpd lighttpd 1>&2
-fi
+%groupadd -g 109 lighttpd
+%useradd -u 116 -d %{_lighttpddir} -c "HTTP User" -g lighttpd lighttpd
%post
/sbin/chkconfig --add %{name}
%groupremove lighttpd
fi
+%triggerpostun -- %{name} <= 1.3.6-2
+# upgraded
+if [ "$1" = "2" ]; then
+%banner %{name} -e <<EOF
+spawn-fcgi program is now available separately from spawn-fcgi package.
+
+EOF
+fi
+
%files
%defattr(644,root,root,755)
-%doc NEWS README
+%doc NEWS README ChangeLog doc/lighttpd.conf doc/*.txt doc/rrdtool-graph.sh
%attr(755,root,root) %{_sbindir}/*
%dir %{_libdir}
%attr(755,root,root) %{_libdir}/*.so
%dir %attr(750,lighttpd,root) /var/log/%{name}
%attr(755,lighttpd,lighttpd) %{_lighttpddir}
%attr(754,root,root) /etc/rc.d/init.d/%{name}
-%dir %attr(754,root,root) %{_sysconfdir}
-%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/*.*
-%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/%{name}
+%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/*
+%dir %attr(750,root,lighttpd) %{_sysconfdir}
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
+%attr(640,root,lighttpd) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.user
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
%{_mandir}/man?/*
+
+%files -n spawn-fcgi
+%defattr(644,root,root,755)
+%doc doc/spawn-php.sh
+%attr(755,root,root) %{_sbindir}/spawn-fcgi