Split the INSTALL_DATA_DIR line with the two directories into two commands.
[pkgsrcv2.git] / www / php3 / Makefile
1 # $NetBSD: Makefile,v 1.14 2000/05/26 14:07:31 veego Exp $
2 #
3
4 DISTNAME=       php-${PHP_VERSION}
5 CATEGORIES=     www
6 MASTER_SITES=   ftp://ftp.php.net/pub/distributions/
7 # This is needed because other pkgs .include this Makefile
8 DISTFILES+=     ${DISTNAME}.tar.gz
9
10 MAINTAINER=     cjs@netbsd.org
11 HOMEPAGE=       http://www.php.net/
12
13 BUILD_DEPENDS+= ${LOCALBASE}/bin/perl:../../lang/perl5
14 DEPENDS+=       gdbm-1.7.3:../../databases/gdbm
15
16 .include "../../mk/bsd.prefs.mk"
17
18 .if ${OPSYS} == "SunOS"
19 DEPENDS+=       zlib-*:../../devel/zlib
20 .endif
21
22
23 PHP_VERSION=    3.0.16
24
25 .if defined(BUILDING_EXTENSION_MODULE) || defined(BUILDING_SERVER_MODULE)
26 DEPENDS+=       php-${PHP_VERSION}:../../www/php3
27 FILESDIR?=      ${PKGSRCDIR}/www/php3/files
28 PATCHDIR?=      ${PKGSRCDIR}/www/php3/patches
29 .endif
30
31 # Here we configure only for what NetBSD ships.  We add the rest via modules.
32 GNU_CONFIGURE=  YES
33 CONFIGURE_ARGS+=--with-system-regex --without-gd \
34                 --with-gdbm=${PREFIX} \
35                 --with-yp --with-zlib --with-dbase --with-filepro \
36                 --with-config-file-path=${PREFIX}/etc \
37                 --with-exec-dir=${PREFIX}/libexec/php3 \
38                 --enable-track-vars --enable-force-cgi-redirect \
39                 --enable-discard-path --enable-memory-limit \
40                 --enable-sysvsem --enable-sysvshm
41 CONFIGURE_ENV+= PERL_PATH=${LOCALBASE}/bin/perl
42
43 .if !defined(BUILDING_EXTENSION_MODULE)
44 CONFIGURE_ENV+= CPPFLAGS="-DPHP_INTERNAL_FUNCS"
45
46 post-extract:
47         @${CP} ${FILESDIR}/abstractions.c ${WRKSRC}
48
49 .if !defined(BUILDING_SERVER_MODULE)
50 post-build:
51         @cd ${WRKSRC}/convertor && ${MAKE}
52
53 # The PHP includes are not easily detachable from the source tree in this
54 # release, so we extract the PHP sources with every module.
55 # This should improve in PHP 3.1 or 4.0.
56
57 do-install:
58         ${INSTALL_PROGRAM} ${WRKSRC}/php ${PREFIX}/bin/
59         ${INSTALL_PROGRAM} ${WRKSRC}/convertor/convertor \
60                 ${PREFIX}/bin/php2convert
61         if [ ! -d ${PREFIX}/libexec/cgi-bin ]; then \
62           ${MKDIR}  ${PREFIX}/libexec/cgi-bin ; fi
63         ${LN} -sf ../../bin/php ${PREFIX}/libexec/cgi-bin/php
64         ${INSTALL_DATA_DIR} ${PREFIX}/lib/php3
65         ${INSTALL_DATA_DIR} ${PREFIX}/share/php3
66         ${INSTALL_DATA} ${WRKSRC}/extra/icons/* ${PREFIX}/share/php3/
67         ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/php3
68         ${INSTALL_DATA} ${WRKSRC}/examples/README* ${WRKSRC}/examples/*.php3 \
69                 ${PREFIX}/share/examples/php3/
70         @${SED} s,@PREFIX@,${PREFIX}, ${FILESDIR}/php3.ini.example \
71                 > ${WRKDIR}/php3.ini.example
72         ${INSTALL_DATA} ${WRKDIR}/php3.ini.example ${PREFIX}/etc/
73         @[ -f ${PREFIX}/etc/php3.ini ] || ${CP} ${PREFIX}/etc/php3.ini.example ${PREFIX}/etc/php3.ini
74 .endif
75 .endif
76
77 .include "../../mk/bsd.pkg.mk"