--- Portfile-orig	Mon Aug 11 01:29:35 2003
+++ Portfile	Wed Aug 13 11:11:00 2003
@@ -21,75 +21,43 @@
 
 distname            ${name}_${version}
 checksums           ${distname}${extract.sufx} md5 2cdece7b4881d541e072de6a2b65db77
-configure.pre_args  --prefix=${prefix}/${name}-${version}
+
+depends_run path:/Library/StartupItems/DarwinPortsStartup:DarwinPortsStartup
+
+configure.pre_args  --prefix=${prefix}
 configure.args      --with-layout=FreeBSD --server-uid=www \
                       --server-gid=www  --enable-module=most \
-                      --enable-shared=max --disable-rule=expat \
-                      --logfiledir=${prefix}/${name}-${version}/var/log/httpd \
-                      --runtimedir=${prefix}/${name}-${version}/var/run
+                      --enable-shared=max --disable-rule=EXPAT \
+                      --logfiledir=${prefix}/var/log/httpd \
+                      --runtimedir=${prefix}/var/run \
+                      --libexecdir=${prefix}/libexec/apache
 
 
 destroot.args		root=${destroot}
 
-variant activate_server {
-        depends_run path:/Library/StartupItems/DarwinPortsStartup:DarwinPortsStartup
-	post-patch        { system "sed -e \"s=%%PREFIX%%=${prefix}/${name}-${version}=g\" \
- 	                    ${filespath}/apache.sh >${workpath}/apache.sh"
-               }
-}                 
-
-variant mod_perl {
-				
-        master_sites-append        http://mirror.telentente.com/pub/apache/dist/perl:perl/ \
-                                   http://apache.mirror.digitalspace.net/perl/:perl \
-                                   http://www.apache.inetcosmos.org/dist/perl/:perl \
-                                   http://www.rge.com/pub/infosystems/apache/perl/:perl \
-                                   http://mirrors.ccs.neu.edu/Apache/dist/perl/:perl 
-	
-        distname            ${name}_${version}
-        distfiles-append    mod_perl-1.27${extract.sufx}:perl
-        extract.only        ${distname}${extract.sufx} mod_perl-1.27${extract.sufx}
-	
-        checksums-append    mod_perl-1.27${extract.sufx} md5 bd07f4f1065eb0d0a8d8004219357d8c
-	
-        depends_lib         bin:perl5\.8\..:perl5.8
-        worksrcdir          mod_perl-1.27
-	
-	configure.pre_args 
-        #APACI_ARGS all on one line because otherwise apache gets upset if the shell is csh/tcsh
-        configure         { system "cd ${workpath}/${worksrcdir} && \
-						 perl Makefile.PL USE_APACI=1 EVERYTHING=1 \
-						 DO_HTTPD=1 APACHE_PREFIX=${prefix} \
-						 APACHE_SRC=../${distname}/src \
-						 APACI_ARGS='--prefix=${prefix}/${name}-${version} --logfiledir=${prefix}/${name}-${version}/var/log/httpd --runtimedir=${prefix}/${name}-${version}/var/run --with-layout=FreeBSD --server-uid=www --server-gid=www --enable-module=most --enable-shared=max --disable-shared=perl --disable-rule=expat'" }
-	
-        destroot.args	PREFIX=${destroot}${prefix} INSTALLPRIVLIB=${destroot}${prefix}/lib/perl5/5.8.0 \
-                         INSTALLSITELIB=${destroot}${prefix}/lib/perl5/site_perl/5.8.0 \
-                         INSTALLARCHLIB=${destroot}${prefix}/lib/perl5/5.8.0/darwin \
-                         INSTALLSITEARCH=${destroot}${prefix}/lib/perl5/site_perl/5.8.0/darwin \
-root=${destroot}
-
-}
 
 post-destroot      {
 
-        file mkdir  ${prefix}/${name}-${version}/var/log/httpd
-        file mkdir  ${prefix}/${name}-${version}/var/run
-
-        system "touch ${destroot}${prefix}/${name}-${version}/var/run/.turd \
-                ${destroot}${prefix}/${name}-${version}/var/log/httpd/.turd"                                           
+	file mkdir  ${destroot}${prefix}/var/log/
+    file mkdir  ${destroot}${prefix}/var/log/httpd
+    file mkdir  ${destroot}${prefix}/var/run
+
+    system "touch ${destroot}${prefix}/var/run/.turd \
+          ${destroot}${prefix}/var/log/httpd/.turd"                                           
+
+    #copy rc file    
+    file mkdir  ${destroot}${prefix}/etc/rc.d/
+    system "install -bC -o root ${portpath}/files/apache.sh ${destroot}${prefix}/etc/rc.d/"
+    reinplace "s|%%PREFIX%%|${prefix}|g" ${destroot}${prefix}/etc/rc.d/apache.sh
+    
+    #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
 
-        if { [variant_isset activate_server]} {
-                file mkdir  ${destroot}${prefix}/etc/rc.d/
-                system "install -bC -o root ${workpath}/apache.sh \
-                                             ${destroot}${prefix}/etc/rc.d/"
-        }
-
-	if { [variant_isset mod_perl]} {
-		cd ${destroot}${prefix}/lib/perl5/site_perl/5.8.0/darwin/auto/mod_perl/
-                system "cat .packlist | sed s#${destroot}/##g >.packlist.new"
-                system "mv .packlist.new .packlist"
-	}
 }   
 
 
