1
|
# Created by: Alex Dupre <ale@FreeBSD.org>
|
2
|
# $FreeBSD: head/lang/php55/Makefile 352743 2014-05-01 10:36:34Z ale $
|
3
|
|
4
|
PORTNAME= php55
|
5
|
PORTVERSION= 5.5.12
|
6
|
PORTREVISION?= 0
|
7
|
CATEGORIES?= lang devel www
|
8
|
MASTER_SITES= ${MASTER_SITE_PHP}
|
9
|
MASTER_SITE_SUBDIR= distributions
|
10
|
DISTNAME= php-${PORTVERSION}
|
11
|
|
12
|
MAINTAINER= ale@FreeBSD.org
|
13
|
COMMENT= PHP Scripting Language
|
14
|
|
15
|
LICENSE= PHP301
|
16
|
|
17
|
LATEST_LINK= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
|
18
|
|
19
|
USES= tar:bzip2
|
20
|
NO_OPTIONS_SORT=yes
|
21
|
.if !defined(PKGNAMESUFFIX)
|
22
|
USE_AUTOTOOLS= autoconf
|
23
|
|
24
|
LIB_DEPENDS= libpcre.so:${PORTSDIR}/devel/pcre
|
25
|
|
26
|
CONFIGURE_ARGS+=--with-layout=GNU \
|
27
|
--localstatedir=/var \
|
28
|
--with-config-file-scan-dir=${PREFIX}/etc/php \
|
29
|
--disable-all \
|
30
|
--enable-libxml \
|
31
|
--enable-mysqlnd \
|
32
|
--with-libxml-dir=${LOCALBASE} \
|
33
|
--with-pcre-regex=${LOCALBASE} \
|
34
|
--with-zlib-dir=/usr \
|
35
|
--program-prefix=""
|
36
|
|
37
|
USE_GNOME= libxml2
|
38
|
|
39
|
OPTIONS_DEFINE+=CLI CGI FPM EMBED DEBUG DTRACE IPV6 MAILHEAD LINKTHR ZTS
|
40
|
OPTIONS_DEFAULT=CLI CGI FPM IPV6 LINKTHR
|
41
|
OPTIONS_SUB= yes
|
42
|
|
43
|
CLI_DESC= Build CLI version
|
44
|
CGI_DESC= Build CGI version
|
45
|
FPM_DESC= Build FPM version
|
46
|
EMBED_DESC= Build embedded library
|
47
|
DEBUG_DESC= Enable debug
|
48
|
DTRACE_DESC= Enable DTrace support
|
49
|
IPV6_DESC= Enable ipv6 support
|
50
|
MAILHEAD_DESC= Enable mail header patch
|
51
|
LINKTHR_DESC= Link thread lib (for threaded extensions)
|
52
|
ZTS_DESC= Force Zend Thread Safety (ZTS) build
|
53
|
|
54
|
CONFLICTS= php53-5* php54-5* php5-5*
|
55
|
|
56
|
DESTDIRNAME= INSTALL_ROOT
|
57
|
|
58
|
.include <bsd.port.pre.mk>
|
59
|
|
60
|
PATCH_DIST_STRIP= -p1
|
61
|
|
62
|
PATCH_SITES+= ${MASTER_SITE_LOCAL}
|
63
|
PATCH_SITE_SUBDIR= ale
|
64
|
|
65
|
.if ${PORT_OPTIONS:MMAILHEAD}
|
66
|
PATCHFILES+= php-5.5.x-mail-header.patch:mail
|
67
|
PATCH_SITES+= http://choon.net/opensource/php/:mail
|
68
|
.endif
|
69
|
|
70
|
.if ${PORT_OPTIONS:MCLI}
|
71
|
PHP_SAPI+= cli
|
72
|
.else
|
73
|
CONFIGURE_ARGS+=--disable-cli
|
74
|
.endif
|
75
|
|
76
|
.if ${PORT_OPTIONS:MCGI}
|
77
|
PHP_SAPI+= cgi
|
78
|
.else
|
79
|
CONFIGURE_ARGS+=--disable-cgi
|
80
|
.endif
|
81
|
|
82
|
.if ${PORT_OPTIONS:MFPM}
|
83
|
PHP_SAPI+= fpm
|
84
|
USE_RC_SUBR+= php-fpm
|
85
|
CONFIGURE_ARGS+=--enable-fpm \
|
86
|
--with-fpm-user=${WWWOWN} \
|
87
|
--with-fpm-group=${WWWGRP}
|
88
|
.endif
|
89
|
|
90
|
.if defined(OPTIONS_FILE_SET) && ${OPTIONS_FILE_SET:MAPACHE}
|
91
|
IGNORE= doesn't install the Apache module anymore:\
|
92
|
update your OPTIONS and build www/mod_php55 port instead
|
93
|
.endif
|
94
|
|
95
|
.if defined(PKGNAMEPREFIX)
|
96
|
USE_PHP= yes
|
97
|
PHP_DEFAULT= 5.5
|
98
|
IGNORE_WITH_PHP=53 54 5
|
99
|
USE_APACHE= 22+
|
100
|
.include "${PORTSDIR}/Mk/bsd.apache.mk"
|
101
|
.if ${PORT_OPTIONS:MAP2FILTER}
|
102
|
CONFIGURE_ARGS+=--with-apxs2filter=${APXS}
|
103
|
.else
|
104
|
CONFIGURE_ARGS+=--with-apxs2=${APXS}
|
105
|
.endif
|
106
|
PLIST= ${PKGDIR}/pkg-plist.mod
|
107
|
PKGMESSAGE= ${PKGDIR}/pkg-message.mod
|
108
|
MODULENAME= libphp5
|
109
|
SHORTMODNAME= php5
|
110
|
WARNING= "!!! If you have a threaded Apache, you must build ${PHP_PORT} with ZTS support to enable thread-safety in extensions !!!"
|
111
|
.endif
|
112
|
|
113
|
.if ${PORT_OPTIONS:MEMBED}
|
114
|
PHP_SAPI+= embed
|
115
|
CONFIGURE_ARGS+=--enable-embed
|
116
|
.endif
|
117
|
|
118
|
.if ${PORT_OPTIONS:MCLI} || ${PORT_OPTIONS:MEMBED}
|
119
|
PLIST_SUB+= SAPI_INC=""
|
120
|
.else
|
121
|
PLIST_SUB+= SAPI_INC="@comment "
|
122
|
.endif
|
123
|
|
124
|
.if !defined(WITH_REGEX_TYPE) || ${WITH_REGEX_TYPE} == "php"
|
125
|
CONFIGURE_ARGS+=--with-regex=php
|
126
|
.elif defined(WITH_REGEX_TYPE) && ${WITH_REGEX_TYPE} == "system"
|
127
|
CONFIGURE_ARGS+=--with-regex=system
|
128
|
.endif
|
129
|
|
130
|
.if !defined(WITH_ZEND_VM) || ${WITH_ZEND_VM} == "CALL"
|
131
|
CONFIGURE_ARGS+=--with-zend-vm=CALL
|
132
|
.elif defined(WITH_ZEND_VM) && ${WITH_ZEND_VM} == "SWITCH"
|
133
|
CONFIGURE_ARGS+=--with-zend-vm=SWITCH
|
134
|
.elif defined(WITH_ZEND_VM) && ${WITH_ZEND_VM} == "GOTO"
|
135
|
CONFIGURE_ARGS+=--with-zend-vm=GOTO
|
136
|
.endif
|
137
|
|
138
|
CONFIGURE_ENV+= ac_cv_pthreads_lib="" \
|
139
|
ac_cv_pthreads_cflags="" \
|
140
|
pthreads_working="yes" \
|
141
|
lt_cv_path_SED="sed"
|
142
|
|
143
|
.if ${PORT_OPTIONS:MLINKTHR}
|
144
|
CONFIGURE_ENV+= LIBS="${LIBS} ${PTHREAD_LIBS}"
|
145
|
.endif
|
146
|
|
147
|
.if ${PORT_OPTIONS:MDEBUG}
|
148
|
CONFIGURE_ARGS+=--enable-debug
|
149
|
.endif
|
150
|
|
151
|
.if ${PORT_OPTIONS:MZTS}
|
152
|
CONFIGURE_ARGS+=--enable-maintainer-zts
|
153
|
.endif
|
154
|
|
155
|
.if ${PORT_OPTIONS:MDTRACE}
|
156
|
.if ${OSVERSION} < 900000
|
157
|
IGNORE= cannot be built with DTrace support on FreeBSD < 9.x
|
158
|
.endif
|
159
|
CONFIGURE_ARGS+=--enable-dtrace
|
160
|
.endif
|
161
|
|
162
|
.if empty(PORT_OPTIONS:MIPV6)
|
163
|
CONFIGURE_ARGS+=--disable-ipv6
|
164
|
.endif
|
165
|
|
166
|
post-patch:
|
167
|
@${TOUCH} ${WRKSRC}/ext/php_config.h
|
168
|
@${REINPLACE_CMD} "s|^\(extension_dir\)|; \1|" ${WRKSRC}/php.ini-*
|
169
|
.if ${PORT_OPTIONS:MFPM}
|
170
|
@${REINPLACE_CMD} -e "s|^;\(pid\)|\1|;s|^;\(pm\.[a-z_]*_servers\)|\1|" \
|
171
|
${WRKSRC}/sapi/fpm/php-fpm.conf.in
|
172
|
.endif
|
173
|
|
174
|
# Work around issues with newer (>=2.64) autoconf
|
175
|
pre-configure:
|
176
|
@${REINPLACE_CMD} -E 's:^((m4_)?divert)[(]([0-9]*)[)]:\1(600\3):' \
|
177
|
${WRKSRC}/configure.in `${FIND} ${WRKSRC} -name '*.m4'`
|
178
|
@${RM} ${WRKSRC}/configure
|
179
|
@${CAT} ${WRKSRC}/acinclude.m4 ${WRKSRC}/build/libtool.m4 > ${WRKSRC}/aclocal.m4
|
180
|
|
181
|
.if !defined(PKGNAMEPREFIX)
|
182
|
post-build:
|
183
|
@${ECHO_CMD} "PHP_VER=55" > ${WRKDIR}/php.conf
|
184
|
@${ECHO_CMD} "PHP_VERSION=${PORTVERSION}" >> ${WRKDIR}/php.conf
|
185
|
@${ECHO_CMD} "PHP_SAPI=${PHP_SAPI}" >> ${WRKDIR}/php.conf
|
186
|
@${ECHO_CMD} "PHP_EXT_INC=pcre spl" >> ${WRKDIR}/php.conf
|
187
|
|
188
|
test: build
|
189
|
@(cd ${WRKSRC} && ${MAKE} test)
|
190
|
|
191
|
post-install:
|
192
|
@${INSTALL_DATA} ${WRKSRC}/php.ini-development ${WRKSRC}/php.ini-production \
|
193
|
${WRKDIR}/php.conf ${STAGEDIR}/${PREFIX}/etc
|
194
|
.else
|
195
|
do-install:
|
196
|
${MKDIR} ${STAGEDIR}${PREFIX}/${APACHEMODDIR}
|
197
|
${INSTALL_LIB} ${WRKSRC}/libs/${MODULENAME}.so \
|
198
|
${STAGEDIR}${PREFIX}/${APACHEMODDIR}
|
199
|
.endif
|
200
|
|
201
|
.else
|
202
|
.include "${MASTERDIR}/Makefile.ext"
|
203
|
.endif
|
204
|
.include <bsd.port.post.mk>
|