Ticket #403: Portfile-variants

File Portfile-variants, 1.7 KB (added by bchesneau@…, 21 years ago)

Portfile with mysql and postgres variant

Line 
1PortSystem 1.0
2name            php
3version         4.3.1
4categories      www
5maintainers     bchesneau@mac.com
6description     PHP: Hypertext Preprocessor
7long_description        PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.
8
9platforms               darwin
10master_sites    http://www.php.net/distributions/
11checksums       md5 d4a34efe145b43ed10dbd95825686065
12
13depends_lib             lib:libdl.1:dlcompat \
14                                lib:libcurl.2:curl \
15                                lib:libiconv.2:libiconv \
16                                lib:libexpat.0.4:expat  \
17                                lib:libintl:gettext \
18                                lib:libjpeg.9:jpeg \
19                                lib:libpng3:libpng \
20                                lib:libmhash:mhash \
21                                path:${prefix}/sbin/apxs:apache
22                               
23
24configure.env           LDFLAGS=-L${prefix}/lib CPPFLAGS=-I${prefix}/include
25
26configure.args          --with-apxs=${prefix}/sbin/apxs --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 --with-curl=${prefix} --with-gd --with-jpeg-dir=${prefix} --with-png-dir=${prefix} --without-mysql --with-gettext=${prefix} --with-mhash=${prefix} --with-expat-dir=${prefix} --with-iconv-dir=${prefix} --with-xmlrpc --enable-filepro --enable-bcmath --with-zlib-dir=/usr
27
28
29variant mysql {
30        depends_lib     lib:libmysqlclient:mysql
31        configure.args-append   --with-mysql=${prefix}
32}
33
34variant postgresql {
35        configure.env   LDFLAGS=-L${prefix}/lib -L${prefix}/pgsql \
36                                        CPPFLAGS=-I${prefix}/include
37                                       
38        depends_lib     lib:plpgsql:postgresql
39        configure.args-append   --with-pgsql=${prefix}/pgsql
40}
41       
42       
43post-install    {
44        file mkdir ${destroot}${prefix}/etc
45        system "cp ${workpath}/${worksrcdir}/php.ini-dist ${destroot}${prefix}/etc/php.ini"
46}