Updated Redhat stuff from Simon Greaves.

Tweaked docs.  Added note about threads.

Submitted by: Simon Greaves

diff --git a/README.RedHat b/README.RedHat
index e244c41..8996d02 100644
--- a/README.RedHat
+++ b/README.RedHat
@@ -1,5 +1,9 @@
-The provided spec file has been tested on RedHat 6 and 7 systems where
-it seems to 'do the right thing', YMMV for other RPM based systems.
+The provided spec file has been tested on RedHat 7.3 systems where it
+seems to 'do the right thing', YMMV for other RPM based systems.  Of
+particular note is that the tclConfig.sh file that ships with
+RedHat7.3 has gcc flags that break mod_dtcl. The included
+contrib/redhat-buildtcl.patch has a workaround for this, and also
+configures paths and adds the '-DEAPI' flag.
 
 Building and installing the RPM should be straightforward, something
 like:
@@ -14,7 +18,7 @@
 into httpd.conf. The minimum you will require are:
 
 1) Open /etc/httpd/conf/httpd.conf in your favourite text editor and
-   locate the big list of lines starting 'LoadModule'. At the end of 
+   locate the big list of lines starting 'LoadModule'. At the end of
    this list, append:
 
 <IfDefine HAVE_DTCL>
diff --git a/contrib/redhat-buildtcl.patch b/contrib/redhat-buildtcl.patch
new file mode 100644
index 0000000..68d0d9e
--- /dev/null
+++ b/contrib/redhat-buildtcl.patch
@@ -0,0 +1,26 @@
+--- mod_dtcl.orig/builddtcl.sh	Wed Oct 10 03:29:47 2001
++++ mod_dtcl/builddtcl.sh	Wed Jul 24 12:54:01 2002
+@@ -39,7 +39,7 @@
+ fi
+ 
+ # Location of Apache include files.
+-INC=/usr/include/apache-1.3/  ######### CHANGEME ##########
++INC=/usr/include/apache
+ # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ # INC=$APACHE/src/include
+ 
+@@ -65,12 +65,13 @@
+ export TCL_CFLAGS_OPTIMIZE 
+ export TCL_CFLAGS_WARNING 
+ export TCL_EXTRA_CFLAGS
++EXTRA_FLAGS="-DEAPI" ; export EXTRA_FLAGS
+ export TCL_LIBS
+ export TCL_LIB_FLAG 
+ export TCL_LIB_SPEC
+ export TCL_PREFIX
+ export TCL_SHLIB_CFLAGS
+-export TCL_SHLIB_LD
++TCL_SHLIB_LD="gcc -pipe -shared" ; export TCL_SHLIB_LD
+ export TCL_SHLIB_SUFFIX
+ export TCL_STLIB_LD 
+ export TCL_SRC_DIR
diff --git a/docs/install.html b/docs/install.html
index 0683011..a4c212c 100644
--- a/docs/install.html
+++ b/docs/install.html
@@ -8,10 +8,10 @@
 
     <!-- $Id$ -->
     <h2 align="center">mod_dtcl Installation</h2>
-    
+
     <ol>
       <li><b>Check dependencies</b><br>
-	
+
 	To install mod_dtcl, you will need <b>Tcl 8.2</b> or greater
 	and <b>Apache 1.3.xx</b>.  It is known to run on Linux,
 	FreeBSD, OpenBSD, and Solaris and HPUX.  NT is also possible -
@@ -21,10 +21,10 @@
       <li><b>Get mod_dtcl</b><br>
 	If you are running a Debian or FreeBSD system, there
 	are pre-built packages available at:
-	<a target="_top" href="http://www.debian.org/Packages/unstable/web/libapache-mod-dtcl.html">http://www.debian.org/Packages/unstable/web/libapache-mod-dtcl.html</a> 
+	<a target="_top" href="http://www.debian.org/Packages/unstable/web/libapache-mod-dtcl.html">http://www.debian.org/Packages/unstable/web/libapache-mod-dtcl.html</a>
 
 	or
-	
+
 	<a
 	  target="_top" href="http://www.freebsd.org/cgi/ports.cgi?query=mod_dtcl">http://www.freebsd.org/cgi/ports.cgi?query=mod_dtcl</a>.<br>
 
@@ -47,7 +47,7 @@
 	</code>
       </li>
 
-      <li><b>Configuring, builddtcl.sh, etc...</b><br> 
+      <li><b>Configuring, builddtcl.sh, etc...</b><br>
 
 	Do you want to build mod_dtcl as a shared object (such as a
 	.so file on Linux, or a .dll on windows), or compile it
@@ -56,12 +56,18 @@
 	href="http://httpd.apache.org/docs/dso.html">manual</a> which
 	explains things in detail.
 
+	<p>
+	  <b>Note</b>: if you have a threaded Tcl, you may wish to
+	  modify the relevant section of mod_dtcl.h, which changes
+	  mod_dtcl to work properly with a threaded Tcl.
+	</p>
+
 	<ul>
 	  <li><b>For shared objects</b><br>
-	    
+
 	    <code>cd ../mod_dtcl/<br></code>
 	    Edit the <code>builddtcl.sh</code> script.  The 3
-	    variables you may need to change are: 
+	    variables you may need to change are:
 	    <ul>
 	      <li><code>TCLSH</code><br>
 		Name of the tclsh program on your computer.
@@ -89,7 +95,7 @@
 	    <code>/usr/lib/apache/1.3/</code>.
 
 	  </li>
-	  
+
 	  <li><b>For static builds</b><br>
 	    <code>
 	      cd apache-1.3.X/<br>
@@ -98,7 +104,7 @@
 
 	    <code>cd ../mod_dtcl/<br></code>
 	    Edit the <code>builddtcl.sh</code> script.  The 3
-	    variables you may need to change are: 
+	    variables you may need to change are:
 	    <ul>
 	      <li><code>TCLSH</code><br>
 		Name of the tclsh program on your computer.
@@ -127,22 +133,22 @@
 	    <code>export EXTRA_LIBS="-ltcl8.X -lm"</code><br>
 	    <code>make -e<br></code>
 	    <code>make install<br></code>
-	    
+
 	  </li>
 	</ul>
       </li>
-      <li><b>Configure Apache<br></b>		
+      <li><b>Configure Apache<br></b>
 	<ul>
 	  <li>
 	    <b>http.conf</b><br> <code>LoadModule dtcl_module
-	      /usr/lib/apache/1.3/mod_dtcl.so</code><br> 
+	      /usr/lib/apache/1.3/mod_dtcl.so</code><br>
 	    This points Apache to the shared object if
 	    mod_dtcl is being used as a loadable module.  In some
 	    cases, adding <code>AddModule mod_dtcl.c</code> seems to
 	      also have positive effects.
 	  </li>
 	  <li>
-	    <b>srm.conf</b><br> 
+	    <b>srm.conf</b><br>
 	    <code>AddType application/x-httpd-tcl .ttml</code><br>
 	    <code>AddType application/x-dtcl-tcl .tcl</code>
 	    (optional)<br>
diff --git a/mod_dtcl.spec b/mod_dtcl.spec
index 1dacec6..a3d948e 100644
--- a/mod_dtcl.spec
+++ b/mod_dtcl.spec
@@ -3,11 +3,12 @@
 
 Summary: Simple, fast Tcl server side scripting for Apache.
 Name: mod_dtcl
-Version: 0.11.5
+Version: 0.12.0
 Release: 1
 Copyright: Freely distributable and usable
 Group: System Environment/Daemons
 Source:	http://tcl.apache.org/mod_dtcl/download/%{name}-%{version}.tar.gz
+Patch: redhat-buildtcl.patch
 URL: http://tcl.apache.org/mod_dtcl/
 Packager: Simon Greaves <Simon.Greaves@bigfoot.com>
 BuildRoot: %{_tmppath}/%{name}-root
@@ -24,12 +25,10 @@
 
 %prep
 %setup -n %{name}
-sed -e 's/^INC=.*/INC=\/usr\/include\/apache/' \
-    -e 's/^APACHE=.*/APACHE=\/usr\/sbin/' \
-	< builddtcl.sh > rpm-builddtcl.sh
+%patch -p1 -b .redhat
 
 %build
-sh ./rpm-builddtcl.sh shared
+sh ./builddtcl.sh shared
 
 %install
 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
@@ -45,6 +44,10 @@
 %{_libdir}/apache/mod_dtcl.so
 
 %changelog
+* Wed Jul 24 2002 Simon Greaves <Simon.Greaves@bigfoot.com>
+- added -DEAPI, removed extra flags from TCL_SHLIB_LD which caused
+  problems at runtime, updated to mod_dtcl-0.12.0
+
 * Wed Aug  1 2001 Simon Greaves <Simon.Greaves@bigfoot.com>
 - mod_dtcl-0.11.1 packaged.