[27123] trunk/dports/www/nginx/Portfile

source_changes at macosforge.org source_changes at macosforge.org
Thu Jul 19 22:26:05 PDT 2007


Revision: 27123
          http://trac.macosforge.org/projects/macports/changeset/27123
Author:   boeyms at macports.org
Date:     2007-07-19 22:26:04 -0700 (Thu, 19 Jul 2007)

Log Message:
-----------
Revisions to www/nginx:
 * Install an example configuration file rather than a "live" one, and deal with
   the possibility that users of previous revisions might have changed the live
   configuration file, which will be clobbered on upgrade or uninstallation;
 * Add openmaintainer to list of maintainers;
 * Fix destroot.keepdirs to actually keep directories in destroot; and
 * Add descriptions to variants.

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

Modified: trunk/dports/www/nginx/Portfile
===================================================================
--- trunk/dports/www/nginx/Portfile	2007-07-20 02:21:20 UTC (rev 27122)
+++ trunk/dports/www/nginx/Portfile	2007-07-20 05:26:04 UTC (rev 27123)
@@ -4,9 +4,10 @@
 
 name            nginx
 version         0.5.20
+revision        1
 categories      www mail
 platforms       darwin
-maintainers     boeyms at macports.org
+maintainers     boeyms at macports.org openmaintainer at macports.org
 description     High-performance HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server
 long_description    Nginx ("engine x") is a high-performance HTTP(S) server \
                     and reverse proxy, as well as an IMAP/POP3 proxy server. \
@@ -44,25 +45,52 @@
             --http-fastcgi-temp-path=${prefix}/var/run/${name}/fastcgi_temp
 
 build.target        build
-destroot.keepdirs   ${prefix}/var/log/${name} ${prefix}/var/run/${name} 
+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 ""
+    }
+}
 
 startupitem.create      yes
 startupitem.executable  ${prefix}/sbin/nginx
 startupitem.pidfile     auto ${pidfile}
 
-variant dav {
+variant dav description {Add WebDAV support to server} {
     configure.args-append   --with-http_dav_module
 }
 
-variant flv {
+variant flv description {Add FLV (Flash Video) streaming support to server} {
     configure.args-append   --with-http_flv_module
 }
 
-variant mail {
+variant mail description {Add IMAP4/POP3 mail proxy support} {
     configure.args-append   --with-mail
 }
 
-variant ssl {
+variant ssl description {Add SSL (HTTPS) support to the server, and\
+        also to the mail proxy if that is enabled} {
     depends_lib-append      port:openssl
     configure.args-append   --with-http_ssl_module
     if [variant_isset mail] {

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070719/1bec4bd0/attachment.html


More information about the macports-changes mailing list