Ticket #26039: fpm-ryandesign_updated_5.3.8.diff

File fpm-ryandesign_updated_5.3.8.diff, 5.5 KB (added by kipelovets@…, 13 years ago)

fpm-ryandesign updated to 5.3.8 port version

  • /opt/local/var/macports/sources/rsync.macports.org/release/ports/lang/php5/Portfile

    old new  
    8989                        --with-libxml-dir=${prefix} \
    9090                        --with-zlib=${prefix} \
    9191                        --without-pear \
    92                         --disable-cgi
     92                        --disable-cgi \
     93                        --disable-fpm
    9394
    9495# php5-mysql +mysqlnd needs mysqlnd support compiled into php
    9596configure.env-append    PHP_MYSQLND_ENABLED=yes
     
    100101    configure.env-append LIBS=-lresolv
    101102}
    102103
    103 variant no_web conflicts apache apache2 fastcgi description {Don't include any web server support} {}
     104variant no_web conflicts apache apache2 fastcgi fpm description {Don't include any web server support} {}
    104105
    105106# Build an Apache 1 module. On Mac OS X, it uses Apple's provided Apache 1 server.
    106107# On other platforms, the MacPorts apache port is used. Keep the options here
     
    147148    }
    148149}
    149150
     151# Build the FPM binary. Keep the options here in sync with those in the
     152# relevant part of the post-destroot phase.
     153variant fpm conflicts no_web description {Add FPM (Fast Process Management) web server binary} {
     154    depends_lib-append      port:libevent
     155   
     156    set fpm_pidfile         ${prefix}/var/run/php-fpm.pid
     157   
     158    patchfiles-append       patch-fpm-conf.diff
     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
     173
    150174variant ipc description {Add semaphore, shared memory and IPC functions} {
    151175    configure.args-append \
    152176        --enable-shmop \
     
    155179        --enable-sysvmsg
    156180}
    157181
    158 if {![variant_isset apache] && ![variant_isset apache2] && ![variant_isset fastcgi] && ![variant_isset no_web]} {
     182if {![variant_isset apache] && ![variant_isset apache2] && ![variant_isset fastcgi] && ![variant_isset fpm] && ![variant_isset no_web]} {
    159183    default_variants +apache2
    160184}
    161185
     
    264288        # conflict with the cli version.
    265289        xinstall -m 755 ${worksrcpath}/sapi/cgi/php-cgi ${destroot}${prefix}/bin
    266290    }
     291
     292    if { [variant_isset fpm] } {
     293        # If we've built an Apache module (any version) then the FPM binary
     294        # will not have been built, so we need to run through the whole process
     295        # again and build just the FPM binary. Keep the options here in sync
     296        # with the options specified in the apache and apache2 variants.
     297        # This shouldn't be necessary, but is done for http://bugs.php.net/bug.php?id=52419
     298        if { [variant_isset apache] } {
     299            if { ![variant_isset macosx] && (![info exists os.subplatform] || ${os.subplatform} != "macosx") } {
     300                configure.args-delete \
     301                    --with-apxs=${prefix}/sbin/apxs
     302            } else {
     303                configure.args-delete \
     304                    --with-apxs=/usr/sbin/apxs
     305            }
     306        }
     307        if { [variant_isset apache2] } {
     308            configure.args-delete \
     309                --with-apxs2=${prefix}/apache2/bin/apxs
     310        }
     311       
     312        # Run the build again to get the FPM binary. Keep the options here
     313        # in sync with those in the fpm variant.
     314        if { [variant_isset apache] || [variant_isset apache2] } {
     315            configure.args-delete \
     316                --disable-fpm
     317            configure.args-append \
     318                --enable-fpm
     319            ui_msg "$UI_PREFIX Configuring ${name} again for FPM"
     320            command_exec configure
     321            ui_msg "$UI_PREFIX Building ${name} again for FPM"
     322            command_exec build
     323            ui_msg "$UI_PREFIX Staging ${name} FPM into destroot"
     324        }
     325       
     326        # Copy the FPM binary to the sbin dir.
     327        xinstall -m 755 ${worksrcpath}/sapi/fpm/php-fpm ${destroot}${prefix}/sbin
     328    }
    267329   
    268330    #file rename ${destroot}${prefix}/etc/pear.conf ${destroot}${prefix}/etc/pear.conf.sample
    269331   
     
    273335        php.ini-development \
    274336        php.ini-production \
    275337        ${destroot}${phpinidir}
     338
     339    # Copy FPM configuration file.
     340    if {[variant_isset fpm]} {
     341        xinstall -m 644 ${worksrcpath}/sapi/fpm/php-fpm.conf ${destroot}${phpinidir}/php-fpm.conf.default
     342    }
    276343   
    277344    # Copy mysqlnd headers.
    278345    xinstall -d ${destroot}${prefix}/include/php/ext/mysqlnd
     
    303370        ui_msg "${phpinidir}/php.ini-development (if this is a development server) or"
    304371        ui_msg "${phpinidir}/php.ini-production (if this is a production server)."
    305372    }
     373
     374    if {[variant_isset fpm]} {
     375        ui_msg ""
     376        if {![file exists ${phpinidir}/php-fpm.conf]} {
     377            ui_msg "To set up PHP FPM, copy"
     378            ui_msg "${phpinidir}/php-fpm.conf.default to"
     379            ui_msg "${phpinidir}/php-fpm.conf and then make changes."
     380        } else {
     381            ui_msg "You may need to update your php-fpm.conf for any changes that have been made"
     382            ui_msg "in this version of php. Compare ${phpinidir}/php-fpm.conf.default with"
     383            ui_msg "${phpinidir}/php-fpm.conf."
     384        }
     385    }
    306386   
    307387    if {![variant_isset no_web]} {
    308388        ui_msg ""