diff --git a/lang/php5/Portfile b/lang/php5/Portfile
index 3cdae33..50e6733 100644
a
|
b
|
platform darwin 10 { |
103 | 103 | LIBS=-lresolv |
104 | 104 | } |
105 | 105 | |
106 | | variant no_web conflicts apache apache2 fastcgi description {Don't include any web server support} {} |
| 106 | variant no_web conflicts apache apache2 fastcgi fpm description {Don't include any web server support} {} |
107 | 107 | |
108 | 108 | # Build an Apache 1 module. On Mac OS X, it uses Apple's provided Apache 1 server. |
109 | 109 | # On other platforms, the MacPorts apache port is used. Keep the options here |
… |
… |
variant fastcgi conflicts no_web description {Add FastCGI web server binary} { |
150 | 150 | } |
151 | 151 | } |
152 | 152 | |
| 153 | # FPM options |
| 154 | variant fpm conflicts no_web description {Add FPM (Fast Process Management) web server binary} { |
| 155 | depends_lib-append port:libevent |
| 156 | |
| 157 | set fpm_pidfile ${prefix}/var/run/php-fpm.pid |
| 158 | set fpm_conf_installed 0 |
| 159 | |
| 160 | patchfiles-append patch-fpm-conf.diff |
| 161 | |
| 162 | startupitem.create yes |
| 163 | startupitem.name php-fpm |
| 164 | startupitem.executable ${prefix}/sbin/php-fpm --fpm-config ${phpinidir}/php-fpm.conf |
| 165 | startupitem.pidfile auto ${fpm_pidfile} |
| 166 | |
| 167 | if { ![variant_isset apache] && ![variant_isset apache2] } { |
| 168 | configure.args-delete \ |
| 169 | --disable-fpm |
| 170 | configure.args-append \ |
| 171 | --enable-fpm |
| 172 | } |
| 173 | } |
| 174 | |
153 | 175 | foreach {old_variant new_port} { |
154 | 176 | gmp gmp |
155 | 177 | imap imap |
… |
… |
variant ipc description {Add semaphore, shared memory and IPC functions} { |
185 | 207 | --enable-sysvmsg |
186 | 208 | } |
187 | 209 | |
188 | | if {![variant_isset apache] && ![variant_isset apache2] && ![variant_isset fastcgi] && ![variant_isset no_web]} { |
| 210 | if {![variant_isset apache] && ![variant_isset apache2] && ![variant_isset fastcgi] && ![variant_isset fpm] && ![variant_isset no_web]} { |
189 | 211 | default_variants +apache2 |
190 | 212 | } |
191 | 213 | |
… |
… |
post-destroot { |
288 | 310 | # conflict with the cli version. |
289 | 311 | xinstall -m 755 ${worksrcpath}/sapi/cgi/php-cgi ${destroot}${prefix}/bin |
290 | 312 | } |
| 313 | |
| 314 | if { [variant_isset fpm] } { |
| 315 | # if we were also building an apache module, we didn't compile FPM at that time |
| 316 | # so we do it here. This shouldn't be necessary, but is done for http://bugs.php.net/bug.php?id=52419 |
| 317 | if { [variant_isset apache] } { |
| 318 | if { ![variant_isset macosx] && (![info exists os.subplatform] || ${os.subplatform} != "macosx") } { |
| 319 | configure.args-delete \ |
| 320 | --with-apxs=${prefix}/sbin/apxs |
| 321 | } else { |
| 322 | configure.args-delete \ |
| 323 | --with-apxs=/usr/sbin/apxs |
| 324 | } |
| 325 | } |
| 326 | if { [variant_isset apache2] } { |
| 327 | configure.args-delete \ |
| 328 | --with-apxs2=${prefix}/apache2/bin/apxs |
| 329 | } |
| 330 | |
| 331 | if { [variant_isset apache] || [variant_isset apache2] } { |
| 332 | configure.args-delete \ |
| 333 | --disable-fpm |
| 334 | configure.args-append \ |
| 335 | --enable-fpm |
| 336 | |
| 337 | ui_msg "$UI_PREFIX Configuring ${name} again for FPM" |
| 338 | command_exec configure |
| 339 | ui_msg "$UI_PREFIX Building ${name} again for FPM" |
| 340 | command_exec build |
| 341 | ui_msg "$UI_PREFIX Staging ${name} FPM into destroot" |
| 342 | } |
| 343 | |
| 344 | # Copy the FPM binary to the bin dir |
| 345 | xinstall -m 755 ${worksrcpath}/sapi/fpm/php-fpm ${destroot}${prefix}/sbin |
| 346 | } |
291 | 347 | |
292 | 348 | #file rename ${destroot}${prefix}/etc/pear.conf ${destroot}${prefix}/etc/pear.conf.sample |
293 | 349 | |
… |
… |
post-destroot { |
297 | 353 | php.ini-development \ |
298 | 354 | php.ini-production \ |
299 | 355 | ${destroot}${phpinidir} |
| 356 | |
| 357 | if { [variant_isset fpm] } { |
| 358 | if {![file exists ${phpinidir}/php-fpm.conf]} { |
| 359 | # Only install php-fpm.conf if doesn't exist so we don't overwrite user's file by mistake |
| 360 | xinstall -m 644 ${worksrcpath}/sapi/fpm/php-fpm.conf ${destroot}${phpinidir} |
| 361 | } |
| 362 | } |
300 | 363 | |
301 | 364 | # Copy mysqlnd headers. |
302 | 365 | xinstall -d ${destroot}${prefix}/include/php/ext/mysqlnd |
… |
… |
post-activate { |
328 | 391 | ui_msg "${phpinidir}/php.ini-production (if this is a production server)." |
329 | 392 | } |
330 | 393 | |
| 394 | if { [variant_isset fpm] } { |
| 395 | ui_msg "" |
| 396 | ui_msg "FPM configuration file installed to ${phpinidir}/php-fpm.conf." |
| 397 | } |
| 398 | |
331 | 399 | if {![variant_isset no_web]} { |
332 | 400 | ui_msg "" |
333 | 401 | ui_msg "If this is your first install, you need to activate PHP in your web server." |