%define webroot /var/thttpd %define alphatag b Name: thttpd Version: 2.25 Release: 1.n0i.0.%{alphatag} Epoch: 0 Summary: Tiny, turbo, throttleable lightweight http server. Group: System Environment/Daemons License: BSD URL: http://www.acme.com/software/thttpd/ Source0: http://www.acme.com/software/thttpd/%{name}-%{version}%{alphatag}.tar.gz Source1: %{name}.init Patch0: %{name}-dirindex.patch Patch1: %{name}-time.patch Patch2: %{name}-2.24-install.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: perl Prereq: /usr/sbin/groupadd, /usr/sbin/useradd, /sbin/chkconfig, /sbin/service %description Thttpd is a very compact no-frills httpd serving daemon that can handle very high loads. While lacking many of the advanced features of Apache, thttpd operates without forking and is extremely efficient in memory use. Basic support for cgi scripts, authentication, and ssi is provided for. Advanced features include the ability to throttle traffic. %prep %setup -q -n %{name}-%{version}%{alphatag} %patch0 -p1 %patch1 -p1 %patch2 -p1 %build %configure # Hacks :-) perl -pi -e 's/-o bin -g bin//g' Makefile perl -pi -e 's/.*chgrp.*//g; s/.*chmod.*//g' extras/Makefile make WEBDIR=%{webroot}/htdocs CGIBINDIR=%{webroot}/cgi-bin %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{webroot}/{cgi-bin,logs,htdocs} mkdir -p $RPM_BUILD_ROOT%{_mandir}/man{1,8} mkdir -p $RPM_BUILD_ROOT%{_sbindir} install -D -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/thttpd make install BINDIR=$RPM_BUILD_ROOT%{_sbindir} \ MANDIR=$RPM_BUILD_ROOT%{_mandir} \ WEBDIR=$RPM_BUILD_ROOT%{webroot}/htdocs \ CGIBINDIR=$RPM_BUILD_ROOT%{webroot}/cgi-bin mv $RPM_BUILD_ROOT%{_sbindir}/htpasswd $RPM_BUILD_ROOT%{_sbindir}/thtpasswd mv $RPM_BUILD_ROOT%{_mandir}/man1/htpasswd.1 $RPM_BUILD_ROOT%{_mandir}/man1/thtpasswd.1 cat << EOF > $RPM_BUILD_ROOT%{_sysconfdir}/thttpd.conf # BEWARE : No empty lines are allowed! # This section overrides defaults dir=%{webroot}/htdocs chroot user=thttpd # default = nobody logfile=/var/log/thttpd.log pidfile=/var/run/thttpd.pid # This section _documents_ defaults in effect # port=80 # nosymlink # default = !chroot # novhost # nocgipat # nothrottles # host=0.0.0.0 # charset=iso-8859-1 EOF %pre /usr/sbin/groupadd -r thttpd 2>/dev/null || : /usr/sbin/useradd -s /bin/false -c "Web server user" \ -d %{webroot} -M -r -g thttpd thttpd 2>/dev/null || : %post # first install? Then add service to # chkconfig, keeping it disabled (off) if [ "$1" == "1" ]; then /sbin/chkconfig --add thttpd /sbin/chkconfig thttpd off fi %preun if [ "$1" == "0" ]; then /sbin/service thttpd stop > /dev/null 2>&1 || : /sbin/chkconfig --del thttpd fi %postun [ "$1" -ge "1" ] && /sbin/service thttpd condrestart >/dev/null 2>&1 || : %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-, root, root) %doc README TODO %config %{_initrddir}/thttpd %config %{_sysconfdir}/thttpd.conf %attr(2755, root, thttpd) %{_sbindir}/makeweb %{_sbindir}/thtpasswd %{_sbindir}/syslogtocern %{_sbindir}/thttpd %attr(2775, thttpd, thttpd) %{webroot} %{_mandir}/man*/* %changelog * Sat Feb 14 2004 Marius FERARU 0:2.25-1.n0i.0.b - thttpd 2.25b - updated dirindex patch * Thu Nov 13 2003 Marius FERARU - thttpd 2.24 - misc spec cleanups (Fedora guidelines) - modified post script to keep service off after first install * Tue Apr 22 2003 Marius FERARU 2.23beta1-6.n0i - rebuild on RHL9 * Sun Mar 02 2003 Marius FERARU 2.23beta1-5.n0i - thttpd version 2.23beta1 - added by patch to dirindex display - post* scripts fixes - switched 'html' to 'htdocs' (Apache/NCSA really knew what they meant!) - switched user/group to thttpd/thttpd - renamed 'htpasswd' tool to 'thtpasswd' - disabled conflicting with apache! - using '_initrddir' macro - misc other spec cleanups * Fri May 4 2001 Matthias Saou - Spec file cleanup for Red Hat 7. - New, clean initscript. - Built the latest 2.21b version since 2.20b won't compile even with kgcc. - Custom config file based on the contrib/redhat one. * Wed Sep 13 2000 Jef Poskanzer - Updated to 2.20 * Mon Sep 11 2000 Bennett Todd - added thttpd.conf, took config info out of init script - switched to logging in /var/log, used pidfile * Thu Jun 15 2000 Jef Poskanzer - Updated to 2.19 * Thu May 18 2000 Jef Poskanzer - Updated to 2.18 * Fri Mar 17 2000 Jef Poskanzer - Updated to 2.17 * Mon Feb 28 2000 Jef Poskanzer - Updated to 2.16 * Thu Feb 03 2000 Jef Poskanzer - Updated to 2.15 * Thu Jan 21 2000 Jef Poskanzer - Updated to 2.14 * Thu Jan 6 2000 Jef Poskanzer - Updated to 2.13 * Mon Jan 3 2000 Bennett Todd - updated to 2.12, tweaked to move thttpd.init into tarball * Mon Dec 13 1999 Bennett Todd - Updated to 2.09 * Fri Dec 10 1999 Bennett Todd - Updated to 2.08 * Wed Nov 24 1999 Bennett Todd - updated to 2.06, parameterized Version string in source url - changed to use "make install", simplified %files list * Wed Nov 10 1999 Bennett Todd - Version 2.05, reset release to 1 - dropped bugfix patch since Jef included that - streamlined install * Sun Jul 25 1999 Bennett Todd - Release 4, added mime type swf * Mon May 3 1999 Bennett Todd - Release 2, added patch to set cgi-timelimit up to 10 minutes fm default 30 seconds * Wed Feb 10 1999 Bennett Todd - based on 2.00-2, bumped to 2.04, reset release back to 1 - fixed a couple of broken entries in %%install to reference %%buildroot - simplified %files to populate /usr/doc/... with just [A-Z]* (TODO had gone away, this simplification makes it liklier to be trivially portable to future releases). - added %doc tags for the man pages