summaryrefslogtreecommitdiff
path: root/www/php3/Makefile
blob: 08ccd17037eb5e0439035cf4c54727458313baf0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# $NetBSD: Makefile,v 1.6 1999/05/04 20:22:10 tv Exp $
#

DISTNAME=	php-${PHP_VERSION}
CATEGORIES=	www
MASTER_SITES=	ftp://ftp.php.net/pub/distributions/

MAINTAINER=	cjs@netbsd.org
HOMEPAGE=	http://www.php.net/

# This is needed because other pkgs .include this Makefile
DISTFILES+=	${DISTNAME}.tar.gz
PHP_VERSION=	3.0.7

.if defined(BUILDING_EXTENSION_MODULE) || defined(BUILDING_SERVER_MODULE)
DEPENDS+=	php-${PHP_VERSION}:../../www/php3
FILESDIR?=	${PKGSRCDIR}/www/php3/files
PATCHDIR?=	${PKGSRCDIR}/www/php3/patches
.endif

# Here we configure only for what NetBSD ships.  We add the rest via modules.
GNU_CONFIGURE=  YES
CONFIGURE_ARGS+=--with-system-regex --without-gd \
		--with-yp --with-zlib --with-dbase --with-filepro \
		--with-config-file-path=${PREFIX}/etc \
		--with-exec-dir=${PREFIX}/libexec/php3 \
		--enable-track-vars --enable-force-cgi-redirect \
		--enable-discard-path --enable-memory-limit \
		--enable-sysvsem --enable-sysvshm
CONFIGURE_ENV+=	PERL_PATH=${LOCALBASE}/bin/perl

.if !defined(BUILDING_EXTENSION_MODULE)
CONFIGURE_ENV+=	CPPFLAGS="-DPHP_INTERNAL_FUNCS"

post-extract:
	@${CP} ${FILESDIR}/abstractions.c ${WRKSRC}

.if !defined(BUILDING_SERVER_MODULE)
post-build:
	@cd ${WRKSRC}/convertor && ${MAKE}

# The PHP includes are not easily detachable from the source tree in this
# release, so we extract the PHP sources with every module.
# This should improve in PHP 3.1 or 4.0.

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/php ${PREFIX}/bin/
	${INSTALL_PROGRAM} ${WRKSRC}/convertor/convertor \
		${PREFIX}/bin/php2convert
	${LN} -sf ${PREFIX}/bin/php ${PREFIX}/libexec/cgi-bin/php
	cd ${WRKSRC}/dbase && \
		${INSTALL_PROGRAM} dbfadd dbfcreat dbfdel dbfget dbflst \
			dbfndx dbfpack dbftst ${PREFIX}/bin/
	${INSTALL_SCRIPT} ${WRKSRC}/dbase/dbfscan ${PREFIX}/bin/
	${INSTALL_DATA_DIR} ${PREFIX}/lib/php3 ${PREFIX}/share/php3
	${INSTALL_DATA} ${WRKSRC}/extra/icons/* ${PREFIX}/share/php3/
	${INSTALL_DATA_DIR} ${PREFIX}/share/examples/php3
	${INSTALL_DATA} ${WRKSRC}/examples/README* ${WRKSRC}/examples/*.php3 \
		${PREFIX}/share/examples/php3/
	@${SED} s,@PREFIX@,${PREFIX}, ${FILESDIR}/php3.ini.example \
		> ${WRKDIR}/php3.ini.example
	${INSTALL_DATA} ${WRKDIR}/php3.ini.example ${PREFIX}/etc/
	@[ -f ${PREFIX}/etc/php3.ini ] || ${CP} ${PREFIX}/etc/php3.ini.example ${PREFIX}/etc/php3.ini
.endif
.endif

.include "../../mk/bsd.pkg.mk"