[43973] trunk/dports/www/apache2/Portfile

jmr at macports.org jmr at macports.org
Thu Dec 18 10:36:32 PST 2008


Revision: 43973
          http://trac.macports.org/changeset/43973
Author:   jmr at macports.org
Date:     2008-12-18 10:36:32 -0800 (Thu, 18 Dec 2008)
Log Message:
-----------
apache2: don't clobber extra conf files on upgrade (#8605, maintainer timeout)

Modified Paths:
--------------
    trunk/dports/www/apache2/Portfile

Modified: trunk/dports/www/apache2/Portfile
===================================================================
--- trunk/dports/www/apache2/Portfile	2008-12-18 17:07:54 UTC (rev 43972)
+++ trunk/dports/www/apache2/Portfile	2008-12-18 18:36:32 UTC (rev 43973)
@@ -4,6 +4,7 @@
 
 name             apache2
 version          2.2.10
+revision         1
 categories       www
 maintainers      imajes at macports.org
 description      The extremely popular second version of the Apache http server 
@@ -90,9 +91,10 @@
 
 post-destroot {
 	set confDir ${destroot}${prefix}/apache2/conf
-    move -force ${confDir}/httpd.conf ${confDir}/httpd.conf.sample
+    eval delete ${confDir}/httpd.conf [glob -directory ${confDir}/extra *.conf]
 
-	destroot.keepdirs ${destroot}${prefix}/apache2/logs
+	destroot.keepdirs ${destroot}${prefix}/apache2/logs \
+	                  ${confDir}/extra
 
 	# fix libtool path
     reinplace "s|/apache2/build/libtool|/share/apr-1/build/libtool|g" \
@@ -104,6 +106,21 @@
         README.platforms ROADMAP VERSIONING ${destroot}${docdir}
 }
 
+post-activate {
+    set confDir ${prefix}/apache2/conf
+    # Make sure initial conf files are present and set up correctly
+    if {![file exists ${confDir}/httpd.conf]} {
+        file copy ${confDir}/original/httpd.conf \
+             ${confDir}/httpd.conf
+    }
+    foreach f [glob -tails -directory ${confDir}/original/extra *.conf] {
+        if {![file exists ${confDir}/extra/${f}]} {
+            file copy ${confDir}/original/extra/${f} \
+                 ${confDir}/extra/${f}
+        }
+    }
+}
+
 variant openbsd {
 	build.env-append "LD_LIBRARY_PATH=${prefix}/lib"
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20081218/f70a4fa0/attachment-0001.html>


More information about the macports-changes mailing list