# $Id$ PortSystem 1.0 name php4 version 4.4.9 revision 4 categories www php lang maintainers jwa ryandesign homepage http://www.php.net/ distname php-${version} use_bzip2 yes platforms darwin freebsd use_parallel_build yes 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. master_sites \ ${homepage}distributions/ \ http://it.php.net/distributions/ \ http://fi.php.net/distributions/ \ http://de.php.net/distributions/ \ http://gr.php.net/distributions/ \ http://fr.php.net/distributions/ \ http://es.php.net/distributions/ \ http://se.php.net/distributions/ checksums \ md5 2e3b2a0e27f10cb84fd00e5ecd7a1880 \ sha1 ab3d2205d756ddf93452b57bd6ce6a2014b1c374 \ rmd160 0d77092efaccd8fe6efc16635be98c5d4ccfec66 depends_build \ port:pkgconfig depends_lib \ port:libiconv \ port:expat \ port:gettext \ port:zlib \ port:openssl \ port:tiff \ port:libxml2 \ port:libtool \ port:mhash \ port:libmcrypt \ port:curl \ port:jpeg \ port:libpng \ port:freetype configure.args \ --mandir=${prefix}/share/man \ --infodir=${prefix}/share/info \ --includedir=${prefix}/include/php4 \ --libdir=${prefix}/lib/php4 \ --sysconfdir=${prefix}/etc/php4 \ --with-config-file-path=${prefix}/etc \ --with-pear=${prefix}/lib/php4 \ --program-suffix=4 \ --enable-mbstring \ --enable-dbx \ --enable-safe-mode \ --enable-dba \ --enable-calendar \ --enable-exif \ --enable-ftp \ --enable-wddx \ --enable-filepro \ --enable-bcmath \ --enable-cli \ --with-xml \ --with-xmlrpc \ --without-mysql \ --with-iconv=${prefix} \ --with-zlib=${prefix} \ --with-gettext=${prefix} \ --with-expat-dir=${prefix} \ --with-dom=${prefix} \ --with-openssl=${prefix} \ --with-mhash=${prefix} \ --with-mcrypt=${prefix} \ --with-mime-magic \ --with-curl=${prefix} \ --with-gd \ --with-jpeg-dir=${prefix} \ --with-png-dir=${prefix} \ --enable-gd-native-ttf \ --with-freetype-dir=${prefix} platform darwin 6 { depends_lib-append \ port:dlcompat configure.env-append \ LIBS=-ldl configure.cppflags-append \ "-no-cpp-precomp -DBIND_8_COMPAT" } platform darwin 7 { configure.env-append \ LIBS=-ldl configure.cppflags-append \ "-no-cpp-precomp" } platform macosx { configure.args-append \ --with-ldap=/usr \ --with-kerberos=/usr \ --with-iodbc=/usr } variant no_web conflicts apache apache2 apache20 description {Don't include any web server support} {} variant apache conflicts apache2 apache20 no_web description {Add Apache 1 web server module} { if { ! [variant_isset macosx] } { depends_lib-append \ port:apache configure.args-append \ --with-apxs=${prefix}/sbin/apxs } else { destroot.violate_mtree yes configure.args-append \ --with-apxs=/usr/sbin/apxs } } variant apache2 conflicts apache apache20 no_web description {Add Apache 2.2 web server module (default)} { pre-fetch { if {[string match "*libmysqlclient_r.la*" [exec pkg-config --libs apr-util-1]]} { return -code error "${name} +apache2 can't be built while apr-util is installed with the +mysql5 variant. Deactivate or uninstall apr-util, reinstall apr-util without the +mysql5 variant, then clean ${name} and try installing it again." } } destroot.violate_mtree yes depends_lib-append \ port:apache2 configure.args-append \ --with-apxs2=${prefix}/apache2/bin/apxs } variant apache20 conflicts apache apache2 no_web description {Add Apache 2.0 web server module} { destroot.violate_mtree yes depends_lib-append \ port:apache20 configure.args-append \ --with-apxs2=${prefix}/apache20/bin/apxs } variant mysql3 conflicts mysql4 mysql5 description {MySQL 3 functions} { depends_lib-append \ port:mysql3 configure.args-append \ --with-mysql=${prefix} } variant mysql4 conflicts mysql3 mysql5 description {MySQL 4 functions} { depends_lib-append \ port:mysql4 configure.args-append \ --with-mysql=${prefix} } variant mysql5 conflicts mysql3 mysql4 description {MySQL 5 functions} { depends_lib-append \ path:bin/mysql_config5:mysql5 configure.args-delete \ --without-mysql configure.args-append \ --with-mysql=${workpath}/mysql5 post-extract { file mkdir "${workpath}/mysql5" file link -symbolic "${workpath}/mysql5/lib" "${prefix}/lib/mysql5" file link -symbolic "${workpath}/mysql5/include" "${prefix}/include/mysql5" } post-destroot { reinplace "s;${workpath}/mysql5/lib;${prefix}/lib/mysql5;" ${destroot}${prefix}/bin/php-config4 } } variant postgresql8 description {add support for PostgreSQL databases} { pre-configure { file mkdir ${workpath}/pgsql8 system "cd ${workpath}/pgsql8 && \ ln -sf ${prefix}/include/postgresql82 include && \ ln -sf ${prefix}/lib/postgresql82 lib && \ ln -sf ${prefix}/lib/postgresql82/bin bin" } depends_lib-append \ port:postgresql82 configure.args-append \ --with-pgsql=${workpath}/pgsql8 } variant ldap description {enable LDAP support} { depends_lib-append \ port:openldap configure.args-append \ --with-ldap=${prefix} } variant gmp description {Add GNU MP functions} { depends_lib-append \ port:gmp configure.args-append \ --with-gmp=${prefix} } variant dbase description {Add dBase file format support} { configure.args-append \ --enable-dbase } variant imap description {enable operatin with IMAP protocol} { depends_lib-append \ port:cclient configure.cppflags-append \ -I${prefix}/include/c-client configure.args-append \ --with-imap=${prefix} \ --with-imap-ssl=/usr } variant pspell description {Add pspell spell-checking functions} { depends_lib-append \ port:aspell configure.args-append \ --with-pspell=${prefix} } variant xslt description {a processor independent API to XSLT transformations} { depends_lib-append \ port:sablotron configure.args-append \ --enable-xslt \ --with-xslt-sablot=${prefix} \ --with-iconv-dir=${prefix} } if {![variant_isset apache] && ![variant_isset apache2] && ![variant_isset apache20] && ![variant_isset no_web]} { default_variants +apache2 } variant readline description {Add GNU readline functions} { depends_lib-append \ port:readline configure.args-append \ --with-readline=${prefix} } variant t1lib description {Add PostScript Type 1 font support with t1lib} { depends_lib-append \ port:t1lib configure.args-append \ --with-t1lib=${prefix} \ } 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] } { xinstall -m 755 -d ${destroot}${prefix}/libexec/apache \ ${destroot}${prefix}/etc/apache/extras-conf xinstall -m 755 ${worksrcpath}/libs/libphp4.so ${destroot}${prefix}/libexec/apache/ xinstall -m 755 -c ${filespath}/mod_php.conf ${destroot}$prefix/etc/apache/extras-conf/mod_php.conf.sample } if { [variant_isset apache2] } { xinstall -m 755 -d ${destroot}${prefix}/apache2/modules \ ${destroot}${prefix}/apache2/conf/extras-conf xinstall -m 755 ${worksrcpath}/libs/libphp4.so ${destroot}${prefix}/apache2/modules/ xinstall -m 755 -c ${filespath}/mod_php.conf ${destroot}${prefix}/apache2/conf/extras-conf/mod_php.conf.sample } if { [variant_isset apache20] } { xinstall -m 755 -d ${destroot}${prefix}/apache20/modules \ ${destroot}${prefix}/apache20/conf/extras-conf xinstall -m 755 ${worksrcpath}/libs/libphp4.so ${destroot}${prefix}/apache20/modules/ xinstall -m 755 -c ${filespath}/mod_php.conf ${destroot}${prefix}/apache20/conf/extras-conf/mod_php.conf.sample } file rename ${destroot}${prefix}/etc/php4/pear.conf ${destroot}${prefix}/etc/php4/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 # rename files file rename ${destroot}${prefix}/bin/pear ${destroot}${prefix}/bin/pear4 reinplace "s|${prefix}/bin/php|${prefix}/bin/php4|g" ${destroot}${prefix}/bin/pear4 #nuke pear-stuff in ${destroot} system "cd ${destroot} && rm -rf .channels .depdb .depdblock .filemap .lock" system "if \[ -f ${prefix}/lib/php4/.depdblock \]; then rm -f ${destroot}${prefix}/lib/php4/.depdblock; fi" system "if \[ -f ${prefix}/lib/php4/.depdb \]; then rm -f ${destroot}${prefix}/lib/php4/.depdb; fi" system "if \[ -f ${prefix}/lib/php4/.filemap \]; then rm -f ${destroot}${prefix}/lib/php4/.filemap; fi" system "if \[ -f ${prefix}/lib/php4/.lock \]; then rm -f ${destroot}${prefix}/lib/php4/.lock; fi" system "if \[ -d ${prefix}/lib/php4/.channels \]; then rm -rf ${destroot}${prefix}/lib/php4/.channels; fi" } post-install { ui_msg "\nIf this is your first install, you might want" if { [variant_isset apache] } { ui_msg " * enable php in apache :\n" ui_msg "cd ${prefix}/libexec/apache" ui_msg "${prefix}/apache/bin/apxs -a -e -n \"php4\" libphp4.so\n" ui_msg "* copy ${prefix}/etc/php.ini-dist to ${prefix}/etc/php.ini" } if { [variant_isset apache2] } { ui_msg "cd ${prefix}/apache2/modules" ui_msg "${prefix}/apache2/bin/apxs -a -e -n \"php4\" libphp4.so\n" ui_msg "* copy ${prefix}/etc/php.ini-dist to ${prefix}/etc/php.ini" } if { [variant_isset apache20] } { ui_msg "cd ${prefix}/apache20/modules" ui_msg "${prefix}/apache20/bin/apxs -a -e -n \"php4\" libphp4.so\n" ui_msg "* copy ${prefix}/etc/php.ini-dist to ${prefix}/etc/php.ini" } ui_msg "* copy ${prefix}/etc/php4/pear.conf.sample to ${prefix}/etc/php4/pear.conf" } livecheck.check regex livecheck.url ${homepage}downloads.php livecheck.regex get/php-(4\.\[0-9\.\]+)\.tar