Ticket #44116: Portfile-php55.diff

File Portfile-php55.diff, 3.3 KB (added by Schamschula (Marius Schamschula), 10 years ago)
  • Portfile

    old new  
    3838    if {[regexp {^php\d+$} ${subport}]} {
    3939        return yes
    4040    }
    41     return [expr {-1 != [lsearch -exact [list apache2handler cgi fpm] ${php.rootname}]}]
     41    return [expr {-1 != [lsearch -exact [list apache2handler apache24handler cgi fpm] ${php.rootname}]}]
    4242}
    4343
    4444# Returns true if the subport is an extension, false otherwise (SAPI, stub port).
     
    351351
    352352    cd ${moduledir}
    353353    sudo ${apxs} -a -e -n php${major} mod_${php}.so
     354    sudo chmod a+x php${major} mod_${php}.so
     355   
     356Also edit httpd.conf:
     357The line
     358    LoadModule php5_module mod_php55.so
     359should read
     360    LoadModule php5_module ${moduledir}/mod_php55.so
     361Also add the following to the <IfModule mime_module> section:
     362    AddType application/x-httpd-php .php
     363"
     364}
     365
     366### Apache 24 handler SAPI ###
     367
     368subport ${php}-apache24handler {
     369    description             ${php} Apache 2 Handler SAPI
     370    php.extensions          apache2handler
     371   
     372#    regexp {^php\d+-(.+)$} apache2handler -> php.rootname
     373   
     374    long_description        ${description}
     375   
     376    homepage                http://www.php.net/install.unix.apache2
     377   
     378    depends_lib-append      port:apache24-devel
     379   
     380    set apxs ${prefix}/bin/apxs
     381    set confdir ${prefix}/conf
     382    set moduledir ${prefix}/lib/apache2/modules
     383   
     384    pre-configure {
     385        # Checking for mod_cgi.so is a convenient way to verify apache2 is using its
     386        # +preforkmpm variant. (+eventmpm and +workermpm instead provide mod_cgid.so.)
     387        if {![file exists ${moduledir}/mod_cgi.so]} {
     388            ui_error "To use ${subport}, apache24-devel must be installed with the +preforkmpm variant."
     389            return -code error "incompatible apache24-devel installation"
     390        }
     391    }
     392   
     393    configure.args-append   --with-apxs2=${apxs}
     394   
     395    build.target            libs/libphp5.bundle
     396   
     397    destroot {
     398        xinstall -m 755 -d ${destroot}${moduledir} ${destroot}${confdir}/extra
     399        xinstall -m 644 ${worksrcpath}/libs/libphp5.so ${destroot}${moduledir}/mod_${php}.so
     400        xinstall -m 644 ${filespath}/mod_php.conf ${destroot}${confdir}/extra/mod_${php}.conf
     401    }
     402   
     403    notes-append "
     404
     405To enable ${subport}, run:
     406
     407    cd ${moduledir}
     408    sudo ${apxs} -a -e -n php${major} mod_${php}.so
     409    sudo chmod a+x php${major} mod_${php}.so
     410   
     411Also edit httpd.conf:
     412The line
     413    LoadModule php5_module mod_php55.so
     414should read
     415    LoadModule php5_module ${moduledir}/mod_php55.so
     416Also add the following to the <IfModule mime_module> section:
     417    AddType application/x-httpd-php .php
    354418"
    355419}
    356420
     
    376440   
    377441}
    378442
     443### CGI SAPI ###
     444
     445subport ${php}-cgi {
     446    description             ${php} CGI SAPI
     447   
     448    long_description        ${description}
     449   
     450    homepage                http://www.php.net/install.unix.commandline
     451   
     452    configure.args-replace  --disable-cgi --enable-cgi
     453   
     454    if {[vercmp ${branch} 5.4] >= 0} {
     455        build.target        cgi
     456        destroot.target     install-cgi
     457    } else {
     458        destroot {
     459            xinstall ${worksrcpath}/sapi/cgi/php-cgi ${destroot}${prefix}/bin/php-cgi[php.suffix_from_branch ${branch}]
     460        }
     461    }
     462   
     463}
     464
    379465### FPM SAPI ###
    380466
    381467subport ${php}-fpm {