diff options
author | nbm <nbm@FreeBSD.org> | 2000-07-20 11:55:59 +0000 |
---|---|---|
committer | nbm <nbm@FreeBSD.org> | 2000-07-20 11:55:59 +0000 |
commit | d883c7a9bae18f0f6aa35d1da135d71a561f12e1 (patch) | |
tree | 792bef77b332c5a87a2f547bc605509ae1a0994d /www/tclhttpd/files | |
parent | ab5ed6f423da80fca2eac82e4b3ce014238e65bc (diff) | |
download | FreeBSD-ports-d883c7a9bae18f0f6aa35d1da135d71a561f12e1.zip FreeBSD-ports-d883c7a9bae18f0f6aa35d1da135d71a561f12e1.tar.gz |
Add tclhttpd, a pure-Tcl implementation of a HTTP server.
PR: ports/19870
Submitted by: Mikhail Teterin <mi@privatelabs.com>
Diffstat (limited to 'www/tclhttpd/files')
-rw-r--r-- | www/tclhttpd/files/patch-ab | 22 | ||||
-rw-r--r-- | www/tclhttpd/files/patch-ac | 32 | ||||
-rw-r--r-- | www/tclhttpd/files/patch-ad | 7 | ||||
-rw-r--r-- | www/tclhttpd/files/patch-ae | 16 | ||||
-rw-r--r-- | www/tclhttpd/files/patch-af | 5 | ||||
-rw-r--r-- | www/tclhttpd/files/patch-ah | 26 | ||||
-rw-r--r-- | www/tclhttpd/files/patch-pl | 52 | ||||
-rw-r--r-- | www/tclhttpd/files/pkgIndex.tcl | 5 | ||||
-rw-r--r-- | www/tclhttpd/files/tclhttpd.sh | 24 |
9 files changed, 189 insertions, 0 deletions
diff --git a/www/tclhttpd/files/patch-ab b/www/tclhttpd/files/patch-ab new file mode 100644 index 0000000..b6c9a4f --- /dev/null +++ b/www/tclhttpd/files/patch-ab @@ -0,0 +1,22 @@ +--- Makefile.in Wed Apr 26 16:35:29 2000 ++++ Makefile.in Thu Apr 27 16:24:39 2000 +@@ -124,3 +124,3 @@ + SERVER_ROOT = @SERVER_ROOT@ +-htdocsdir = $(SERVER_ROOT)/htdocs ++htdocsdir = $(prefix)/share/@PACKAGE@@VERSION@ + +@@ -220,3 +220,3 @@ + +-all: binaries libraries doc ++all: libraries doc + +@@ -236,3 +236,3 @@ + +-install: all install-binaries install-libraries install-doc ++install: all install-libraries install-doc + +@@ -315,3 +315,3 @@ + installdirs: +- $(mkinstalldirs) $(pkglibdir) $(cryptlibdir) $(prefix)/bin $(htdocsdir) ++ $(mkinstalldirs) $(pkglibdir) $(prefix)/bin $(htdocsdir) + diff --git a/www/tclhttpd/files/patch-ac b/www/tclhttpd/files/patch-ac new file mode 100644 index 0000000..0304fe8 --- /dev/null +++ b/www/tclhttpd/files/patch-ac @@ -0,0 +1,32 @@ +--- bin/httpd.tcl Wed Jun 14 13:25:50 2000 ++++ bin/httpd.tcl Wed Jun 21 15:59:34 2000 +@@ -82,21 +82,9 @@ + + # Search around for the Standard Tcl Library + +-if {![catch {package require base64 2.0}]} { +- # Already available in environment +-} elseif {[file exist [file join $home ../tcllib]]} { +- lappend auto_path [file join $home ../tcllib] +-} else { +- # Look for the CVS development sources +- set cvs [lindex [lsort -decreasing \ +- [glob -nocomplain [file join $home ../../tcllib*]]] 0] +- if {[file exist [file join $cvs modules]]} { +- lappend auto_path [file join $cvs modules] +- } elseif {[file exist [file join $cvs pkgIndex.tcl]]} { +- lappend auto_path $cvs +- } else { +- error "Cannot find Standard Tcl Library in auto_path:\n[join $auto_path \n]" +- } ++if {[catch {package require tcllib} e]} { ++ error "Cannot find Standard Tcl Library in auto_path:\n\ ++ [join $auto_path \n($e)\n]" + } + + set Config(home) $home +@@ -130,3 +130,3 @@ + } else { +- set Config(config) [file join $Config(home) tclhttpd.rc] ++ set Config(config) [file join $Config(home) ../etc/tclhttpd.rc] + } diff --git a/www/tclhttpd/files/patch-ad b/www/tclhttpd/files/patch-ad new file mode 100644 index 0000000..4ddfcb2 --- /dev/null +++ b/www/tclhttpd/files/patch-ad @@ -0,0 +1,7 @@ +--- configure Wed Apr 26 17:44:05 2000 ++++ configure Thu Apr 27 18:44:11 2000 +@@ -1850,3 +1850,3 @@ + MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(\$@_OBJECTS)" +- MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(\$@_OBJECTS) \${SHLIB_LDFLAGS} \${SHLIB_LD_LIBS}" ++ MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$> \${SHLIB_LDFLAGS} \${SHLIB_LD_LIBS}" + ;; diff --git a/www/tclhttpd/files/patch-ae b/www/tclhttpd/files/patch-ae new file mode 100644 index 0000000..2cdf64b --- /dev/null +++ b/www/tclhttpd/files/patch-ae @@ -0,0 +1,16 @@ +--- bin/tclhttpd.rc Mon Apr 24 21:39:19 2000 ++++ bin/tclhttpd.rc Fri Apr 28 19:23:21 2000 +@@ -24,2 +24,3 @@ + foreach d [list \ ++ [file join [Config home] ../share/tclhttpd3.0.3] \ + [file join [Config home] ../htdocs] \ +@@ -36,3 +36,3 @@ + +-Config uid 50 ++Config uid 65534 ;# BSD's nobody + +@@ -45,3 +45,3 @@ + +-Config gid 50 ++Config gid 65534 ;# BSD's nobody group + diff --git a/www/tclhttpd/files/patch-af b/www/tclhttpd/files/patch-af new file mode 100644 index 0000000..74df2c3 --- /dev/null +++ b/www/tclhttpd/files/patch-af @@ -0,0 +1,5 @@ +--- lib/log.tcl Mon Apr 3 20:00:28 2000 ++++ lib/log.tcl Fri May 5 10:01:58 2000 +@@ -29,1 +29,1 @@ +- set Log(compressProg) /usr/local/bin/gzip ++ set Log(compressProg) /usr/bin/gzip diff --git a/www/tclhttpd/files/patch-ah b/www/tclhttpd/files/patch-ah new file mode 100644 index 0000000..2c2d15c --- /dev/null +++ b/www/tclhttpd/files/patch-ah @@ -0,0 +1,26 @@ +This is needed, because of the way tcllib's pkgIndex.tcl is laid +out. The _children_ of the directory containing tcllib itself are +not searched for packages the first time. So + ``package require <some sub package>'' +will fail the first time :(. This is, probably, a bug in tcllib, +but this is a workaround. ++++ htdocs/cgi-bin/flip.cgi Fri May 5 11:34:19 2000 +@@ -5,4 +5,3 @@ + if {[catch { +- package require ncgi +- package require html ++ package require tcllib + ++++ htdocs/cgi-bin/redirect.cgi Fri May 5 11:34:31 2000 +@@ -5,3 +5,3 @@ + if {[catch { +- package require ncgi ++ package require tcllib + ++++ htdocs/cgi-bin/test.cgi Fri May 5 11:34:47 2000 +@@ -5,4 +5,3 @@ + if {[catch { +- package require ncgi +- package require html ++ package require tcllib + diff --git a/www/tclhttpd/files/patch-pl b/www/tclhttpd/files/patch-pl new file mode 100644 index 0000000..98437d8 --- /dev/null +++ b/www/tclhttpd/files/patch-pl @@ -0,0 +1,52 @@ +This patch adds a way to add the functionality to the server by +specifying extra files it should source on startup. Those files can +define MIME type handlers, subtree handlers etc (see the server's +documentation for what they can do -- very powerful stuff). + +According to the software's author, Brent Welch, there is currently no +other way to extend the server -- other then adding code to the +httpd.tcl (or other files) directly. The tclhttpd.rc file is executed by +a safe interpreter and so can not load any other files itself. + ++++ bin/httpd.tcl 2000/05/16 23:09:50 +@@ -152,4 +152,5 @@ + [list threads.arg [cget threads] {Number of worker threads (zero for non-threaded)}] \ + [list library.arg [cget library] {Directory list where custom packages and auto loads are}] \ ++ [list extrafiles.arg [cget ExtraFiles] {Extra files to source}] \ + [list debug.arg 0 {If true, start interactive command loop}] \ + ] \ +@@ -228,7 +229,9 @@ + } + } +-if ![catch { ++if {[catch { + setuid $Config(uid) $Config(gid) +-}] { ++} e]} { ++ Stderr "failed to suid to $Config(uid).$Config(gid): $e" ++} else { + Stderr "Running as user $Config(uid)" + } +@@ -256,4 +259,6 @@ + append error "\n$errorInfo" + error $error ++} else { ++ puts stderr "Sourced [file nativename $Config(main)] nicely" + } + ++++ bin/httpdthread.tcl 2000/05/10 19:32:55 +@@ -142,2 +142,14 @@ + } + ++if {[info exists Config(extrafiles)]} { ++ puts stderr "Proceeding to source $Config(extrafiles)" ++ foreach f $Config(extrafiles) { ++ if {[catch "source $f" e]} { ++ puts stderr "Failed to source $f: $e" ++ } else { ++ puts stderr "Sourced $f ($e)." ++ } ++ } ++} else { ++ puts stderr "No extra files specified" ++} diff --git a/www/tclhttpd/files/pkgIndex.tcl b/www/tclhttpd/files/pkgIndex.tcl new file mode 100644 index 0000000..40dbfd4 --- /dev/null +++ b/www/tclhttpd/files/pkgIndex.tcl @@ -0,0 +1,5 @@ +# Tiny helper binaries for thc TclHttp-daemon providing the +# functionality not available in the TCL itself: +package ifneeded crypt 1.0 [list load [file join $dir libcrypt.so]] +package ifneeded setuid 1.0 [list load [file join $dir libsetuid.so]] +package ifneeded limit 1.0 [list load [file join $dir liblimit.so]] diff --git a/www/tclhttpd/files/tclhttpd.sh b/www/tclhttpd/files/tclhttpd.sh new file mode 100644 index 0000000..bba81a7 --- /dev/null +++ b/www/tclhttpd/files/tclhttpd.sh @@ -0,0 +1,24 @@ +#!/bin/sh +PID_FILE=/var/run/tclhttpd.pid +case $1 in + stop) + if [ -e $PID_FILE ] ; then + PID=`cat $PID_FILE` + if kill $PID ; then + exec rm -f $PID_FILE + fi + else + echo "No $PID_FILE presenet, tclhttpd is, probably, not running" > /dev/stderr + fi + ;; + ''|start) + COMMAND_LINE & + sleep 2 + if kill -0 $! ; then + echo -n ' tclhttpd' + echo $! > $PID_FILE + else + exec logger -s "tclhttpd failed to start" + fi + ;; +esac |