[89882] users/ryandesign/ports/lang/php54

ryandesign at macports.org ryandesign at macports.org
Mon Feb 13 18:34:14 PST 2012


Revision: 89882
          http://trac.macports.org/changeset/89882
Author:   ryandesign at macports.org
Date:     2012-02-13 18:34:13 -0800 (Mon, 13 Feb 2012)
Log Message:
-----------
php54-fpm: add startup item, patch conf file with default values that make sense; see #26039

Modified Paths:
--------------
    users/ryandesign/ports/lang/php54/Portfile

Added Paths:
-----------
    users/ryandesign/ports/lang/php54/files/patch-sapi-fpm-php-fpm.conf.in.diff

Modified: users/ryandesign/ports/lang/php54/Portfile
===================================================================
--- users/ryandesign/ports/lang/php54/Portfile	2012-02-14 02:13:33 UTC (rev 89881)
+++ users/ryandesign/ports/lang/php54/Portfile	2012-02-14 02:34:13 UTC (rev 89882)
@@ -8,6 +8,7 @@
 # Increment revision of ${php}-eaccelerator when updating version of ${php}.
 version                 5.4.0RC7
 set major               [lindex [split ${version} .] 0]
+set suffix              [join [lrange [split ${version} .] 0 1] {}]
 categories              lang php www
 maintainers             ryandesign jwa
 platforms               darwin freebsd
@@ -63,7 +64,7 @@
     
     configure.args      --mandir=${prefix}/share/man \
                         --infodir=${prefix}/share/info \
-                        --program-suffix=[join [lrange [split ${version} .] 0 1] {}] \
+                        --program-suffix=${suffix} \
                         --includedir=${prefix}/include/${php} \
                         --libdir=${prefix}/lib/${php} \
                         --with-config-file-path=${phpinidir} \
@@ -136,7 +137,7 @@
     }
     
     if {${subport} != ${php}} {
-        notes-append "If this is your first install, you need to activate ${php} in your web server."
+        notes-append "If this is your first install, you need to enable ${subport} in your web server."
     }
 }
 
@@ -241,14 +242,54 @@
 }
 
 subport ${php}-fpm {
+    revision                1
+    
     description             ${php} FPM SAPI
     
     long_description        ${description}
     
+    set fpmuser             nobody
+    set fpmgroup            nobody
+    
+    patchfiles-append       patch-sapi-fpm-php-fpm.conf.in.diff
+    
+    post-patch {
+        reinplace "s|@PHP@|${php}|g" ${worksrcpath}/sapi/fpm/php-fpm.conf.in
+    }
+    
     configure.args-delete   --disable-fpm
-    configure.args-append   --enable-fpm
+    configure.args-append   --enable-fpm \
+                            --sysconfdir=${phpinidir} \
+                            --with-fpm-user=${fpmuser} \
+                            --with-fpm-group=${fpmgroup}
     
     build.target            fpm
     
     destroot.target         install-fpm
+    
+    destroot.keepdirs       ${destroot}${prefix}/var/log/${php} \
+                            ${destroot}${prefix}/var/run/${php}
+    
+    post-destroot {
+        xinstall -d -o ${fpmuser} -g ${fpmgroup} ${destroot}${prefix}/var/log/${php} ${destroot}${prefix}/var/run/${php}
+    }
+    
+    startupitem.create      yes
+    startupitem.executable  ${prefix}/sbin/php-fpm${suffix}
+    
+    if {![file exists ${phpinidir}/php-fpm.conf]} {
+        notes-append "
+
+To use ${subport}, copy\
+${phpinidir}/php-fpm.conf.default to\
+${phpinidir}/php-fpm.conf and make changes if desired.
+"
+    } else {
+        notes-append "
+
+You may need to update your php-fpm.conf for any changes that have been made\
+in this version of ${subport}. Compare ${phpinidir}/php-fpm.conf with\
+${phpinidir}/php-fpm.conf.default.
+"
+    }
 }

Added: users/ryandesign/ports/lang/php54/files/patch-sapi-fpm-php-fpm.conf.in.diff
===================================================================
--- users/ryandesign/ports/lang/php54/files/patch-sapi-fpm-php-fpm.conf.in.diff	                        (rev 0)
+++ users/ryandesign/ports/lang/php54/files/patch-sapi-fpm-php-fpm.conf.in.diff	2012-02-14 02:34:13 UTC (rev 89882)
@@ -0,0 +1,41 @@
+--- a/sapi/fpm/php-fpm.conf.in.orig	2011-10-08 16:04:10.000000000 -0500
++++ b/sapi/fpm/php-fpm.conf.in	2012-02-13 18:51:53.000000000 -0600
+@@ -22,14 +22,14 @@
+ ; Pid file
+ ; Note: the default prefix is @EXPANDED_LOCALSTATEDIR@
+ ; Default Value: none
+-;pid = run/php-fpm.pid
++;pid = run/@PHP@/php-fpm.pid
+ 
+ ; Error log file
+ ; If it's set to "syslog", log is sent to syslogd instead of being written
+ ; in a local file.
+ ; Note: the default prefix is @EXPANDED_LOCALSTATEDIR@
+ ; Default Value: log/php-fpm.log
+-;error_log = log/php-fpm.log
++error_log = log/@PHP@/php-fpm.log
+ 
+ ; syslog_facility is used to specify what type of program is logging the
+ ; message. This lets syslogd specify that messages from different facilities
+@@ -42,7 +42,7 @@
+ ; instances running on the same server, you can change the default value
+ ; which must suit common needs.
+ ; Default Value: php-fpm
+-;syslog.ident = php-fpm
++syslog.ident = @PHP at -fpm
+ 
+ ; Log level
+ ; Possible Values: alert, error, warning, notice, debug
+@@ -76,9 +76,10 @@
+ ; Default Value: 0
+ ; process.max = 128
+ 
+-; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
++; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging
++; or for use with launchd.
+ ; Default Value: yes
+-;daemonize = yes
++daemonize = no
+  
+ ; Set open file descriptor rlimit for the master process.
+ ; Default Value: system defined value
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120213/b41a5a36/attachment-0001.html>


More information about the macports-changes mailing list