Ticket #775: portfile-php4-20030817.diff

File portfile-php4-20030817.diff, 5.9 KB (added by bchesneau@…, 21 years ago)

Patch portfile in cvs

  • (a) Portfile-old vs. (b) Portfile

    a b  
    33PortSystem 1.0
    44name            php4
    55version         4.3.2
    6 categories      www
     6categories      lang,www
    77maintainers     bchesneau@mac.com
    88description     PHP: Hypertext Preprocessor
    99long_description        PHP is a widely-used general-purpose scripting language \
     
    1616                http://www.php.net/distributions/
    1717checksums       php-4.3.2.tar.gz md5 8433a1d0ce679780990d4813ae094590
    1818
    19 depends_lib     lib:libcurl.2:curl \
    20                 lib:libiconv.2:libiconv \
     19depends_lib     lib:libiconv.2:libiconv \
    2120                lib:libexpat.0.4:expat  \
    2221                lib:libintl:gettext \
    23                 lib:libjpeg.9:jpeg \
    24                 lib:libpng3:libpng \
    25                 lib:libmhash:mhash \
    2622                lib:libz.1:zlib
    2723
    28 set imapversion 2002d
     24set PHP_INSTALLTARGETS "install-cli install-modules install-pear install-build install-headers install-programs"
    2925                               
    30 configure.env   LDFLAGS=-L${prefix}/lib CPPFLAGS=-I${prefix}/include
     26configure.env   LDFLAGS=-L${prefix}/lib \
     27                                CPPFLAGS=-I${prefix}/include
     28
     29
     30if { ![variant_isset apache] } {
     31        configure.args-append   --enable-discard-path
     32}
     33
     34if { ![variant_isset cli] } {
     35        configure.args-append   --disable-cli
     36}
    3137
    3238configure.args  --mandir=${prefix}/share/man --infodir=${prefix}/share/info \
    3339                --with-config-file-path=${prefix}/etc --enable-calendar \
    3440                --with-iconv=${prefix} --enable-exif --enable-ftp --enable-wddx\
    35                 --with-zlib --with-curl=${prefix} --with-gd --with-jpeg-dir=${prefix} \
    36                 --with-png-dir=${prefix} --without-mysql --with-gettext=${prefix} \
    37                 --with-mhash=${prefix} --with-expat-dir=${prefix} --with-iconv-dir=${prefix} \
     41                --with-zlib --without-mysql --with-gettext=${prefix} \
     42                --with-expat-dir=${prefix} --with-iconv-dir=${prefix} \
    3843                --with-xmlrpc --enable-filepro --enable-bcmath
    39 
     44               
    4045variant darwin {
    4146        depends_lib-append      lib:libdl.1:dlcompat
    4247}
    4348
     49variant cli {}
     50
    4451variant apache {
    45         depends_lib-append      path:${prefix}/apache-1.3.27/sbin/apxs:apache
    46         configure.args-append --with-apxs=${prefix}/apache-1.3.27/sbin/apxs
     52        global APACHE_VER
     53       
     54        if { [file readable ${prefix}/sbin/apxs] } {
     55                configure.args-append   --with-apxs=${prefix}/sbin/apxs
     56                set APACHE_VER ""
     57        } elseif { [file readable ${prefix}/include/apache2/apr.h] } {
     58                configure.args-append   --with-apxs2=${prefix}/sbin/apxs
     59                set APACHE_VER 2
     60        } else {                                       
     61                depends_lib-append      path:${prefix}/sbin/apxs:apache
     62                configure.args-append   --with-apxs=${prefix}/sbin/apxs
     63                set APACHE_VER ""
     64        }
    4765}
    4866
    49 variant apache2 {
    50         depends_lib-append      path:${prefix}/apache2/bin/apxs:apache2
    51         configure.args-append --with-apxs2=${prefix}/apache2/bin/apxs
     67variant crypt {
     68
     69        depends_lib-append      lib:libmhash:mhash \
     70                                                lib:libmcrypt:libmcrypt
     71        configure.args-append   --with-mhash=${prefix} --with-mcrypt=${prefix}
     72}       
     73
     74variant curl {
     75        depends_lib-append      lib:libcurl.2:curl
     76        configure.args-append   --with-curl=${prefix}
     77}
     78
     79variant gd {
     80        depends_lib-append      lib:libjpeg.9:jpeg \
     81                                                lib:libpng3:libpng
     82                                               
     83       
     84        configure.args-append   --with-gd \
     85                                                        --with-jpeg-dir=${prefix} \
     86                                                        --with-png-dir=${prefix}
    5287}
    5388
    5489variant mysql {
    55         depends_lib-append      lib:libmysqlclient:mysql
     90
     91        if [file readable ${prefix}/lib/mysql/libmysqlclient.so.10 ] {
     92                depends_lib-append      lib:libmysqlclient.10:mysql
     93        } elseif [file  readable ${prefix}/lib/mysql/libmysqlclient.so.12 ] {
     94                depends_lib-append      lib:libmysqlclient.12:mysql4
     95        } else {
     96                depends_lib-append      lib:libmysqlclient.12:mysql4
     97        }
    5698        configure.args-append   --with-mysql=${prefix}
    5799}
    58100
     
    63105        configure.args-append   --with-pgsql=${prefix}/pgsql
    64106}
    65107
    66 variant imap {
    67         master_sites-append     ftp://ftp.cac.washington.edu/imap/:imap\
    68                                 http://distfiles.opendarwin.org/:imap
    69         distfiles-append        imap-${imapversion}.tar.Z:imap
    70         checksums-append        imap-2002d.tar.Z md5 64e82a195d21481fc4c54c4ed9fe0527
    71 
    72         extract.only            php-${version}.tar.gz imap-${imapversion}.tar.Z
    73         configure.args-append   --with-imap=../imap-${imapversion} --with-imap-ssl=/usr
     108variant ssl {
     109        configure.args-append   --with-openssl=/usr
    74110}
    75111
    76 pre-configure {
    77         if { [variant_isset imap] } {
    78                 system "cd ${workpath}/imap-${imapversion} && \
    79                                                 make osx SSLTYPE=nopwd"
    80                 system "cd ${workpath}/${worksrcdir}"
     112variant imap {
     113        depends_lib-append              lib:c-client:cclient
     114        configure.env-append     CFLAGS=-I${prefix}/include/c-client
     115       
     116               
     117        if { [variant_isset ssl] } {
     118                configure.args-append   --with-imap=${prefix} --with-imap-ssl=/usr
     119        } else {
     120                configure.args-append   --with-imap=${prefix}
    81121        }
    82122}
    83123
    84 destroot.args   prefix=${destroot}${prefix}
     124variant xslt {
     125        depends_lib-append      lib:libsablot:sablotron
     126       
     127        configure.args-append   --enable-xslt --with-xslt-sablot=${prefix} \
     128                                                        --with-iconv-dir=${prefix}  --with-expat-dir=${prefix}
     129 }
     130
     131
     132destroot.args   INSTALL_ROOT=${destroot}${prefix} PHP_PEAR_INSTALL_DIR=${prefix}/lib/php
     133
     134destroot.target         ${PHP_INSTALLTARGETS}
     135
    85136       
    86137post-destroot   {
     138
     139        #copy module
     140        if { [variant_isset apache] } {
     141                file mkdir ${destroot}${prefix}/libexec/apache${APACHE_VER}
     142                system "install -m 755 ${worksrcpath}/libs/libphp4.so ${destroot}${prefix}/libexec/apache${APACHE_VER}/"
     143        }
     144
     145        #copy php.ini
    87146        file mkdir ${destroot}${prefix}/etc
    88         system "cp ${workpath}/${worksrcdir}/php.ini-dist ${destroot}${prefix}/etc/php.ini"
     147        system "install -m 755 ${workpath}/${worksrcdir}/php.ini-dist ${destroot}${prefix}/etc/php.ini-dist"
     148        system "install -m 755 ${workpath}/${worksrcdir}/php.ini-recommended ${destroot}${prefix}/etc/php.ini-recommended"
     149
     150       
     151        #copy conffiles
     152        file mkdir ${destroot}${prefix}/etc/apache${APACHE_VER}
     153        file mkdir ${destroot}${prefix}/etc/apache${APACHE_VER}/modules.d
     154        file mkdir ${destroot}${prefix}/etc/apache${APACHE_VER}/extras-conf
     155        system "install -o root -m 755 -c  ${portpath}/files/mod_php ${destroot}${prefix}/etc/apache${APACHE_VER}/modules.d"
     156        system "install -o root -m 755 -c  ${portpath}/files/mod_php.conf ${destroot}${prefix}/etc/apache${APACHE_VER}/extras-conf"
     157       
    89158}