1 # |
|
2 # CDDL HEADER START |
|
3 # |
|
4 # The contents of this file are subject to the terms of the |
|
5 # Common Development and Distribution License (the "License"). |
|
6 # You may not use this file except in compliance with the License. |
|
7 # |
|
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 # or http://www.opensolaris.org/os/licensing. |
|
10 # See the License for the specific language governing permissions |
|
11 # and limitations under the License. |
|
12 # |
|
13 # When distributing Covered Code, include this CDDL HEADER in each |
|
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
15 # If applicable, add the following below this CDDL HEADER, with the |
|
16 # fields enclosed by brackets "[]" replaced with your own identifying |
|
17 # information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 # |
|
19 # CDDL HEADER END |
|
20 # |
|
21 # Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. |
|
22 # |
|
23 include ../../../make-rules/shared-macros.mk |
|
24 |
|
25 # NOTE: |
|
26 # Currently the version numbers in the package manifests, one |
|
27 # level up, are manually set because the COMPONENT_VERSION, like |
|
28 # below, is not available at the top level where this is IPS |
|
29 # published from. |
|
30 |
|
31 COMPONENT_NAME= php |
|
32 COMPONENT_VERSION= 5.3.29 |
|
33 COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION) |
|
34 COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.bz2 |
|
35 COMPONENT_ARCHIVE_HASH= \ |
|
36 sha256:c4e1cf6972b2a9c7f2777a18497d83bf713cdbecabb65d3ff62ba441aebb0091 |
|
37 COMPONENT_ARCHIVE_URL= http://us.php.net/get/$(COMPONENT_ARCHIVE)/from/this/mirror |
|
38 COMPONENT_PROJECT_URL= http://www.php.net/ |
|
39 |
|
40 # |
|
41 # php documentation |
|
42 COMPONENT_NAME_1= php_manual_en |
|
43 COMPONENT_VERSION_1= 20120717 |
|
44 COMPONENT_SRC_1= $(COMPONENT_NAME_1)_$(COMPONENT_VERSION_1) |
|
45 COMPONENT_ARCHIVE_1= $(COMPONENT_SRC_1).tar.gz |
|
46 COMPONENT_ARCHIVE_HASH_1= \ |
|
47 sha256:4c5d45e5f49bb164d40154fdef57b3193e7b77e306055559e60615c8ca9a3c30 |
|
48 COMPONENT_POST_UNPACK_ACTION_1= $(MV) php-chunked-xhtml $(@D) |
|
49 # |
|
50 # This next download URL is completely hocus pocus. |
|
51 # php.net does not freeze their documentation to match the software versions. |
|
52 # So we need to take a snapshot of PHP's documentation by downloading what |
|
53 # they currently have from this URL: |
|
54 # COMPONENT_ARCHIVE_URL_1=http://us.php.net/get/php_manual_en.tar.gz/from/this/mirror |
|
55 # Then move that download to the name being constructed in the variables |
|
56 # above. Finally, forward a copy to the gatekeeping staff to place |
|
57 # the copy in userland's download cache so that the following download URL |
|
58 # will pick it up. |
|
59 COMPONENT_ARCHIVE_URL_1=http://us.php.net/get/$(COMPONENT_ARCHIVE_1)/from/this/mirror |
|
60 |
|
61 include ./php.mk |
|
62 |
|
63 |
|
64 include $(WS_MAKE_RULES)/prep.mk |
|
65 include $(WS_MAKE_RULES)/configure.mk |
|
66 include $(WS_MAKE_RULES)/ips.mk |
|
67 |
|
68 include ../common.mk |
|
69 |
|
70 CONFIGURE_OPTIONS += \ |
|
71 $(COMMON_CONFIG_OPTIONS) \ |
|
72 --disable-cgi \ |
|
73 --disable-fastcgi \ |
|
74 --enable-discard-path \ |
|
75 --enable-ftp=shared \ |
|
76 --enable-pdo=shared \ |
|
77 --with-apxs2=$(APACHE_USR_PREFIX)/bin/apxs \ |
|
78 --with-bz2=shared \ |
|
79 --with-config-file-path=$(CONF_DIR) \ |
|
80 --with-config-file-scan-dir=$(MODULES_CONF_DIR) \ |
|
81 --with-curl=shared \ |
|
82 --with-curlwrappers \ |
|
83 --with-gd=shared \ |
|
84 --with-gettext=shared \ |
|
85 --with-iconv=shared \ |
|
86 --with-imap=shared,$(IMAP_DIR) \ |
|
87 --with-imap-ssl=shared,/usr \ |
|
88 --with-ldap=shared \ |
|
89 --with-mysql=shared,mysqlnd \ |
|
90 --with-mysql-sock=/tmp/mysql.sock \ |
|
91 --with-mysqli=shared,mysqlnd \ |
|
92 --with-openssl=shared \ |
|
93 --with-pear=$(PEAR_DIR) \ |
|
94 --with-pdo-mysql=shared,mysqlnd \ |
|
95 --with-pdo-sqlite=shared \ |
|
96 --with-snmp=shared,/usr \ |
|
97 --with-sqlite=shared \ |
|
98 --with-tidy=shared,/usr \ |
|
99 --without-tsrm-pthreads \ |
|
100 $(SOLARIS_OPENLDAP) |
|
101 |
|
102 CONFIGURE_ENV += $(CONF_ENVLINE) |
|
103 |
|
104 COMPONENT_POST_BUILD_ACTION = ( \ |
|
105 set -e; \ |
|
106 cat $(BUILD_DIR_32)/scripts/phpize | \ |
|
107 sed -e "s,^\#!/bin/sh,\#!$(CONFIG_SHELL)," | \ |
|
108 sed -e "s%^prefix=.*%prefix=$(BUILD_DIR_32)%" | \ |
|
109 sed -e "s%^includedir=.*%includedir=$(BUILD_DIR_32)%" | \ |
|
110 sed -e "s%^phpdir=.*%phpdir=$(BUILD_DIR_32)%" | \ |
|
111 sed -e "s%phpdir/phpize.m4%phpdir/scripts/phpize.m4%" | \ |
|
112 sed -e "s%$PHP_AUTOCONF || exit 1%$PHP_AUTOCONF -f || exit 1%" | \ |
|
113 sed -e "s%$PHP_AUTOHEADER || exit 1%$PHP_AUTOHEADER -f || exit 1%" | \ |
|
114 sed -e 's%(cd "$$phpdir" && cp $$FILES_BUILD "$$builddir"/build)%(cd "$$phpdir/build" \&\& cp $$FILES_BUILD "$$builddir"/build)%' | \ |
|
115 sed -e "s%^builddir=.*%builddir=$(BUILD_DIR_32)%" \ |
|
116 > phpize-proto ; \ |
|
117 chmod 755 phpize-proto ) ; \ |
|
118 ( set -e; \ |
|
119 cat $(BUILD_DIR_32)/scripts/php-config | \ |
|
120 sed -e "s,^\#! /bin/sh,\#!$(CONFIG_SHELL)," | \ |
|
121 sed -e "s%^prefix=.*%prefix=$(BUILD_DIR_32)%" | \ |
|
122 sed -e "s%^include_dir=.*%include_dir=$(BUILD_DIR_32)%" \ |
|
123 > php-config-proto ; \ |
|
124 chmod 755 php-config-proto ) ; \ |
|
125 ( set -e; \ |
|
126 cat $(BUILD_DIR_32)/scripts/php-config | \ |
|
127 sed -e "s,^\#! /bin/sh,\#!$(CONFIG_SHELL)," | \ |
|
128 sed -e "s%^prefix=.*%prefix=$(COMPONENT_DIR)/../php-nsapi/$(COMPONENT_SRC)%" | \ |
|
129 sed -e "s%^include_dir=.*%include_dir=$(COMPONENT_DIR)/../php-nsapi/$(COMPONENT_SRC)%" | \ |
|
130 sed -e "s%^extension_dir=.*%extension_dir=$(ZTS_MODULES_DIR)%" \ |
|
131 > php-config-proto.zts ; \ |
|
132 chmod 755 php-config-proto.zts ) |
|
133 |
|
134 ADD_APACHE2_MODULE_SUPPORT = ( \ |
|
135 set -e; \ |
|
136 $(MKDIR) $(PROTO_DIR)/$(APACHE2_PHP); \ |
|
137 $(INSTALL) -m 0644 $(COMPONENT_DIR)/../Solaris/php$(PHP_REL).conf \ |
|
138 $(PROTO_DIR)/$(APACHE2_PHP)/php$(PHP_REL).conf; \ |
|
139 $(GSED) -i -e "s@<<VERSION>>@$(PHP_REL)@g" \ |
|
140 $(PROTO_DIR)/$(APACHE2_PHP)/php$(PHP_REL).conf; \ |
|
141 $(SYMLINK) php$(PHP_REL).conf \ |
|
142 $(PROTO_DIR)/$(APACHE2_PHP)/php.conf; \ |
|
143 $(CP) $(PROTO_DIR)/$(APACHE2_EXTDIR)/libphp5.so \ |
|
144 $(PROTO_DIR)/$(APACHE2_EXTDIR)/mod_php$(PHP_REL).so; \ |
|
145 ) |
|
146 |
|
147 # Ship a default php.ini to simplify ease of use. |
|
148 # Replace the php.ini-production symlink with a copy of the real file because |
|
149 # gpatch no longer follows symlinks. |
|
150 FIX_CONFIG_FILES = ( \ |
|
151 set -e; \ |
|
152 cd $(BUILD_DIR_32); \ |
|
153 $(RM) php.ini-production; \ |
|
154 $(CP) $(SOURCE_DIR)/php.ini-production .; \ |
|
155 $(GPATCH) -p0 -o php.ini-patched -i ../../patches-other/php_ini.patch; \ |
|
156 $(GSED) -e "s@<<VERSION>>@$(PHP_REL)@g" < php.ini-patched > php.ini; \ |
|
157 $(INSTALL) -m 644 php.ini $(PROTO_DIR)/$(CONF_DIR)/php.ini; \ |
|
158 ) |
|
159 |
|
160 INSTALL_DOCS = ( \ |
|
161 set -e; \ |
|
162 $(MKDIR) $(PROTO_DIR)/$(DOCDIR); \ |
|
163 $(UNPACK) -r $(PROTO_DIR)/$(DOCDIR) $(COMPONENT_ARCHIVE_1); \ |
|
164 ) |
|
165 |
|
166 INSTALL_SAMPLES = ( \ |
|
167 set -e; \ |
|
168 $(MKDIR) $(PROTO_DIR)/$(SCRIPTS_DIR); \ |
|
169 $(MKDIR) $(COMPONENT_DIR)/tmp; \ |
|
170 cd $(COMPONENT_DIR); \ |
|
171 $(GSED) -e "s,\<\<INSTALL_DIR\>\>,$(PHP_ROOT)," \ |
|
172 -e "s,\<\<CONF_DIR\>\>,$(CONFDIR)," \ |
|
173 -e "s,\<\<NSAPI_CONF_DIR\>\>,$(NSAPI_CONFDIR)," \ |
|
174 -e "s,\<\<MODULES_CONF_DIR\>\>,$(MODULES_CONFDIR)," \ |
|
175 -e "s,\<\<ZTS_MODULES_CONF_DIR\>\>,$(ZTS_MODULES_CONFDIR)," \ |
|
176 < $(COMPONENT_DIR)/../Solaris/configure-sun-webserver \ |
|
177 > tmp/tmp; \ |
|
178 $(INSTALL) -m 555 tmp/tmp \ |
|
179 $(PROTO_DIR)/$(SCRIPTS_DIR)/configure-sun-webserver; \ |
|
180 cd $(PROTO_DIR)/$(PHP_BIN); \ |
|
181 $(RM) configure-webserver7; \ |
|
182 $(SYMLINK) ../samples/scripts/configure-sun-webserver \ |
|
183 configure-webserver7; \ |
|
184 ) |
|
185 |
|
186 # patch installation to support pear installation. |
|
187 PATCH_PEAR = ( \ |
|
188 set -e; \ |
|
189 cd $(PROTO_DIR)/$(PHP_BIN); \ |
|
190 $(GPATCH) -N -i $(COMPONENT_DIR)/patches-other/pear_pecl.patch; \ |
|
191 $(GPATCH) -N -i $(COMPONENT_DIR)/patches-other/pear_php_config.patch; \ |
|
192 cd $(PROTO_DIR)/$(PHP_LIB)/build; \ |
|
193 $(GPATCH) -N -i $(COMPONENT_DIR)/patches-other/pear_Makefile_global.patch; \ |
|
194 cd $(PROTO_DIR)/$(PEAR_DIR); \ |
|
195 $(GPATCH) -N -p0 -i $(COMPONENT_DIR)/patches-other/pear_Builder_php.patch; \ |
|
196 $(CP) $(COMPONENT_DIR)/config/pear/*.reg \ |
|
197 $(PROTO_DIR)/$(PEAR_DIR)/.channels/; \ |
|
198 ) |
|
199 |
|
200 # Create symbolic links |
|
201 # Not strictly necessary but makes the proto area more correct. |
|
202 CREATE_SYMLINKS = ( \ |
|
203 set -e; \ |
|
204 cd $(PROTO_DIR)/usr/php; \ |
|
205 $(RM) bin lib include modules doc man; \ |
|
206 $(SYMLINK) $(PHP_REL)/bin . ; \ |
|
207 $(SYMLINK) $(PHP_REL)/lib . ; \ |
|
208 $(SYMLINK) $(PHP_REL)/include . ; \ |
|
209 $(SYMLINK) $(PHP_REL)/modules . ; \ |
|
210 $(SYMLINK) $(PHP_REL)/doc . ; \ |
|
211 $(SYMLINK) $(PHP_REL)/man . ; \ |
|
212 $(MKDIR) $(PROTO_DIR)/usr/bin; \ |
|
213 cd $(PROTO_DIR)/usr/bin; \ |
|
214 $(RM) php php-config phpize; \ |
|
215 $(SYMLINK) ../php/$(PHP_REL)/bin/php . ; \ |
|
216 $(SYMLINK) ../php/$(PHP_REL)/bin/php-config . ; \ |
|
217 $(SYMLINK) ../php/$(PHP_REL)/bin/phpize . ; \ |
|
218 $(SYMLINK) ../php/$(PHP_REL)/bin/phar . ; \ |
|
219 ) |
|
220 |
|
221 COMPONENT_POST_INSTALL_ACTION = ( \ |
|
222 set -e; \ |
|
223 $(ADD_APACHE2_MODULE_SUPPORT); \ |
|
224 $(FIX_CONFIG_FILES); \ |
|
225 $(FIX_CONFIG_FILES_2); \ |
|
226 $(INSTALL_DOCS); \ |
|
227 $(INSTALL_SAMPLES); \ |
|
228 $(PATCH_PEAR); \ |
|
229 $(CREATE_SYMLINKS); \ |
|
230 ) |
|
231 |
|
232 # This package contains all 3 versions of php: |
|
233 # sapi, cgi, nsapi |
|
234 PKG_PROTO_DIRS += $(COMPONENT_DIR)/../php-nsapi/build/prototype/$(MACH) |
|
235 PKG_PROTO_DIRS += $(COMPONENT_DIR)/../php-cgi/build/prototype/$(MACH) |
|
236 |
|
237 CLEAN_PATHS += phpize-proto php-config-proto php-config-proto.zts tmp |
|
238 CLEAN_PATHS += php.ini-patched |
|
239 |
|
240 # Test results not quite stable but good enough for human eyes |
|
241 $(SKIP_TEST_AT_TOP_LEVEL) |
|
242 |
|
243 configure: $(CONFIGURE_32) |
|
244 |
|
245 build: $(BUILD_32) |
|
246 |
|
247 install: $(INSTALL_32) PHP-NSAPI_INSTALL PHP-CGI_INSTALL |
|
248 |
|
249 # Besides running this test target it is also strongly advised to download |
|
250 # and test with: |
|
251 # Joomla! http://www.joomla.org/ |
|
252 # WordPress http://wordpress.org/ |
|
253 |
|
254 # These test and compare results are not quite stable enough |
|
255 # to use in automated testing but good enough to eye |
|
256 # ball and get a sense that php is working correctly. |
|
257 # Individual tests can be run afterwards. |
|
258 # Several random tests may PASS/FAIL on each run thus invalidating |
|
259 # test and compare results. |
|
260 # To use the master test result file do: |
|
261 # $ gmake build |
|
262 # $ gmake -i -k test |
|
263 # because very likely the comparison phase will fail. |
|
264 |
|
265 # test failures; keep going |
|
266 COMPONENT_TEST_ARGS += -k -i |
|
267 |
|
268 # different results for different architectures |
|
269 COMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-$(MACH$(BITS)).master |
|
270 |
|
271 test: $(TEST_32) |
|
272 |
|
273 system-test: $(SYSTEM_TESTS_NOT_IMPLEMENTED) |
|
274 |
|
275 ../imap/build/$(MACH32)/.built: |
|
276 (cd ../imap ; $(MAKE) build) |
|
277 |
|
278 ../php-nsapi/build/$(MACH32)/.installed: |
|
279 (cd ../php-nsapi ; $(MAKE) install) |
|
280 |
|
281 ../php-cgi/build/$(MACH32)/.installed: |
|
282 (cd ../php-cgi ; $(MAKE) install) |
|
283 |
|
284 $(BUILD_DIR_32)/.configured: ../imap/build/$(MACH32)/.built |
|
285 PHP-NSAPI_INSTALL: ../php-nsapi/build/$(MACH32)/.installed |
|
286 PHP-CGI_INSTALL: ../php-cgi/build/$(MACH32)/.installed |
|