Changeset 50545


Ignore:
Timestamp:
May 3, 2009, 6:13:28 AM (10 years ago)
Author:
ryandesign@…
Message:

php4: back-port fastcgi variant from php5 port

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/lang/php4/Portfile

    r50173 r50545  
    127127}
    128128
    129 variant no_web conflicts apache apache2 apache20 description {Don't include any web server support} {}
     129variant no_web conflicts apache apache2 apache20 fastcgi description {Don't include any web server support} {}
    130130
    131131variant apache conflicts apache2 apache20 no_web description {Add Apache 1 web server module} {
     
    163163}
    164164
     165variant fastcgi conflicts no_web description {Add FastCGI web server binary} {
     166    if { ![variant_isset apache] && ![variant_isset apache2] && ![variant_isset apache20] } {
     167        configure.args-append \
     168            --enable-fastcgi \
     169            --enable-force-cgi-redirect
     170    }
     171}
     172
    165173variant mysql3 conflicts mysql4 mysql5 description {MySQL 3 functions} {
    166174    depends_lib-append \
     
    254262}
    255263
    256 if {![variant_isset apache] && ![variant_isset apache2] && ![variant_isset apache20] && ![variant_isset no_web]} {
     264if {![variant_isset apache] && ![variant_isset apache2] && ![variant_isset apache20] && ![variant_isset fastcgi] && ![variant_isset no_web]} {
    257265    default_variants +apache2
    258266}
     
    299307        xinstall -m 755 ${worksrcpath}/libs/libphp4.so ${destroot}${prefix}/apache20/modules/
    300308        xinstall -m 755 -c ${filespath}/mod_php.conf ${destroot}${prefix}/apache20/conf/extras-conf/mod_php.conf.sample
     309    }
     310   
     311    if { [variant_isset fastcgi] } {
     312        # If we've built an Apache module (any version) then the FastCGI binary
     313        # will not have been built, so we need to run through the whole process
     314        # again and build just the FastCGI binary. Keep the options here in sync
     315        # with the options specified in the apache, apache2 and apache20 variants.
     316        if { [variant_isset apache] } {
     317            if { ![variant_isset macosx] } {
     318                configure.args-delete \
     319                    --with-apxs=${prefix}/sbin/apxs
     320            } else {
     321                configure.args-delete \
     322                    --with-apxs=/usr/sbin/apxs
     323            }
     324        }
     325        if { [variant_isset apache2] } {
     326            configure.args-delete \
     327                --with-apxs2=${prefix}/apache2/bin/apxs
     328        }
     329        if { [variant_isset apache20] } {
     330            configure.args-delete \
     331                --with-apxs2=${prefix}/apache20/bin/apxs
     332        }
     333       
     334        # Run the build again to get the FastCGI binary. Keep the options here
     335        # in sync with those in the fastcgi variant.
     336        if { [variant_isset apache] || [variant_isset apache2] || [variant_isset apache20] } {
     337            configure.args-append \
     338                --enable-fastcgi \
     339                --enable-force-cgi-redirect
     340            ui_msg "$UI_PREFIX Configuring ${name} again for fastcgi"
     341            command_exec configure
     342            ui_msg "$UI_PREFIX Building ${name} again for fastcgi"
     343            command_exec build
     344            ui_msg "$UI_PREFIX Staging ${name} fastcgi into destroot"
     345        }
     346       
     347        # Copy the FastCGI binary to the bin dir under a new name so it doesn't
     348        # conflict with the cli version.
     349        xinstall -m 755 ${worksrcpath}/sapi/cgi/php ${destroot}${prefix}/bin/php-cgi${major}
    301350    }
    302351   
Note: See TracChangeset for help on using the changeset viewer.