wok-undigest rev 0

Add thttpd
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Fri Mar 19 18:55:59 2010 +0100 (2010-03-19)
parents
children de3424a293fd
files thttpd/receipt thttpd/stuff/etc/init.d/thttpd thttpd/stuff/etc/thttpd/thttpd.conf thttpd/stuff/htpassword.c.u
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/thttpd/receipt	Fri Mar 19 18:55:59 2010 +0100
     1.3 @@ -0,0 +1,37 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="thttpd"
     1.7 +VERSION="2.25b"
     1.8 +CATEGORY="network"
     1.9 +SHORT_DESC="Throttleable lightweight httpd server"
    1.10 +MAINTAINER="erjo@slitaz.org"
    1.11 +DEPENDS=""
    1.12 +TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.13 +WEB_SITE="http://www.acme.com/software/thttpd/"
    1.14 +WGET_URL="http://www.acme.com/software/thttpd/$TARBALL"
    1.15 +
    1.16 +# Rules to configure and make the package.
    1.17 +compile_rules()
    1.18 +{
    1.19 +	cd $src
    1.20 +	patch -p1 -i ../stuff/htpassword.c.u || exit 1
    1.21 +	./configure \
    1.22 +		--prefix=/usr \
    1.23 +		--infodir=/usr/share/info \
    1.24 +		--mandir=/usr/share/man \
    1.25 +		$CONFIGURE_ARGS &&
    1.26 +	make 
    1.27 +}
    1.28 +
    1.29 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.30 +genpkg_rules()
    1.31 +{
    1.32 +	mkdir -p $fs/usr/sbin \
    1.33 +		$fs/var/log/thttpd \
    1.34 +		
    1.35 +	cp -a $src/thttpd $fs/usr/sbin
    1.36 +	cp -a $src/extras/htpasswd $fs/usr/sbin
    1.37 +	cp -a $src/extras/syslogtocern $fs/usr/sbin
    1.38 +	cp -a stuff/etc $fs/
    1.39 +}
    1.40 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/thttpd/stuff/etc/init.d/thttpd	Fri Mar 19 18:55:59 2010 +0100
     2.3 @@ -0,0 +1,56 @@
     2.4 +#!/bin/sh
     2.5 +# /etc/init.d/thttpd : Start, stop and restart SSH server on SliTaz, at 
     2.6 +# boot time or with the command line.
     2.7 +#
     2.8 +# To start SSH server at boot time, just put thttpd in the $RUN_DAEMONS
     2.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf
    2.10 +#
    2.11 +. /etc/init.d/rc.functions
    2.12 +. /etc/daemons.conf
    2.13 +
    2.14 +NAME=thttpd
    2.15 +DESC="Thttpd server"
    2.16 +DAEMON=/usr/sbin/thttpd
    2.17 +CONFIG_FILE=/etc/thttpd/thttpd.conf
    2.18 +OPTIONS="-C $CONFIG_FILE -D"
    2.19 +PIDFILE=/var/run/thttpd.pid
    2.20 +
    2.21 +case "$1" in
    2.22 +  start)
    2.23 +     if active_pidfile $PIDFILE thttpd ; then
    2.24 +      echo "$NAME already running."
    2.25 +      exit 1
    2.26 +    fi
    2.27 +    echo -n "Starting $DESC: $NAME... "
    2.28 +    $DAEMON $OPTIONS
    2.29 +    status
    2.30 +    ;;
    2.31 +  stop)
    2.32 +    if ! active_pidfile $PIDFILE thttpd ; then
    2.33 +      echo "$NAME is not running."
    2.34 +      exit 1
    2.35 +    fi
    2.36 +    echo -n "Stopping $DESC: $NAME... "
    2.37 +    kill `cat $PIDFILE`
    2.38 +    status
    2.39 +    ;;
    2.40 +  restart)
    2.41 +    if ! active_pidfile $PIDFILE thttpd ; then
    2.42 +      echo "$NAME is not running."
    2.43 +      exit 1
    2.44 +    fi
    2.45 +    echo -n "Restarting $DESC: $NAME... "
    2.46 +    kill `cat $PIDFILE`
    2.47 +    sleep 2
    2.48 +    $DAEMON $OPTIONS
    2.49 +    status
    2.50 +    ;;
    2.51 +  *)
    2.52 +    echo ""
    2.53 +    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    2.54 +    echo ""
    2.55 +    exit 1
    2.56 +    ;;
    2.57 +esac
    2.58 +
    2.59 +exit 0
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/thttpd/stuff/etc/thttpd/thttpd.conf	Fri Mar 19 18:55:59 2010 +0100
     3.3 @@ -0,0 +1,7 @@
     3.4 +# This section overrides defaults
     3.5 +port=10000
     3.6 +dir=/var/www
     3.7 +chroot
     3.8 +user=www
     3.9 +logfile=/var/log/thttpd.log
    3.10 +pidfile=/var/run/thttpd.pid
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/thttpd/stuff/htpassword.c.u	Fri Mar 19 18:55:59 2010 +0100
     4.3 @@ -0,0 +1,20 @@
     4.4 +--- thttpd-2.25b-ori/extras/htpasswd.c	Wed Dec 19 01:08:08 2001
     4.5 ++++ thttpd-2.25b/extras/htpasswd.c	Sun Feb 28 23:02:36 2010
     4.6 +@@ -49,7 +49,7 @@
     4.7 +     while((line[y++] = line[x++]));
     4.8 + }
     4.9 + 
    4.10 +-static int getline(char *s, int n, FILE *f) {
    4.11 ++static int xgetline(char *s, int n, FILE *f) {
    4.12 +     register int i=0;
    4.13 + 
    4.14 +     while(1) {
    4.15 +@@ -189,7 +189,7 @@
    4.16 +     strcpy(user,argv[2]);
    4.17 + 
    4.18 +     found = 0;
    4.19 +-    while(!(getline(line,MAX_STRING_LEN,f))) {
    4.20 ++    while(!(xgetline(line,MAX_STRING_LEN,f))) {
    4.21 +         if(found || (line[0] == '#') || (!line[0])) {
    4.22 +             putline(tfp,line);
    4.23 +             continue;