Ticket #775: php-portfile-20030818

File php-portfile-20030818, 5.2 KB (added by bchesneau@…, 21 years ago)

Portfile

Line 
1# $Id: Portfile,v 1.6 2003/08/17 19:10:08 fkr Exp $
2
3PortSystem 1.0
4name            php4
5version         4.3.2
6revision                1
7categories      lang www
8maintainers     bchesneau@mac.com
9description     PHP: Hypertext Preprocessor
10long_description        PHP is a widely-used general-purpose scripting language \
11                        that is especially suited for Web development and can be \
12                        embedded into HTML.
13platforms       darwin freebsd
14distname        php-${version}
15worksrcdir      php-${version}
16master_sites    http://fr.php.net/distributions/ \
17                http://www.php.net/distributions/
18checksums       php-4.3.2.tar.gz md5 8433a1d0ce679780990d4813ae094590
19
20depends_lib     lib:libiconv.2:libiconv \
21                lib:libexpat.0.4:expat  \
22                lib:libintl:gettext \
23                lib:libz.1:zlib
24
25configure.env   LDFLAGS=-L${prefix}/lib \
26                CPPFLAGS=-I${prefix}/include
27
28
29if { ![variant_isset cli] } {
30        configure.args-append   --disable-cli
31}
32
33configure.args  --mandir=${prefix}/share/man --infodir=${prefix}/share/info \
34                --with-config-file-path=${prefix}/etc --enable-calendar \
35                --with-iconv=${prefix} --enable-exif --enable-ftp --enable-wddx\
36                --with-zlib --without-mysql --with-gettext=${prefix} \
37                --with-expat-dir=${prefix} --with-iconv-dir=${prefix} \
38                --with-xmlrpc --enable-filepro --enable-bcmath
39               
40variant darwin {
41        depends_lib-append      lib:libdl.1:dlcompat
42}
43
44variant cli {}
45
46pre-configure {
47        global APACHE_VER
48        if { [file readable ${prefix}/sbin/apxs] } {
49                configure.args-append   --with-apxs=${prefix}/sbin/apxs
50                set APACHE_VER ""
51        } elseif { [file readable ${prefix}/apache/bin/apxs] } {
52                configure.args-append   --with-apxs=${prefix}/apache/bin/apxs
53                set APACHE_VER ""
54        } elseif { [file readable ${prefix}/include/apache2/apr.h] } {
55                configure.args-append   --with-apxs2=${prefix}/sbin/apxs
56                set APACHE_VER "2"
57        } elseif { [file readable ${prefix}/apache2/bin/apxs] } {
58                configure.args-append   --with-apxs2=${prefix}/apache2/bin/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        }
65}
66
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}
87}
88
89variant 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        }
98        configure.args-append   --with-mysql=${prefix}
99}
100
101variant postgresql {
102        configure.env-append    LDFLAGS=-L${prefix}/lib -L${prefix}/pgsql
103                                       
104        depends_lib-append      lib:plpgsql:postgresql
105        configure.args-append   --with-pgsql=${prefix}/pgsql
106}
107
108variant ssl {
109        configure.args-append   --with-openssl=/usr
110}
111
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}
121        }
122}
123
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 install-cli install-modules install-pear install-build install-headers install-programs
135
136post-destroot   {
137
138        #copy module
139        if { [file readable ${prefix}/sbin/apxs] } {
140                file mkdir ${destroot}${prefix}/libexec/apache${APACHE_VER}
141                system "install -m 755 ${worksrcpath}/libs/libphp4.so ${destroot}${prefix}/libexec/apache${APACHE_VER}/"
142        } else {
143                file mkdir ${destroot}${prefix}/apache${APACHE_VER}/libexec
144                system "install -m 755 ${worksrcpath}/libs/libphp4.so ${destroot}${prefix}/apache${APACHE_VER}/libexec/"
145        }
146
147        #copy php.ini
148        file mkdir ${destroot}${prefix}/etc
149        system "install -m 755 ${workpath}/${worksrcdir}/php.ini-dist ${destroot}${prefix}/etc/php.ini-dist"
150        system "install -m 755 ${workpath}/${worksrcdir}/php.ini-recommended ${destroot}${prefix}/etc/php.ini-recommended"
151       
152        if { [file readable ${prefix}/sbin/apxs] } {
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        } else {
158                file mkdir ${destroot}${prefix}/apache${APACHE_VER}/conf/modules.d
159                file mkdir ${destroot}${prefix}/apache${APACHE_VER}/conf/extras-conf
160                system "install -o root -m 755 -c  ${portpath}/files/mod_php ${destroot}${prefix}/apache${APACHE_VER}/conf/modules.d"
161                system "install -o root -m 755 -c  ${portpath}/files/mod_php.conf ${destroot}${prefix}/apache${APACHE_VER}/conf/extras-conf"
162        }
163}