Makefile revision 1022
904N/A#
904N/A# CDDL HEADER START
904N/A#
904N/A# The contents of this file are subject to the terms of the
904N/A# Common Development and Distribution License (the "License").
904N/A# You may not use this file except in compliance with the License.
904N/A#
904N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
904N/A# or http://www.opensolaris.org/os/licensing.
904N/A# See the License for the specific language governing permissions
904N/A# and limitations under the License.
904N/A#
904N/A# When distributing Covered Code, include this CDDL HEADER in each
904N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
904N/A# If applicable, add the following below this CDDL HEADER, with the
904N/A# fields enclosed by brackets "[]" replaced with your own identifying
904N/A# information: Portions Copyright [yyyy] [name of copyright owner]
904N/A#
904N/A# CDDL HEADER END
904N/A#
904N/A# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
904N/A#
904N/Ainclude ../../../make-rules/shared-macros.mk
904N/A
1022N/A# NOTE:
1022N/A# Currently the version numbers in the package manifests, one
1022N/A# level up, are manually set because the COMPONENT_VERSION, like
1022N/A# below, is not available at the top level where this is IPS
1022N/A# published from.
1022N/A
904N/ACOMPONENT_NAME= php
1022N/ACOMPONENT_VERSION= 5.3.14
904N/ACOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
904N/ACOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.bz2
904N/ACOMPONENT_ARCHIVE_HASH= \
1022N/A sha256:c8075b6e83c5db0d26cc8426a7456856421089a76c963813b1fcac3ced041cb3
904N/ACOMPONENT_ARCHIVE_URL= http://us.php.net/get/$(COMPONENT_ARCHIVE)/from/this/mirror
904N/ACOMPONENT_PROJECT_URL= http://www.php.net/
904N/A
904N/A#
904N/A# php documentation
1022N/ACOMPONENT_NAME_1= php_manual_en
1022N/ACOMPONENT_VERSION_1= 20120717
1022N/ACOMPONENT_SRC_1= $(COMPONENT_NAME_1)_$(COMPONENT_VERSION_1)
1022N/ACOMPONENT_ARCHIVE_1= $(COMPONENT_SRC_1).tar.gz
904N/ACOMPONENT_ARCHIVE_HASH_1= \
1022N/A sha256:4c5d45e5f49bb164d40154fdef57b3193e7b77e306055559e60615c8ca9a3c30
904N/A#
1022N/A# This next download URL is completely hocus pocus.
1022N/A# php.net does not freeze their documentation to match the software versions.
1022N/A# So we need to take a snapshot of PHP's documentation by downloading what
1022N/A# they currently have from this URL:
1022N/A# COMPONENT_ARCHIVE_URL_1=http://us.php.net/get/php_manual_en.tar.gz/from/this/mirror
1022N/A# Then move that download to the name being constructed in the variables
1022N/A# above. Finally, forward a copy to the gatekeeping staff to place
1022N/A# the copy in userland's download cache so that the following download URL
1022N/A# will pick it up.
1022N/ACOMPONENT_ARCHIVE_URL_1=http://us.php.net/get/$(COMPONENT_ARCHIVE_1)/from/this/mirror
904N/A
904N/Ainclude $(WS_TOP)/make-rules/prep.mk
904N/Ainclude $(WS_TOP)/make-rules/configure.mk
904N/Ainclude $(WS_TOP)/make-rules/ips.mk
904N/A
904N/Ainclude ../common.mk
904N/Ainclude ./php.mk
904N/A
904N/ACONFIGURE_OPTIONS += \
904N/A $(COMMON_CONFIG_OPTIONS) \
904N/A --disable-cgi \
904N/A --disable-fastcgi \
904N/A --enable-discard-path \
904N/A --enable-ftp=shared \
904N/A --enable-pdo=shared \
904N/A --with-apxs2=$(APACHE_USR_PREFIX)/bin/apxs \
904N/A --with-bz2=shared \
904N/A --with-config-file-path=$(CONF_DIR) \
904N/A --with-config-file-scan-dir=$(MODULES_CONF_DIR) \
904N/A --with-curl=shared \
904N/A --with-curlwrappers \
904N/A --with-gd=shared \
904N/A --with-gettext=shared \
904N/A --with-iconv=shared \
904N/A --with-imap=shared,$(IMAP_DIR) \
904N/A --with-imap-ssl=shared,/usr \
904N/A --with-ldap=shared \
904N/A --with-mysql=shared,$(MYSQL_DIR) \
904N/A --with-mysql-sock=/tmp/mysql.sock \
904N/A --with-mysqli=shared,$(MYSQL_DIR)/bin/mysql_config \
904N/A --with-openssl=shared \
904N/A --with-pear=$(PEAR_DIR) \
904N/A --with-pdo-mysql=shared,$(MYSQL_DIR) \
904N/A --with-pdo-sqlite=shared \
904N/A --with-snmp=shared,/usr \
904N/A --with-sqlite=shared \
904N/A --with-tidy=shared,/usr \
904N/A --without-tsrm-pthreads
904N/A
904N/ACONFIGURE_ENV += $(CONF_ENVLINE)
904N/A
904N/ACOMPONENT_POST_BUILD_ACTION = ( \
904N/A cat $(BUILD_DIR_32)/scripts/phpize | \
904N/A sed -e "s,^\#!/bin/sh,\#!$(CONFIG_SHELL)," | \
904N/A sed -e "s%^prefix=.*%prefix=$(SOURCE_DIR)%" | \
904N/A sed -e "s%^includedir=.*%includedir=$(SOURCE_DIR)%" | \
904N/A sed -e "s%^phpdir=.*%phpdir=$(SOURCE_DIR)%" | \
904N/A sed -e "s%phpdir/phpize.m4%phpdir/scripts/phpize.m4%" | \
904N/A sed -e "s%$PHP_AUTOCONF || exit 1%$PHP_AUTOCONF -f || exit 1%" | \
904N/A sed -e "s%$PHP_AUTOHEADER || exit 1%$PHP_AUTOHEADER -f || exit 1%" | \
904N/A sed -e 's%(cd "$$phpdir" && cp $$FILES_BUILD "$$builddir"/build)%(cd "$$phpdir/build" \&\& cp $$FILES_BUILD "$$builddir"/build)%' | \
904N/A sed -e "s%^builddir=.*%builddir=$(BUILD_DIR_32)%" \
904N/A > phpize-proto ; \
904N/A chmod 755 phpize-proto ) ; \
904N/A ( cat $(BUILD_DIR_32)/scripts/php-config | \
904N/A sed -e "s,^\#! /bin/sh,\#!$(CONFIG_SHELL)," | \
904N/A sed -e "s%^prefix=.*%prefix=$(SOURCE_DIR)%" | \
904N/A sed -e "s%^include_dir=.*%include_dir=$(SOURCE_DIR)%" \
904N/A > php-config-proto ; \
904N/A chmod 755 php-config-proto ) ; \
904N/A ( cat $(BUILD_DIR_32)/scripts/php-config | \
904N/A sed -e "s,^\#! /bin/sh,\#!$(CONFIG_SHELL)," | \
904N/A sed -e "s%^prefix=.*%prefix=$(COMPONENT_DIR)/../php-nsapi/$(COMPONENT_SRC)%" | \
904N/A sed -e "s%^include_dir=.*%include_dir=$(COMPONENT_DIR)/../php-nsapi/$(COMPONENT_SRC)%" | \
904N/A sed -e "s%^extension_dir=.*%extension_dir=$(ZTS_MODULES_DIR)%" \
904N/A > php-config-proto.zts ; \
904N/A chmod 755 php-config-proto.zts )
904N/A
904N/AADD_APACHE2_MODULE_SUPPORT = ( \
904N/A $(MKDIR) $(PROTO_DIR)/$(APACHE2_PHP); \
904N/A $(INSTALL) -m 0644 $(COMPONENT_DIR)/../Solaris/php$(PHP_REL).conf \
904N/A $(PROTO_DIR)/$(APACHE2_PHP)/php$(PHP_REL).conf; \
904N/A $(GSED) -i -e "s@<<VERSION>>@$(PHP_REL)@g" \
904N/A $(PROTO_DIR)/$(APACHE2_PHP)/php$(PHP_REL).conf; \
904N/A $(SYMLINK) php$(PHP_REL).conf \
904N/A $(PROTO_DIR)/$(APACHE2_PHP)/php.conf; \
904N/A $(CP) $(PROTO_DIR)/$(APACHE2_EXTDIR)/libphp5.so \
904N/A $(PROTO_DIR)/$(APACHE2_EXTDIR)/mod_php$(PHP_REL).so; \
904N/A )
904N/A
904N/A# Ship a default php.ini to simplify ease of use.
904N/AFIX_CONFIG_FILES = ( \
904N/A cd $(SOURCE_DIR); \
904N/A $(GPATCH) -p0 -o php.ini-patched -i ../patches-other/php_ini.patch; \
904N/A $(GSED) -e "s@<<VERSION>>@$(PHP_REL)@g" < php.ini-patched > php.ini; \
904N/A $(INSTALL) -m 644 php.ini $(PROTO_DIR)/$(CONF_DIR)/php.ini; \
904N/A )
904N/A
904N/AINSTALL_DOCS = ( \
904N/A $(MKDIR) $(PROTO_DIR)/$(DOCDIR); \
904N/A $(UNPACK) -r $(PROTO_DIR)/$(DOCDIR) $(COMPONENT_ARCHIVE_1); \
904N/A )
904N/A
904N/AINSTALL_SAMPLES = ( \
904N/A $(MKDIR) $(PROTO_DIR)/$(SCRIPTS_DIR); \
904N/A $(MKDIR) $(COMPONENT_DIR)/tmp; \
904N/A cd $(COMPONENT_DIR); \
904N/A $(GSED) -e "s,\<\<INSTALL_DIR\>\>,$(PHP_ROOT)," \
904N/A -e "s,\<\<CONF_DIR\>\>,$(CONFDIR)," \
904N/A -e "s,\<\<NSAPI_CONF_DIR\>\>,$(NSAPI_CONFDIR)," \
904N/A -e "s,\<\<MODULES_CONF_DIR\>\>,$(MODULES_CONFDIR)," \
904N/A -e "s,\<\<ZTS_MODULES_CONF_DIR\>\>,$(ZTS_MODULES_CONFDIR)," \
904N/A < $(COMPONENT_DIR)/../Solaris/configure-sun-webserver \
904N/A > tmp/tmp; \
904N/A $(INSTALL) -m 555 tmp/tmp \
904N/A $(PROTO_DIR)/$(SCRIPTS_DIR)/configure-sun-webserver; \
904N/A cd $(PROTO_DIR)/$(PHP_BIN); \
904N/A $(RM) configure-webserver7; \
904N/A $(SYMLINK) ../samples/scripts/configure-sun-webserver \
904N/A configure-webserver7; \
904N/A )
904N/A
904N/A# patch installation to support pear installation.
904N/APATCH_PEAR = ( \
904N/A cd $(PROTO_DIR)/$(PHP_BIN); \
904N/A $(GPATCH) -N -i $(COMPONENT_DIR)/patches-other/pear_pecl.patch; \
904N/A $(GPATCH) -N -i $(COMPONENT_DIR)/patches-other/pear_php_config.patch; \
904N/A cd $(PROTO_DIR)/$(PHP_LIB)/build; \
904N/A $(GPATCH) -N -i $(COMPONENT_DIR)/patches-other/pear_Makefile_global.patch; \
904N/A cd $(PROTO_DIR)/$(PEAR_DIR); \
904N/A $(GPATCH) -N -p0 -i $(COMPONENT_DIR)/patches-other/pear_Builder_php.patch; \
904N/A $(CP) $(COMPONENT_DIR)/config/pear/*.reg \
904N/A $(PROTO_DIR)/$(PEAR_DIR)/.channels/; \
904N/A )
904N/A
904N/A# Create symbolic links
904N/A# Not strictly necessary but makes the proto area more correct.
904N/ACREATE_SYMLINKS = ( \
904N/A cd $(PROTO_DIR)/usr/php; \
904N/A $(RM) bin lib include modules doc man; \
904N/A $(SYMLINK) $(PHP_REL)/bin . ; \
904N/A $(SYMLINK) $(PHP_REL)/lib . ; \
904N/A $(SYMLINK) $(PHP_REL)/include . ; \
904N/A $(SYMLINK) $(PHP_REL)/modules . ; \
904N/A $(SYMLINK) $(PHP_REL)/doc . ; \
904N/A $(SYMLINK) $(PHP_REL)/man . ; \
904N/A $(MKDIR) $(PROTO_DIR)/usr/bin; \
904N/A cd $(PROTO_DIR)/usr/bin; \
904N/A $(RM) php php-config phpize; \
904N/A $(SYMLINK) ../php/$(PHP_REL)/bin/php . ; \
904N/A $(SYMLINK) ../php/$(PHP_REL)/bin/php-config . ; \
904N/A $(SYMLINK) ../php/$(PHP_REL)/bin/phpize . ; \
904N/A $(SYMLINK) ../php/$(PHP_REL)/bin/phar . ; \
904N/A )
904N/A
904N/ACOMPONENT_POST_INSTALL_ACTION = ( \
904N/A $(ADD_APACHE2_MODULE_SUPPORT); \
904N/A $(FIX_CONFIG_FILES); \
904N/A $(FIX_CONFIG_FILES_2); \
904N/A $(INSTALL_DOCS); \
904N/A $(INSTALL_SAMPLES); \
904N/A $(PATCH_PEAR); \
904N/A $(CREATE_SYMLINKS); \
904N/A )
904N/A
904N/A# This package contains all 3 versions of php:
904N/A# sapi, cgi, nsapi
904N/APKG_PROTO_DIRS += $(COMPONENT_DIR)/../php-nsapi/build/prototype/$(MACH)
904N/APKG_PROTO_DIRS += $(COMPONENT_DIR)/../php-cgi/build/prototype/$(MACH)
904N/A
904N/ACLEAN_PATHS += phpize-proto php-config-proto php-config-proto.zts tmp
904N/ACLEAN_PATHS += php.ini-patched
904N/A
904N/A# common targets
904N/Abuild: $(BUILD_32)
904N/A
904N/Ainstall: $(INSTALL_32) PHP-NSAPI_INSTALL PHP-CGI_INSTALL
904N/A
1022N/A# Besides running this test target it is also strong advised to download
1022N/A# and test with:
1022N/A# Joomla! http://www.joomla.org/
1022N/A# WordPress http://wordpress.org/
904N/Atest: $(TEST_32)
904N/A
904N/A../imap/build/$(MACH32)/.built:
904N/A (cd ../imap ; $(MAKE) build)
904N/A
904N/A../php-nsapi/build/$(MACH32)/.installed:
904N/A (cd ../php-nsapi ; $(MAKE) install)
904N/A
904N/A../php-cgi/build/$(MACH32)/.installed:
904N/A (cd ../php-cgi ; $(MAKE) install)
904N/A
904N/A$(BUILD_DIR_32)/.configured: ../imap/build/$(MACH32)/.built
904N/APHP-NSAPI_INSTALL: ../php-nsapi/build/$(MACH32)/.installed
904N/APHP-CGI_INSTALL: ../php-cgi/build/$(MACH32)/.installed
904N/A
904N/ABUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
904N/A
904N/Ainclude $(WS_TOP)/make-rules/depend.mk