# $Id: Portfile,v 1.11 2005/09/28 21:24:09 jberry Exp $ PortSystem 1.0 name php5 version 5.0.5 categories lang www maintainers darwinports@opendarwin.org description PHP: Hypertext Preprocessor long_description PHP is a widely-used general-purpose scripting language \ that is especially suited for Web development and can be \ embedded into HTML. platforms darwin freebsd master_sites http://www.php.net/distributions/:release \ http://it.php.net/distributions/:release \ http://fi.php.net/distributions/:release \ http://de.php.net/distributions/:release \ http://gr.php.net/distributions/:release \ http://fr.php.net/distributions/:release \ http://es.php.net/distributions/:release \ http://se.php.net/distributions/:release \ http://downloads.php.net/ilia/:rc \ http://downloads.php.net/jani/:rc distfiles php-${version}.tar.bz2:release worksrcdir php-${version} checksums md5 b5d4ca75bbb11ee5b830fa67213d9f7f use_bzip2 yes depends_lib port:libxml2 \ port:libxslt \ port:openssl \ port:tidy \ port:zlib \ port:libiconv \ lib:libexpat.0.4:expat \ lib:libintl.3:gettext \ lib:libtiff.3:tiff \ lib:libmhash:mhash \ port:libmcrypt \ lib:c-client:cclient \ port:curl configure.args --mandir=${prefix}/share/man --infodir=${prefix}/share/info \ --with-config-file-path=${prefix}/etc --enable-calendar \ --with-iconv=${prefix} --enable-exif --enable-ftp --enable-wddx\ --with-zlib=${prefix} \ --without-mysql --with-libxml-dir=${prefix} \ --with-gettext=${prefix} \ --with-libxml-dir=${prefix} --with-xml --with-expat-dir=${prefix} \ --with-xmlrpc --enable-filepro \ --enable-bcmath --enable-trans-sid \ --enable-mbstring --enable-dbx --with-openssl=${prefix} \ --with-mhash=${prefix} --with-mcrypt=${prefix} \ --with-tidy=${prefix} --with-xsl=${prefix} \ --with-imap=${prefix} --with-imap-ssl=${prefix} \ --with-curl=${prefix} configure.env CFLAGS=-I${prefix}/include/c-client platform darwin 6 { depends_lib-append lib:libdl:dlcompat configure.env-append LDFLAGS=-L${prefix}/lib \ CPPFLAGS="-I${prefix}/include -no-cpp-precomp -DBIND_8_COMPAT" \ LIBS=-ldl configure.args-append --enable-sqlite-utf8 } platform darwin 7 { configure.env-append LDFLAGS="-L${prefix}/lib" \ CPPFLAGS="-I${prefix}/include -no-cpp-precomp" \ LIBS=-ldl configure.args-append --enable-sqlite-utf8 } platform freebsd { configure.env-append LDFLAGS=-L${prefix}/lib \ CPPFLAGS="-I${prefix}/include } variant macosx { configure.args-append --with-kerberos=/usr --with-iodbc=/usr } variant apache_layout { depends_lib-append path:${prefix}/apache/bin/apxs } variant apache { if { [variant_isset apache_layout] } { configure.args-append --with-apxs=${prefix}/apache/bin/apxs } else { if { ! [variant_isset macosx] } { depends_lib-append path:${prefix}/sbin/apxs:apache configure.args-append --with-apxs=${prefix}/sbin/apxs } else { configure.args-append --with-apxs=/usr/sbin/apxs } } } variant apache2 { depends_lib-append path:${prefix}/apache2/bin/apxs:apache2 configure.args-append --with-apxs2=${prefix}/apache2/bin/apxs } variant gd { depends_lib-append lib:libjpeg.9:jpeg \ lib:libpng.3:libpng \ lib:libfreetype.6.3.5:freetype configure.args-append --with-gd \ --with-jpeg-dir=${prefix} \ --with-png-dir=${prefix} \ --enable-gd-native-ttf \ --with-freetype-dir=${prefix} } variant mysql { depends_lib-append lib:libmysqlclient:mysql configure.args-append --with-mysql=${prefix} } variant mysql4 { depends_lib-append port:mysql4 configure.args-append --with-mysql=${prefix} } variant postgresql { depends_lib-append port:postgresql8 configure.args-append --with-pgsql=${prefix}/lib/pgsql8/bin/ } # if no apache/apache2 variant is set, we set it (waiting a better default variant management) if { ![variant_isset apache] && ![variant_isset apache2] } { if { [variant_isset apache_layout] } { configure.args-append --with-apxs=${prefix}/apache/bin/apxs } else { if { ! [variant_isset macosx] } { depends_lib-append path:${prefix}/sbin/apxs:apache configure.args-append --with-apxs=${prefix}/sbin/apxs } else { configure.args-append --with-apxs=/usr/sbin/apxs } } } destroot.args INSTALL_ROOT=${destroot} PHP_PEAR_INSTALL_DIR=${prefix}/lib/php destroot.target install-cli install-pear install-build install-headers install-programs post-destroot { #copy module if { [variant_isset apache] } { if { ![variant_isset apache_layout] } { file mkdir ${destroot}${prefix}/libexec/apache xinstall -m 755 ${worksrcpath}/libs/libphp5.so ${destroot}${prefix}/libexec/apache/ file mkdir ${destroot}${prefix}/etc/apache/extras-conf xinstall -m 755 -c ${filespath}/mod_php.conf ${destroot}$prefix/etc/apache/extras-conf } else { file mkdir ${destroot}${prefix}/apache/libexec xinstall -m 755 ${worksrcpath}/libs/libphp5.so ${destroot}${prefix}/apache/libexec/ file mkdir ${destroot}${prefix}/apache/conf/extras-conf xinstall -m 755 -c ${filespath}/mod_php.conf ${destroot}${prefix}/apache/conf/extras-conf } } if { [variant_isset apache2] } { file mkdir ${destroot}${prefix}/apache2/modules xinstall -m 755 ${worksrcpath}/libs/libphp5.so ${destroot}${prefix}/apache2/modules/ file mkdir ${destroot}${prefix}/apache2/conf/extras-conf xinstall -m 755 -c ${filespath}/mod_php.conf ${destroot}${prefix}/apache2/conf/extras-conf } file rename ${destroot}${prefix}/etc/pear.conf ${destroot}${prefix}/etc/pear.conf.sample #copy php.ini xinstall -m 755 -d ${destroot}${prefix}/etc xinstall -m 755 ${workpath}/${worksrcdir}/php.ini-dist ${destroot}${prefix}/etc/php.ini-dist xinstall -m 755 ${workpath}/${worksrcdir}/php.ini-recommended ${destroot}${prefix}/etc/php.ini-recommended } post-install { ui_msg "\nIf this your first install, you might want" if { [variant_isset apache] } { ui_msg " * enable php in apache :\n" if { [variant_isset apache_layout] } { ui_msg "cd ${prefix}/apache/libexec" } else { ui_msg "cd ${prefix}/libexec/apache" } ui_msg "apxs -a -e -n \"php5\" libphp5.so\n" ui_msg "* copy ${prefix}/etc/php.ini-dist to ${prefix}/etc/php.ini" } if { [variant_isset apache2] } { ui_msg "cd ${prefix}/apache2/libs" ui_msg "apxs -a -e -n \"php5\" libphp5.so\n" ui_msg "* copy ${prefix}/etc/php.ini-dist to ${prefix}/etc/php.ini" } ui_msg "* copy ${prefix}/etc/pear.conf.sample to ${prefix}/etc/pear.conf" }