Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Dec 2000 19:02:50 -0500 (EST)
From:      Mikhail Teterin <mi@privatelabs.com>
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        welch@scriptics.com, jseger@freebsd.org
Subject:   ports/23310: maintainer upgrade: www/tclhttpd
Message-ID:  <200012060002.eB602or21730@misha.privatelabs.com>
Resent-Message-ID: <200012060010.eB60AFU61645@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         23310
>Category:       ports
>Synopsis:       maintainer upgrade: www/tclhttpd
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 05 16:10:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Mikhail Teterin
>Release:        FreeBSD 4.1.1-STABLE i386
>Organization:
Virtual Estates, Inc.
>Environment:

>Description:

	Upgrading to the latest version of 3.2.1. The tclhttpd now
	has a standard way of adding custom code, so the files/patch-pl
	is gone.

	To keep the port interesting :), it now links all four binary
	libraries used by the server (utime, crypt, limit, setuid) into
	one to reduce the run-time virtual memory footprint and start-up
	time.

	Judging by the software's web-site, TCL-8.3.2 can help it,
	especially in case SSL is used.

>How-To-Repeat:


>Fix:

--- Makefile	Thu Jul 20 07:55:45 2000
+++ Makefile	Tue Dec  5 18:51:10 2000
@@ -8,3 +8,3 @@
 PORTNAME=	tclhttpd
-PORTVERSION= 	3.0.3
+PORTVERSION= 	3.2.1
 CATEGORIES=	www tcl${TCL_VER}
@@ -16,3 +16,3 @@ MAINTAINER=	mi@aldan.algebra.com
 
-RUN_DEPENDS=	${LOCALBASE}/lib/tcllib0.4/pkgIndex.tcl:${PORTSDIR}/devel/tcllib
+RUN_DEPENDS=	${LOCALBASE}/lib/tcllib0.8/pkgIndex.tcl:${PORTSDIR}/devel/tcllib
 LIB_DEPENDS=	tcl${TCL_VER}:${PORTSDIR}/lang/tcl${TCL_VER}
@@ -25,10 +25,15 @@ CONFIGURE_ARGS=	--with-tcl="${LOCALBASE}
 
+RCD=	${LOCALBASE}/etc/rc.d/tclhttpd.sh
+
+.include <bsd.port.pre.mk>
+SHLIB_NAME!=	${MAKE} -f "${FILESDIR}/Makefile.lib" echo
 PLIST_SUB+=	TCL_VER=${TCL_VER} PORTVERSION=${PORTVERSION} \
-	"LIBSUF=`echo ${PORTOBJFORMAT} | ${SED} -e s/elf/1/ -e s/aout/1.0/`"
+		SHLIB_NAME=${SHLIB_NAME}
 
-RCD=	${LOCALBASE}/etc/rc.d/tclhttpd.sh
+do-build:
+	cd ${WRKSRC} && ${MAKE} -j 2 TCL_DVER="${TCL_DVER}" \
+		FILESDIR="${FILESDIR}" -f "${FILESDIR}/Makefile.lib"
 
-SCRIPTS_ENV+=	LOCALBASE=${LOCALBASE} WRKSRC=${WRKSRC}} \
-		CFLAGS="${CFLAGS}" TCL_DVER=${TCL_DVER} \
-		TCL_VER=${TCL_VER}
+pre-install:
+	${MKDIR} ${LOCALBASE}/tclhttpd/custom
 
@@ -38,10 +43,8 @@ post-install:
 		< ${FILESDIR}/tclhttpd.sh > ${RCD}
-	${MKDIR} ${LOCALBASE}/${PORTNAME}${PORTVERSION}
 	${CHOWN} -R nobody ${LOCALBASE}/share/${PORTNAME}${PORTVERSION}
-	#${LN} -sf ${LOCALBASE}/share/${PORTNAME}${PORTVERSION} \
+	#${LN} -sf ${LOCALBASE}/share/${PORTNAME} \
 	#	${LOCALBASE}/${PORTNAME}${PORTVERSION}/htdocs
 	${CHMOD} +x ${RCD}
-	${INSTALL_DATA} ${WRKSRC}/src/libcrypt.so.* \
-		${WRKSRC}/src/liblimit.so.* ${WRKSRC}/src/libsetuid.so.* \
-			${LOCALBASE}/lib/${PORTNAME}${PORTVERSION}/
+	${INSTALL_DATA} ${WRKSRC}/${SHLIB_NAME} \
+		${LOCALBASE}/lib/${PORTNAME}${PORTVERSION}/${SHLIB_NAME}
 	${INSTALL_SCRIPT} ${WRKSRC}/bin/httpd.tcl \
@@ -49,12 +52,6 @@ post-install:
 	${INSTALL_DATA} ${WRKSRC}/bin/tclhttpd.rc ${LOCALBASE}/etc/
-	${CAT} ${FILESDIR}/pkgIndex.tcl >> \
+	${SED} 's%@LIB@%${SHLIB_NAME}%g' < \
+		${FILESDIR}/pkgIndex.tcl >> \
 		${LOCALBASE}/lib/${PORTNAME}${PORTVERSION}/pkgIndex.tcl
-	for f in ${LOCALBASE}/lib/${PORTNAME}${PORTVERSION}/lib*.so.* ; \
-	do \
-		${LN} -sf `basename $$f` \
-			`echo $$f | ${SED} 's@\(.*\.so\)\..*@\1@'` ; \
-	done
-
-do-build:	# empty -- everything done by ${SCRIPTDIR}/pre-build
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
--- distinfo	Thu Jul 20 07:55:51 2000
+++ distinfo	Fri Dec  1 14:06:01 2000
@@ -1 +1 @@
-MD5 (tclhttpd3.0.3.tar.gz) = d2b48707b786cf560c03740eb3557d50
+MD5 (tclhttpd3.2.1.tar.gz) = 0b628a24333419532142242a286773c4
--- files/Makefile.lib	Wed Dec 31 19:00:00 1969
+++ files/Makefile.lib	Fri Dec  1 20:17:39 2000
@@ -0,0 +1,20 @@
+TCL_DVER?=	8.3
+TCL_VER=	${TCL_DVER:S/.//}
+
+SRCS=crypt.c setuid.c limit.c utime.c metaPackage.c
+
+CFLAGS+=-I${LOCALBASE}/include/tcl${TCL_DVER} -DUSE_TCL_STUBS \
+	-DTclhttpdbin_Init=${LIB}_Init -Wall -Werror
+LDADD+=-L${PREFIX}/lib -ltclstub${TCL_VER} -lcrypt
+
+.PATH:	${.CURDIR}/src ${FILESDIR}
+
+LIB=	Tclhttpdbin
+SHLIB_NAME=	lib${LIB}.so
+INTERNALLIB=	no need for static version
+NOPROFILE=	no need for profiling this
+
+echo:
+	@echo ${SHLIB_NAME}
+
+.include <bsd.lib.mk>
--- files/metaPackage.c	Wed Dec 31 19:00:00 1969
+++ files/metaPackage.c	Fri Dec  1 16:39:39 2000
@@ -0,0 +1,13 @@
+#include <tcl.h>
+
+Tcl_PackageInitProc Crypt_Init, Limit_Init, Setuid_Init, Utime_Init;
+
+int Tclhttpdbin_Init(Tcl_Interp *I) {
+
+	Crypt_Init(I);
+	Limit_Init(I);
+	Setuid_Init(I);
+	Utime_Init(I);
+
+	return TCL_OK;
+}
--- files/patch-ab	Thu Jul 20 07:55:54 2000
+++ files/patch-ab	Fri Dec  1 15:43:04 2000
@@ -17,6 +17 @@
  
-@@ -315,3 +315,3 @@
- installdirs:
--	$(mkinstalldirs) $(pkglibdir) $(cryptlibdir) $(prefix)/bin $(htdocsdir)
-+	$(mkinstalldirs) $(pkglibdir) $(prefix)/bin $(htdocsdir)
- 
--- files/patch-ac	Thu Jul 20 07:55:54 2000
+++ files/patch-ac	Fri Dec  1 15:44:38 2000
@@ -2,27 +2,2 @@
 +++ 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 @@
--- files/patch-ae	Thu Jul 20 07:55:54 2000
+++ files/patch-ae	Tue Dec  5 18:39:09 2000
@@ -2,6 +2,2 @@
 +++ 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 @@
--- files/patch-ak	Wed Dec 31 19:00:00 1969
+++ files/patch-ak	Fri Dec  1 20:16:34 2000
@@ -0,0 +1,75 @@
+--- src/limit.c	Thu May 11 02:00:43 2000
++++ src/limit.c	Fri Dec  1 20:04:58 2000
+@@ -20,7 +20,6 @@
+ int
+-LimitCmd(ClientData data, Tcl_Interp *interp, int argc, char *argv[])
++LimitCmd(ClientData data, Tcl_Interp *interp, int argc, Tcl_Obj *CONST objv[])
+ {
+-    int max;
+-    char buf[32];
+     struct rlimit limit;
++    Tcl_Obj *limObj[2];
+     Tcl_ResetResult(interp);
+@@ -31,3 +30,4 @@
+     if (argc > 1) {
+-	Tcl_GetInt(interp, argv[1], (int *)&limit.rlim_cur);
++	if (Tcl_GetLongFromObj(interp, objv[1], (long *)&limit.rlim_cur)
++		!= TCL_OK) return TCL_ERROR;
+         if (setrlimit(RLIMIT_NOFILE, &limit) < 0) {
+@@ -37,3 +37,5 @@
+     }
+-    sprintf(interp->result, "%d %d", limit.rlim_cur, limit.rlim_max);
++    limObj[0] = Tcl_NewLongObj((long)limit.rlim_cur);
++    limObj[1] = Tcl_NewLongObj((long)limit.rlim_max);
++    Tcl_SetObjResult(interp, Tcl_NewListObj(2, limObj));
+     return TCL_OK;
+@@ -54,3 +56,3 @@
+ {
+-    Tcl_CreateCommand(interp, "limit", LimitCmd, NULL, NULL);
++    Tcl_CreateObjCommand(interp, "limit", LimitCmd, NULL, NULL);
+     Tcl_PkgProvide(interp, "limit", "1.0");
+--- src/setuid.c	Tue Oct  6 20:12:11 1998
++++ src/setuid.c	Fri Dec  1 20:05:52 2000
+@@ -7,2 +7,3 @@
+ #include <sys/types.h>
++#include <unistd.h>
+ 
+--- src/utime.c	Tue Oct  6 20:12:11 1998
++++ src/utime.c	Fri Dec  1 20:14:21 2000
+@@ -20,13 +20,8 @@
+ int
+-UtimeCmd(ClientData data, Tcl_Interp *interp, int argc, char *argv[])
++UtimeCmd(ClientData data, Tcl_Interp *interp, int argc, Tcl_Obj *CONST objv[])
+ {
+     struct utimbuf u = {0, 0};
++    char *file;
+ 
+     Tcl_ResetResult(interp);
+-    if (argc > 3) {
+-	Tcl_GetInt(interp, argv[3], &u.actime);	/* new access time */
+-    }
+-    if (argc > 2) {
+-	Tcl_GetInt(interp, argv[2], &u.modtime);	/* new modify time */
+-    }
+     if (argc > 4 || argc <= 1) {
+@@ -35,4 +30,13 @@
+     }
+-    if (utime(argv[1], &u) < 0) {
+-	Tcl_AppendResult(interp, "utime: ", argv[1], Tcl_PosixError(interp), NULL);
++    if (argc > 3) {
++	if (Tcl_GetLongFromObj(interp, objv[3], (long *)&u.actime)
++		!= TCL_OK) return TCL_ERROR;	/* new access time */
++    }
++    if (argc > 2) {
++	if (Tcl_GetLongFromObj(interp, objv[2], (long *)&u.modtime)
++		!= TCL_OK) return TCL_ERROR;	/* new modify time */
++    }
++    file = Tcl_GetString(objv[1]);
++    if (utime(file, &u) < 0) {
++	Tcl_AppendResult(interp, "utime: ", file, Tcl_PosixError(interp), NULL);
+ 	return TCL_ERROR;
+@@ -55,3 +59,3 @@
+ {
+-    Tcl_CreateCommand(interp, "utime", UtimeCmd, NULL, NULL);
++    Tcl_CreateObjCommand(interp, "utime", UtimeCmd, NULL, NULL);
+     Tcl_PkgProvide(interp, "utime", "1.0");
--- files/patch-bg	Sat Aug 12 22:12:50 2000
+++ files/patch-bg	Wed Dec 31 19:00:00 1969
@@ -1,9 +0,0 @@
---- lib/httpd.tcl	Sat Jun 10 05:59:52 2000
-+++ lib/httpd.tcl	Wed Aug  2 18:18:18 2000
-@@ -1305,5 +1305,5 @@
- 		[list HttpdCloseFinal $sock]]
- 
--	    Httpd_GetPostDataAsync $sock "" HttpdCloseFinal
-+	    Httpd_GetPostDataAsync $sock "" $data(count) HttpdCloseFinal
- 	} else {
- 	    HttpdCloseFinal $sock
--- files/patch-pl	Thu Jul 20 07:55:54 2000
+++ files/patch-pl	Wed Dec 31 19:00:00 1969
@@ -1,52 +0,0 @@
-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"
-+}
--- files/pkgIndex.tcl	Thu Jul 20 07:55:51 2000
+++ files/pkgIndex.tcl	Tue Dec  5 18:50:42 2000
@@ -2,4 +2,5 @@
 # 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]]
+package ifneeded crypt 1.0 [list load $dir/@LIB@]
+package ifneeded setuid 1.0 [list load $dir/@LIB@]
+package ifneeded limit 1.0 [list load $dir/@LIB@]
+package ifneeded utime 1.0 [list load $dir/@LIB@]
--- pkg-plist	Sat Nov 11 06:09:01 2000
+++ pkg-plist	Tue Dec  5 18:34:05 2000
@@ -4,8 +4,3 @@ etc/tclhttpd.rc
 etc/rc.d/tclhttpd.sh
-lib/tclhttpd%%PORTVERSION%%/libsetuid.so.%%LIBSUF%%
-lib/tclhttpd%%PORTVERSION%%/libsetuid.so
-lib/tclhttpd%%PORTVERSION%%/liblimit.so.%%LIBSUF%%
-lib/tclhttpd%%PORTVERSION%%/liblimit.so
-lib/tclhttpd%%PORTVERSION%%/libcrypt.so.%%LIBSUF%%
-lib/tclhttpd%%PORTVERSION%%/libcrypt.so
+lib/tclhttpd%%PORTVERSION%%/%%SHLIB_NAME%%
 lib/tclhttpd%%PORTVERSION%%/admin.tcl
@@ -19,3 +14,2 @@ lib/tclhttpd%%PORTVERSION%%/direct.tcl
 lib/tclhttpd%%PORTVERSION%%/dirlist.tcl
-lib/tclhttpd%%PORTVERSION%%/discover.tcl
 lib/tclhttpd%%PORTVERSION%%/doc.tcl
@@ -25,2 +19,3 @@ lib/tclhttpd%%PORTVERSION%%/include.tcl
 lib/tclhttpd%%PORTVERSION%%/log.tcl
+lib/tclhttpd%%PORTVERSION%%/logstd.tcl
 lib/tclhttpd%%PORTVERSION%%/mail.tcl
@@ -30,3 +25,5 @@ lib/tclhttpd%%PORTVERSION%%/mtype.tcl
 lib/tclhttpd%%PORTVERSION%%/open.tcl
+lib/tclhttpd%%PORTVERSION%%/passcheck.tcl
 lib/tclhttpd%%PORTVERSION%%/pkgIndex.tcl
+lib/tclhttpd%%PORTVERSION%%/prodebug.tcl
 lib/tclhttpd%%PORTVERSION%%/redirect.tcl
@@ -57,2 +54,3 @@ share/tclhttpd%%PORTVERSION%%/test.tml
 share/tclhttpd%%PORTVERSION%%/access/README.txt
+share/tclhttpd%%PORTVERSION%%/access/index.tml
 share/tclhttpd%%PORTVERSION%%/access/auth/hello.txt
@@ -97,2 +95,3 @@ share/tclhttpd%%PORTVERSION%%/forms/file
 share/tclhttpd%%PORTVERSION%%/forms/form1.tml
+share/tclhttpd%%PORTVERSION%%/forms/formget.tml
 share/tclhttpd%%PORTVERSION%%/forms/headers.tml
@@ -110,2 +109,3 @@ share/tclhttpd%%PORTVERSION%%/guestbook/
 share/tclhttpd%%PORTVERSION%%/guestbook/newguest.html
+share/tclhttpd%%PORTVERSION%%/images/AjubaLogo.gif
 share/tclhttpd%%PORTVERSION%%/images/Blue.gif
@@ -141,2 +141,6 @@ share/tclhttpd%%PORTVERSION%%/java/auth.
 share/tclhttpd%%PORTVERSION%%/java/test.html
+share/tclhttpd%%PORTVERSION%%/links/INSTALL.txt
+share/tclhttpd%%PORTVERSION%%/links/README.txt
+share/tclhttpd%%PORTVERSION%%/links/README.ssl.txt
+share/tclhttpd%%PORTVERSION%%/links/WHATSNEW.txt
 share/tclhttpd%%PORTVERSION%%/libtml/Index
@@ -188,2 +192,3 @@ share/tclhttpd%%PORTVERSION%%/stats/notf
 share/tclhttpd%%PORTVERSION%%/stats/.tml
+share/tclhttpd%%PORTVERSION%%/templates/faqfaq.tml
 share/tclhttpd%%PORTVERSION%%/templates/form.tml
@@ -208,2 +213,3 @@ share/tclhttpd%%PORTVERSION%%/.tml
 @dirrm share/tclhttpd%%PORTVERSION%%/libtml
+@dirrm share/tclhttpd%%PORTVERSION%%/links
 @dirrm share/tclhttpd%%PORTVERSION%%/manual
@@ -216,2 +222,9 @@ share/tclhttpd%%PORTVERSION%%/.tml
 @dirrm share/tclhttpd%%PORTVERSION%%
-@dirrm tclhttpd%%PORTVERSION%%
+tclhttpd/custom/README
+tclhttpd/custom/hello.tcl
+tclhttpd/custom/snmpinit.tcl
+tclhttpd/custom/tclpro.tcl
+@dirrm tclhttpd/custom
+tclhttpd/README
+tclhttpd/README_custom
+@dirrm tclhttpd
--- scripts/pre-build	Thu Jul 20 07:55:59 2000
+++ scripts/pre-build	Wed Dec 31 19:00:00 1969
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-crypt_SRCS="crypt.c cryptLib.c"
-setuid_SRCS=setuid.c
-limit_SRCS=limit.c
-
-cd ${WRKSRC}/src
-
-for l in crypt setuid limit
-do
-	make INTERNALLIB=Y NOPROFILE=Y \
-		LIB=${l} SHLIB_MAJOR=1 SHLIB_MINOR=0 \
-		SRCS="`eval echo \\$${l}_SRCS`" -ECFLAGS \
-		CFLAGS="${CFLAGS} -I${PREFIX}/include/tcl${TCL_DVER} -DUSE_TCL_STUBS" \
-		LDADD="-L${PREFIX}/lib -ltclstub${TCL_VER} -lcrypt" \
-		-f bsd.lib.mk \
-	|| exit 1
-done

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200012060002.eB602or21730>