--- Portfile-orig	Mon Aug 11 23:42:41 2003
+++ Portfile	Wed Aug 13 13:47:45 2003
@@ -1,48 +1,76 @@
+# $Id: Portfile,v 1.3 2003/08/05 09:29:40 jkh Exp $
+
 PortSystem 1.0
-name            apache2
-version         2.0.47
-categories      www
-platforms       darwin freebsd
-maintainers     jcorley1@nc.rr.com
-description     The extremely popular second version of the Apache http server 
-long_description        Apache is an HTTP server designed as a plug-in replacement for \
-                        the NCSA server version 1.3 (or 1.4). It fixes numerous bugs in \
-                        the NCSA server and includes many frequently requested new \
-                        features, and has an API which allows it to be extended to meet \
-                        users' needs more easily. This is version 2.0.47 of Apache.
-
-master_sites    http://www.tux.org/pub/net/apache/dist/httpd/ \
-                http://apache.mirror.digitalspace.net/httpd/ \
-                http://www.apache.inetcosmos.org/dist/httpd/ \
-                http://www.rge.com/pub/infosystems/apache/httpd/ \
-                http://www.tux.org/pub/net/apache/dist/httpd/ \
-                http://apache.mirror.digitalspace.net/httpd/ \
-                http://www.rge.com/pub/infosystems/apache/httpd/ \
-                http://ftp.epix.net/apache/httpd/
-
-distname        httpd-${version}
-checksums       md5 63f16638c18b140b649fab32b54d7f9c 
-depends_lib     lib:libapr-0.0:apr lib:libaprutil-0.0:apr-util
-patchfiles      patch-httpd-std.conf.in
-configure.env   CC=/usr/bin/gcc CPP=/usr/bin/cpp
-configure.args  --with-layout=FreeBSD --with-apr=${prefix}/bin/apr-config \
-                --with-apr-util=${prefix}/bin --prefix=${prefix}/${name} \
-                --enable-mods-shared=all --enable-ssl --with-ssl \
-                --enable-deflate --enable-proxy --enable-proxy-connect \
-                --enable-proxy-http --enable-proxy-ftp
-
-destroot.args   root=${destroot}
-post-destroot {         system "touch ${destroot}${prefix}/${name}/logs/.turd"
-                system "test -L ${destroot}${prefix}/${name}/build/libtool \
-                        || ln -s /usr/bin/glibtool \
-                        ${destroot}${prefix}/${name}/build/libtool" }
+name		apache2
+version		2.0.47
+categories	www
+platforms	darwin freebsd
+maintainers	jcorley1@nc.rr.com
+description	The extremely popular second version of the Apache http server 
+long_description	Apache is an HTTP server designed as a plug-in replacement for \
+			the NCSA server version 1.3 (or 1.4). It fixes numerous bugs in \
+			the NCSA server and includes many frequently requested new \
+			features, and has an API which allows it to be extended to meet \
+			users' needs more easily. This is version 2.0.47 of Apache.
+
+master_sites	http://www.tux.org/pub/net/apache/dist/httpd/ \
+		http://apache.mirror.digitalspace.net/httpd/ \
+		http://www.apache.inetcosmos.org/dist/httpd/ \
+		http://www.rge.com/pub/infosystems/apache/httpd/ \
+		http://www.tux.org/pub/net/apache/dist/httpd/ \
+		http://apache.mirror.digitalspace.net/httpd/ \
+		http://www.rge.com/pub/infosystems/apache/httpd/ \
+		http://ftp.epix.net/apache/httpd/
+
+distname	httpd-${version}
+checksums	md5 63f16638c18b140b649fab32b54d7f9c 
+depends_lib	lib:libapr-0.0:apr lib:libaprutil-0.0:apr-util
+depends_run     path:/Library/StartupItems/DarwinPortsStartup:DarwinPortsStartup
+patchfiles	patch-httpd-std.conf.in
+configure.env	CC=/usr/bin/gcc CPP=/usr/bin/cpp
+
+pre-configure {
+	patchfiles			patch-config.layout	
+	patch.pre_args 		-p1
+	 reinplace "s|__PREFIX|${prefix}|g" ${workpath}/${name}_${version}/config.layout
+}
 
-variant activate_server {
-                depends_run     path:/Library/StartupItems/DarwinPortsStartup:DarwinPortsStartup
-                post-patch {    system "sed -e \"s=%%PREFIX%%=${prefix}/${name}=g\" \
-                                        ${filespath}/${name}.sh > \
-                                        ${worksrcdir}/${name}.sh" }
-
-                post-destroot-append {  file mkdir ${destroot}${prefix}/etc/rc.d/
-                                        system "install -bC ${portpath}/${workdir}/${name}.sh \
-                                                ${destroot}${prefix}/etc/rc.d/"} }
+configure.args	--with-layout=FreeBSD --with-apr=${prefix}/bin/apr-config \
+		--with-apr-util=${prefix}/bin \
+		--enable-mods-shared=all --enable-ssl --with-ssl \
+		--enable-deflate --enable-proxy --enable-proxy-connect \
+		--enable-proxy-http --enable-proxy-ftp \
+		--libdir=${prefix}/lib/apache2 \
+		--includedir=${prefix}/include/apache2
+
+
+	post-patch { 	system "sed -e \"s=%%PREFIX%%=${prefix}/${name}=g\" \
+                      			${filespath}/${name}.sh > \
+                      			${worksrcdir}/${name}.sh" }
+
+destroot.args	root=${destroot}
+post-destroot { 	
+					file mkdir  ${destroot}${prefix}/${name}/logs
+      				file mkdir  ${destroot}${prefix}/${name}/run
+      				
+      				system "touch ${destroot}${prefix}/${name}/log/.turd"
+      				system "touch ${destroot}${prefix}/${name}/run/.turd"
+		system "test -L ${destroot}${prefix}/${name}/build/libtool \
+                        || ln -s /usr/bin/glibtool \
+                        ${destroot}${prefix}/${name}/build/libtool"
+         file mkdir ${destroot}${prefix}/etc/rc.d/
+                    			system "install -bC ${portpath}/${workdir}/${name}.sh \
+                      				${destroot}${prefix}/etc/rc.d/"  
+         
+         
+          #copy update-apachemodules.pl
+    file mkdir ${destroot}${prefix}/etc/apache/modules.d
+    file mkdir ${destroot}${prefix}/etc/apache/extras-conf
+    file mkdir ${destroot}${prefix}/bin
+    system "install -o root -m 755 -c ${portpath}/files/update-apachemodules.pl ${destroot}${prefix}/bin/"
+    reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/bin/update-apachemodules.pl
+	reinplace "s|__NAME|${name}|g" ${destroot}${prefix}/bin/update-apachemodules.pl
+         
+         
+         
+                       }
