--- Portfile.orig	2008-07-10 00:29:06.000000000 +0100
+++ Portfile	2008-07-10 00:29:56.000000000 +0100
@@ -1,9 +1,9 @@
-# $Id: Portfile 32369 2007-12-28 05:55:15Z boeyms@macports.org $
+# $Id$
 
 PortSystem 1.0
 
 name            nginx
-version         0.5.34
+version         0.6.32
 categories      www mail
 platforms       darwin
 maintainers     boeyms openmaintainer
@@ -19,17 +19,13 @@
                     consumption.
 homepage        http://nginx.net/
 master_sites    http://sysoev.ru/nginx
-checksums       md5     8f7d3efcd7caaf1f06e4d95dfaeac238 \
-                sha1    f76f6cb1ac0a316f20958bf7dc6a03723fb58edf \
-                rmd160  a057651eb9065b1e491ce38c73bc9e4897c982c7
+checksums       md5     c09a2ace3c91f45dabbb608b11e48ed1 \
+                sha1    346166171477c3e78759bdbbc8461107d8475269 \
+                rmd160  06749c5bf834a3f7e82ad3122a5db457c193d117
 
 depends_lib     port:pcre port:zlib
 
-patchfiles      patch-auto__install.diff patch-conf__nginx.conf.diff
-post-patch {
-    reinplace "s|__DESTROOT__|${destroot}|g" \
-        ${worksrcpath}/auto/install
-}
+patchfiles      patch-auto-install.diff patch-conf-nginx.conf.diff
 
 set pidfile     ${prefix}/var/run/${name}.pid
 
@@ -48,30 +44,19 @@
 build.target        build
 destroot.keepdirs   ${destroot}${prefix}/var/log/${name} \
                     ${destroot}${prefix}/var/run/${name}
+
 post-destroot {
-    set nginx_conf ${prefix}/etc/${name}/${name}.conf
-    move ${destroot}${nginx_conf} ${destroot}${nginx_conf}.example
-# Try to cover for the fact that, in earlier revisions of this port, the
-# configuration file was installed live instead of an example, in which case an
-# upgrade will clobber any customisations that a user might have made :(
-    catch "exec port provides ${nginx_conf}" provides_output
-    set nginx_conf_is_registered_to_nginx \
-        [regexp "${nginx_conf} is provided by: ${name}" ${provides_output}]
-    set nginx_conf_differs \
-        [catch {exec cmp ${nginx_conf} ${worksrcpath}/conf/${name}.conf}]
-    if { ${nginx_conf_is_registered_to_nginx} && ${nginx_conf_differs} } {
-        copy ${nginx_conf} ${nginx_conf}.altered
-        ui_msg ""
-        ui_msg "###############################################################"
-        ui_msg "# It appears that you have altered ${nginx_conf},"
-        ui_msg "# and that upgrading or uninstalling your previous installation"
-        ui_msg "# of ${name} will clobber your copy.  It has been copied to"
-        ui_msg "# ${nginx_conf}.altered for preservation when you upgrade or"
-        ui_msg "# uninstall ${name}.  This problem should not occur with future"
-        ui_msg "# upgrades or installations of this port.\n"
-        ui_msg "###############################################################"
-        ui_msg ""
-    }
+    ui_msg ""
+    ui_msg "###############################################################"
+    ui_msg "# If it doesn't already exist, you'll need to create a config"
+    ui_msg "# file at the location, ${prefix}/etc/${name}/${name}.conf"
+    ui_msg "# This is the default file nginx will look for without using"
+    ui_msg "# the -c flag"
+    ui_msg "#"
+    ui_msg "# New example files are also provided at ${prefix}/etc/${name}"
+    ui_msg "# they are those ending in .example, you are advised to look."
+    ui_msg "###############################################################"
+    ui_msg ""
 }
 
 startupitem.create      yes
@@ -106,7 +91,31 @@
 # This variant has been labelled "perl5" so as to allow users to easily stick
 # with perl 5.x once perl 6.x is released; a "perl6" variant will also be added
 # at that time.
-variant perl5 description {Add perl support to the server} {
+variant perl5 description {Add perl support to the server, directly within\
+        nginx and call perl via SSI} {
     depends_run-append	    port:perl5.8
     configure.args-append   --with-http_perl_module
 }
+
+variant realip description {Using nginx as a backend} {
+    configure.args-append   --with-http_realip_module
+}
+
+variant addition description {Append text to pages} {
+    configure.args-append   --with-http_addition_module
+}
+
+variant substitution description {Replace text in pages} {
+    configure.args-append   --with-http_sub_module
+}
+
+variant gzip_static description {Avoids compressing the same file each\
+        time it is requested} {
+    configure.args-append   --with-http_gzip_static_module
+}
+
+variant google_perftools description {Enable Google Performance Tools\
+        profiling for workers} {
+    depends_lib-append      port:google-perftools
+    configure.args-append   --with-google_perftools_module
+}
