diff --git a/lang/php5/Portfile b/lang/php5/Portfile
index 3cdae33..8083dcf 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/${my_name}-fpm.pid |
| 158 | set fpm_conf_installed 0 |
| 159 | |
| 160 | startupitem.create yes |
| 161 | startupitem.name php-fpm |
| 162 | startupitem.executable ${prefix}/sbin/php-fpm --fpm-config ${phpinidir}/php-fpm.conf |
| 163 | startupitem.pidfile auto ${fpm_pidfile} |
| 164 | |
| 165 | if { ![variant_isset apache] && ![variant_isset apache2] } { |
| 166 | configure.args-delete \ |
| 167 | --disable-fpm |
| 168 | configure.args-append \ |
| 169 | --enable-fpm |
| 170 | } |
| 171 | } |
| 172 | |
153 | 173 | foreach {old_variant new_port} { |
154 | 174 | gmp gmp |
155 | 175 | imap imap |
… |
… |
variant ipc description {Add semaphore, shared memory and IPC functions} { |
185 | 205 | --enable-sysvmsg |
186 | 206 | } |
187 | 207 | |
188 | | if {![variant_isset apache] && ![variant_isset apache2] && ![variant_isset fastcgi] && ![variant_isset no_web]} { |
| 208 | if {![variant_isset apache] && ![variant_isset apache2] && ![variant_isset fastcgi] && ![variant_isset fpm] && ![variant_isset no_web]} { |
189 | 209 | default_variants +apache2 |
190 | 210 | } |
191 | 211 | |
… |
… |
post-destroot { |
288 | 308 | # conflict with the cli version. |
289 | 309 | xinstall -m 755 ${worksrcpath}/sapi/cgi/php-cgi ${destroot}${prefix}/bin |
290 | 310 | } |
| 311 | |
| 312 | if { [variant_isset fpm] } { |
| 313 | # if we were also building an apache module, we didn't compile FPM at that time |
| 314 | # so we do it here. This shouldn't be necessary, but is done for http://bugs.php.net/bug.php?id=52419 |
| 315 | if { [variant_isset apache] } { |
| 316 | if { ![variant_isset macosx] && (![info exists os.subplatform] || ${os.subplatform} != "macosx") } { |
| 317 | configure.args-delete \ |
| 318 | --with-apxs=${prefix}/sbin/apxs |
| 319 | } else { |
| 320 | configure.args-delete \ |
| 321 | --with-apxs=/usr/sbin/apxs |
| 322 | } |
| 323 | } |
| 324 | if { [variant_isset apache2] } { |
| 325 | configure.args-delete \ |
| 326 | --with-apxs2=${prefix}/apache2/bin/apxs |
| 327 | } |
| 328 | |
| 329 | if { [variant_isset apache] || [variant_isset apache2] } { |
| 330 | configure.args-delete \ |
| 331 | --disable-fpm |
| 332 | configure.args-append \ |
| 333 | --enable-fpm |
| 334 | |
| 335 | ui_msg "$UI_PREFIX Configuring ${name} again for FPM" |
| 336 | command_exec configure |
| 337 | ui_msg "$UI_PREFIX Building ${name} again for FPM" |
| 338 | command_exec build |
| 339 | ui_msg "$UI_PREFIX Staging ${name} FPM into destroot" |
| 340 | } |
| 341 | |
| 342 | # Copy the FPM binary to the bin dir |
| 343 | xinstall -m 755 ${worksrcpath}/sapi/fpm/php-fpm ${destroot}${prefix}/sbin |
| 344 | } |
291 | 345 | |
292 | 346 | #file rename ${destroot}${prefix}/etc/pear.conf ${destroot}${prefix}/etc/pear.conf.sample |
293 | 347 | |
… |
… |
post-destroot { |
297 | 351 | php.ini-development \ |
298 | 352 | php.ini-production \ |
299 | 353 | ${destroot}${phpinidir} |
| 354 | |
| 355 | if { [variant_isset fpm] } { |
| 356 | if {![file exists ${phpinidir}/php-fpm.conf]} { |
| 357 | # Only install php-fpm.conf if doesn't exist so we don't overwrite user's file by mistake |
| 358 | xinstall -m 644 ${worksrcpath}/sapi/fpm/php-fpm.conf ${destroot}${phpinidir} |
| 359 | } |
| 360 | } |
300 | 361 | |
301 | 362 | # Copy mysqlnd headers. |
302 | 363 | xinstall -d ${destroot}${prefix}/include/php/ext/mysqlnd |
… |
… |
post-activate { |
328 | 389 | ui_msg "${phpinidir}/php.ini-production (if this is a production server)." |
329 | 390 | } |
330 | 391 | |
| 392 | if { [variant_isset fpm] } { |
| 393 | ui_msg "" |
| 394 | ui_msg "FPM configuration file installed to ${phpinidir}/php-fpm.conf." |
| 395 | ui_msg "You will need to configure the pm.min_spare_servers and pm.max_spare_servers" |
| 396 | ui_msg "parameters before you can start php-fpm" |
| 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." |