Ticket #8599: php5-Portfile-fastcgi-anytime.diff
File php5-Portfile-fastcgi-anytime.diff, 4.8 KB (added by ryandesign (Ryan Carsten Schmidt), 18 years ago) |
---|
-
Portfile
3 3 PortSystem 1.0 4 4 name php5 5 5 version 5.2.1 6 revision 36 revision 4 7 7 categories lang php www 8 8 maintainers ryandesign@macports.org jwa@macports.org 9 9 platforms darwin freebsd … … 135 135 --with-iodbc=/usr 136 136 } 137 137 138 variant apache conflicts apache2 fastcgi { 138 # Build an Apache 1 module. On Mac OS X, it uses Apple's provided Apache 1 server. 139 # On other platforms, the MacPorts apache port is used. Keep the options here 140 # in sync with those in the relevant part of the post-destroot phase. 141 variant apache conflicts apache2 { 139 142 if { ! [variant_isset macosx] } { 140 143 depends_lib-append \ 141 144 path:${prefix}/sbin/apxs:apache … … 147 150 } 148 151 } 149 152 150 variant apache2 conflicts apache fastcgi { 153 # Build an Apache 2 module. Keep the options here in sync with those in the 154 # relevant part of the post-destroot phase. 155 variant apache2 conflicts apache { 151 156 depends_lib-append \ 152 157 path:${prefix}/apache2/bin/apxs:apache2 153 158 configure.args-append \ 154 159 --with-apxs2=${prefix}/apache2/bin/apxs 155 160 } 156 161 157 variant fastcgi conflicts apache apache2 { 158 configure.args-append \ 159 --enable-fastcgi \ 160 --enable-force-cgi-redirect \ 161 --enable-memory-limit 162 # Build a FastCGI binary. Keep the options here in sync with those in the 163 # relevant part of the post-destroot phase. 164 variant fastcgi { 165 if { ![variant_isset apache] && ![variant_isset apache2] } { 166 configure.args-append \ 167 --enable-fastcgi \ 168 --enable-force-cgi-redirect \ 169 --enable-memory-limit 170 } 162 171 } 163 172 164 173 variant snmp conflicts macports_snmp { … … 291 300 install-cli install-build install-headers install-programs 292 301 293 302 post-destroot { 294 # copy fastcgi php binary to the bin dir under a new name so it doesn't overwrite cli version 295 if { [variant_isset fastcgi] } { 296 xinstall -m 755 ${worksrcpath}/sapi/cgi/php ${destroot}${prefix}/bin/php-fcgi 297 } 298 299 #copy module 303 # Copy the Apache 1 module. 300 304 if { [variant_isset apache] } { 301 302 305 xinstall -m 755 -d ${destroot}${prefix}/libexec/apache \ 303 306 ${destroot}${prefix}/etc/apache/extras-conf 304 307 xinstall -m 755 ${worksrcpath}/libs/libphp5.so ${destroot}${prefix}/libexec/apache/ 305 308 xinstall -m 755 -c ${filespath}/mod_php.conf ${destroot}$prefix/etc/apache/extras-conf 306 309 } 307 310 311 # Copy the Apache 2 module. 308 312 if { [variant_isset apache2] } { 309 313 xinstall -m 755 -d ${destroot}${prefix}/apache2/modules \ 310 314 ${destroot}${prefix}/apache2/conf/extras-conf … … 312 316 xinstall -m 755 -c ${filespath}/mod_php.conf ${destroot}${prefix}/apache2/conf/extras-conf 313 317 } 314 318 319 if { [variant_isset fastcgi] } { 320 # If we've built an Apache module (any version) then the FastCGI binary 321 # will not have been built, so we need to run through the whole process 322 # again and build just the FastCGI binary. Keep the options here in sync 323 # with the options specified in the apache and apache2 variants. 324 if { [variant_isset apache] } { 325 if { ![variant_isset macosx] } { 326 configure.args-delete \ 327 --with-apxs=${prefix}/sbin/apxs 328 } else { 329 configure.args-delete \ 330 --with-apxs=/usr/sbin/apxs 331 } 332 } 333 if { [variant_isset apache2] } { 334 configure.args-delete \ 335 --with-apxs2=${prefix}/apache2/bin/apxs 336 } 337 338 # Run the build again to get the FastCGI binary. Keep the options here 339 # in sync with those in the fastcgi variant. 340 if { [variant_isset apache] || [variant_isset apache2] } { 341 configure.args-append \ 342 --enable-fastcgi \ 343 --enable-force-cgi-redirect \ 344 --enable-memory-limit 345 ui_msg "$UI_PREFIX Configuring ${name} fastcgi" 346 # Note: Use command_exec as soon as a released MacPorts supports it! 347 #command_exec configure 348 my_command_exec configure 349 ui_msg "$UI_PREFIX Building ${name} fastcgi" 350 #command_exec build 351 my_command_exec build 352 ui_msg "$UI_PREFIX Staging ${name} fastcgi into destroot" 353 } 354 355 # Copy the FastCGI binary to the bin dir under a new name so it doesn't 356 # conflict with the cli version. 357 xinstall -m 755 ${worksrcpath}/sapi/cgi/php ${destroot}${prefix}/bin/php-fcgi 358 } 359 315 360 # file rename ${destroot}${prefix}/etc/pear.conf ${destroot}${prefix}/etc/pear.conf.sample 316 361 317 # copy php.ini362 # Copy the default php.ini files. 318 363 xinstall -m 755 -d ${destroot}${prefix}/etc 319 364 xinstall -m 755 ${workpath}/${worksrcdir}/php.ini-dist ${destroot}${prefix}/etc/php.ini-dist 320 365 xinstall -m 755 ${workpath}/${worksrcdir}/php.ini-recommended ${destroot}${prefix}/etc/php.ini-recommended … … 340 385 # ui_msg "* copy ${prefix}/etc/pear.conf.sample to ${prefix}/etc/pear.conf" 341 386 } 342 387 388 proc my_command_exec {cmd} { 389 if {[catch {system "[command $cmd]"} result]} { 390 return -code error "[format [msgcat::mc "%s failure: %s"] $cmd $result]" 391 } 392 }