pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang Clean up php's framework.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a8e00352eabd
branches:  trunk
changeset: 621995:a8e00352eabd
user:      taca <taca%pkgsrc.org@localhost>
date:      Sun Jul 21 17:29:47 2013 +0000

description:
Clean up php's framework.

* Define PHP's version at one place.
* Remove obsolete description in comments.
* Add "used by www/php-fpm/Makefile" in php5[34]/Makefile.php.
* Remove commented out support for suhosin extension from php54.
* Add PHP_CHECK_INSTALLED and PHP_EXTENSION_DIR to php/phpversion.mk.

No functional should be made.

diffstat:

 lang/php/common.mk         |  24 ++++++++++++++++++++++++
 lang/php/ext.mk            |   6 +++++-
 lang/php/phpversion.mk     |  40 +++++++++++++++++++++++++++++++++-------
 lang/php53/Makefile.common |  37 ++++++-------------------------------
 lang/php53/Makefile.php    |  11 +++--------
 lang/php54/MESSAGE.suhosin |   7 -------
 lang/php54/Makefile.common |  45 ++++++---------------------------------------
 lang/php54/Makefile.php    |  32 +++++---------------------------
 lang/php54/PLIST           |   5 +----
 9 files changed, 83 insertions(+), 124 deletions(-)

diffs (truncated from 409 to 300 lines):

diff -r 26e25fbb12b6 -r a8e00352eabd lang/php/common.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/php/common.mk        Sun Jul 21 17:29:47 2013 +0000
@@ -0,0 +1,24 @@
+# $NetBSD: common.mk,v 1.1 2013/07/21 17:29:47 taca Exp $
+# used by lang/php53/Makefile.common
+# used by lang/php54/Makefile.common
+# 
+.if !defined(PHPCOMMON_MK)
+PHPCOMMON_MK=  defined
+
+DISTNAME?=             php-${PHP_BASE_VERS}
+
+.if !defined(PECL_VERSION)
+MASTER_SITES?=         http://www.php.net/distributions/ \
+                       http://uk.php.net/distributions/ \
+                       http://de.php.net/distributions/ \
+                       http://us.php.net/distributions/
+EXTRACT_SUFX?=         .tar.bz2
+.endif
+
+HOMEPAGE?=             http://www.php.net/
+
+PLIST_SUBST+=          PHP_EXTENSION_DIR=${PHP_EXTENSION_DIR}
+PKG_SYSCONFVAR?=       php
+
+.include "../../lang/php/phpversion.mk"
+.endif # PHPCOMMON_MK
diff -r 26e25fbb12b6 -r a8e00352eabd lang/php/ext.mk
--- a/lang/php/ext.mk   Sun Jul 21 17:28:12 2013 +0000
+++ b/lang/php/ext.mk   Sun Jul 21 17:29:47 2013 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: ext.mk,v 1.29 2012/08/17 15:38:19 taca Exp $
+# $NetBSD: ext.mk,v 1.30 2013/07/21 17:29:47 taca Exp $
 #
 # PHP extension package framework, for both PECL and bundled PHP extensions.
 #
@@ -21,7 +21,9 @@
 
 .include "../../lang/php/phpversion.mk"
 
+.if defined(PHPPKGSRCDIR)
 .include "${PHPPKGSRCDIR}/Makefile.common"
+.endif
 
 PKGMODNAME?=           ${MODNAME:S/-/_/}
 PHPSETUPSUBDIR?=       #empty
@@ -112,6 +114,8 @@
        done || ${TRUE}
 .endif
 
+.if defined(PHPPKGSRCDIR)
 .include "${PHPPKGSRCDIR}/buildlink3.mk"
+.endif
 
 .endif # PHPEXT_MK
diff -r 26e25fbb12b6 -r a8e00352eabd lang/php/phpversion.mk
--- a/lang/php/phpversion.mk    Sun Jul 21 17:28:12 2013 +0000
+++ b/lang/php/phpversion.mk    Sun Jul 21 17:29:47 2013 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: phpversion.mk,v 1.36 2013/07/12 00:09:14 taca Exp $
+# $NetBSD: phpversion.mk,v 1.37 2013/07/21 17:29:47 taca Exp $
 #
 # This file selects a PHP version, based on the user's preferences and
 # the installed packages. It does not add a dependency on the PHP
@@ -30,6 +30,13 @@
 #      Possible: 53 54
 #      Default: 54 53
 #
+# PHP_CHECK_INSTALLED
+#      Check installed version of PHP.  Should be used lang/php53,
+#      and lang/php54 only.
+#
+#      Possible: Yes No
+#      Default: Yes
+#
 # === Variables defined by this file ===
 #
 # PKG_PHP_VERSION
@@ -61,12 +68,28 @@
 #
 #      Example: php53, php54
 #
+# PHP_EXTENSION_DIR
+#      Relative path to ${PREFIX} for PHP's extensions.  It is derived from
+#      initial release of major version.
+#
+#      Example: lib/php/20090630
+#
 # Keywords: php
 #
 
 .if !defined(PHPVERSION_MK)
 PHPVERSION_MK= defined
 
+# Define each PHP's version.
+PHP53_VERSION= 5.3.27
+PHP54_VERSION= 5.4.17
+PHP55_VERSION= 5.5.1
+
+# Define initial release of major version.
+PHP53_RELDATE= 20090630
+PHP54_RELDATE= 20120301
+PHP55_RELDATE= 20130620
+
 _VARGROUPS+=   php
 _USER_VARS.php=        PHP_VERSION_DEFAULT
 _PKG_VARS.php= PHP_VERSIONS_ACCEPTED PHP_VERSION_REQD
@@ -75,9 +98,6 @@
 
 .include "../../mk/bsd.prefs.mk"
 
-PHP53_VERSION=                 5.3.27
-PHP54_VERSION=                 5.4.17
-
 PHP_VERSION_DEFAULT?=          54
 PHP_VERSIONS_ACCEPTED?=                54 53
 
@@ -135,15 +155,19 @@
 
 # export some of internal variables
 PKG_PHP_VERSION:=      ${_PHP_VERSION:C/\.[0-9]//}
-PKG_PHP:=              PHP${_PHP_VERSION:C/([0-9])([0-9])/\1.\2/}
+PKG_PHP:=              php-${_PHP_VERSION:C/([0-9])([0-9])/\1.\2/}
 
 # currently we have only PHP 5.x packages.
 PKG_PHP_MAJOR_VERS:=   5
 
+PHP_CHECK_INSTALLED?=  Yes
+
 # if installed PHP isn't compatible with required PHP, bail out
+.if !empty(PHP_CHECK_INSTALLED:M[nN][oO])
 .if defined(_PHP_INSTALLED) && !defined(_PHP_VERSION_${_PHP_VERSION}_INSTALLED)
 PKG_SKIP_REASON+=      "Package accepts ${PKG_PHP}, but different version is installed"
 .endif
+.endif
 
 MESSAGE_SUBST+=                PKG_PHP_VERSION=${PKG_PHP_VERSION} \
                        PKG_PHP=${PKG_PHP}
@@ -161,10 +185,12 @@
 PHPPKGSRCDIR=          ../../lang/php53
 PHP_BASE_VERS=         ${PHP53_VERSION}
 PHP_PKG_PREFIX=                php53
+PHP_EXTENSION_DIR=     lib/php/${PHP53_RELDATE}
 .elif ${_PHP_VERSION} == "54"
 PHPPKGSRCDIR=          ../../lang/php54
 PHP_BASE_VERS=         ${PHP54_VERSION}
 PHP_PKG_PREFIX=                php54
+PHP_EXTENSION_DIR=     lib/php/${PHP54_RELDATE}
 .else
 # force an error
 PKG_SKIP_REASON+=      "${PKG_PHP} is not a valid package"
@@ -173,8 +199,8 @@
 #
 # check installed version aginst required:
 #
-.if defined(_PHP_VERSION_INSTALLED)
-.if ${_PHP_VERSION} != ${_PHP_VERSION_INSTALLED}
+.if !empty(PHP_CHECK_INSTALLED:M[nN][oO])
+.if defined(_PHP_VERSION_INSTALLED) && ${_PHP_VERSION} != ${_PHP_VERSION_INSTALLED}
 PKG_SKIP_REASON+=      "${PKGBASE} requires ${PKG_PHP}, but php-${_PHP_VERSION_INSTALLED} is already installed."
 .endif
 .endif
diff -r 26e25fbb12b6 -r a8e00352eabd lang/php53/Makefile.common
--- a/lang/php53/Makefile.common        Sun Jul 21 17:28:12 2013 +0000
+++ b/lang/php53/Makefile.common        Sun Jul 21 17:29:47 2013 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.27 2013/07/12 00:07:04 taca Exp $
+# $NetBSD: Makefile.common,v 1.28 2013/07/21 17:29:47 taca Exp $
 # used by lang/php53/Makefile.php
 # used by lang/php/ext.mk
 # used by meta-pkgs/php53-extensions/Makefile
@@ -10,40 +10,15 @@
 # in the patch which can leave the option broken until an updated patch
 # is released.  When updating PHP please don't forget to update the
 # distnfo with the details of the suhosin patch as well.
-#
-# Check these packages when update to new release of PHP and consider to
-# reset PKG_REVISION:
-#
-#      databases/php-mysqlnd (not yet packaged)
-#      misc/php-intl
-#      textproc/php-enchant
-#
-# Since other PHP extensions are shared between www/php5, we can't reset
-# PKGREVSION.
-#
 
-.if !defined(DISTNAME)
-DISTNAME=              php-${PHP_BASE_VERS}
-.endif
-CATEGORIES+=           www
+PHP_VERSION_REQD=      53
+PHP_BASE_VERS=         ${PHP53_VERSION}
+PHP_CHECK_INSTALLED=   No
 
-.if !defined(PECL_VERSION)
-MASTER_SITES?=         http://www.php.net/distributions/ \
-                       http://uk.php.net/distributions/ \
-                       http://de.php.net/distributions/ \
-                       http://us.php.net/distributions/
-EXTRACT_SUFX?=         .tar.bz2
-.endif
+.include "../../lang/php/common.mk"
 
+CATEGORIES+=           www
 MAINTAINER?=           pkgsrc-users%NetBSD.org@localhost
-HOMEPAGE?=             http://www.php.net/
-
-PHP_BASE_VERS=         5.3.27
-
-PHP_EXTENSION_DIR=     lib/php/20090630
-PLIST_SUBST+=          PHP_EXTENSION_DIR=${PHP_EXTENSION_DIR}
-
-PKG_SYSCONFVAR?=       php
 
 # needed due to (broken?) configure checks in php-xmlrpc and php5-dom
 CONFIGURE_ENV+=                PHP_LIBXML_SHARED="1"
diff -r 26e25fbb12b6 -r a8e00352eabd lang/php53/Makefile.php
--- a/lang/php53/Makefile.php   Sun Jul 21 17:28:12 2013 +0000
+++ b/lang/php53/Makefile.php   Sun Jul 21 17:29:47 2013 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile.php,v 1.36 2013/07/15 02:02:24 ryoon Exp $
+# $NetBSD: Makefile.php,v 1.37 2013/07/21 17:29:47 taca Exp $
 # used by lang/php53/Makefile
 # used by www/ap-php/Makefile
+# used by www/php-fpm/Makefile
 
 .include "../../lang/php53/Makefile.common"
 
@@ -39,6 +40,7 @@
 CONFIGURE_ARGS+=       --enable-cgi
 CONFIGURE_ARGS+=       --enable-xml
 CONFIGURE_ARGS+=       --with-libxml-dir=${PREFIX}
+
 .include "../../textproc/libxml2/buildlink3.mk"
 
 # Note: This expression is the same as ${PKGBASE}, but the latter is
@@ -47,13 +49,6 @@
 PKG_SUPPORTED_OPTIONS+=        inet6 ssl maintainer-zts suhosin readline
 PKG_SUGGESTED_OPTIONS+=        inet6 ssl
 
-#SUBST_CLASSES+=               ini
-#SUBST_STAGE.ini=      post-patch
-#SUBST_FILES.ini=      php.ini-development
-#SUBST_FILES.ini+=     php.ini-production
-#SUBST_SED.ini=                -e "s|\\;include_path = \".:/php/includes\"|include_path = \".:${PREFIX}/lib/php\"|g"
-#SUBST_MESSAGE.ini=    Fixing default ini files.
-
 .include "../../mk/bsd.options.mk"
 
 .if !empty(PKG_OPTIONS:Msuhosin)
diff -r 26e25fbb12b6 -r a8e00352eabd lang/php54/MESSAGE.suhosin
--- a/lang/php54/MESSAGE.suhosin        Sun Jul 21 17:28:12 2013 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-===========================================================================
-$NetBSD: MESSAGE.suhosin,v 1.1 2012/06/16 05:21:55 taca Exp $
-
-As you have chosen to install the Suhosin patch you may also want to
-install the Suhosin extension which can be found in security/php-suhosin.
-
-===========================================================================
diff -r 26e25fbb12b6 -r a8e00352eabd lang/php54/Makefile.common
--- a/lang/php54/Makefile.common        Sun Jul 21 17:28:12 2013 +0000
+++ b/lang/php54/Makefile.common        Sun Jul 21 17:29:47 2013 +0000
@@ -1,49 +1,16 @@
-# $NetBSD: Makefile.common,v 1.14 2013/07/07 13:37:53 taca Exp $
+# $NetBSD: Makefile.common,v 1.15 2013/07/21 17:29:47 taca Exp $
 # used by lang/php54/Makefile.php
 # used by lang/php/ext.mk
 # used by meta-pkgs/php54-extensions/Makefile
 
-#
-# NOTE:
-# The suhosin option includes a patch from http://www.hardened-php.net/
-# Which tracks with the exact version number of PHP.  There may be a delay
-# in the patch which can leave the option broken until an updated patch
-# is released.  When updating PHP please don't forget to update the
-# distnfo with the details of the suhosin patch as well.
-#
-# Check these packages when update to new release of PHP and consider to
-# reset PKG_REVISION:
-#
-#      databases/php-mysqlnd (not yet packaged)
-#      misc/php-intl
-#      textproc/php-enchant
-#
-# Since other PHP extensions are shared between www/php5, we can't reset
-# PKGREVSION.
-#
+PHP_VERSION_REQD=      54
+PHP_BASE_VERS=         ${PHP54_VERSION}
+PHP_CHECK_INSTALLED=   No
 
-.if !defined(DISTNAME)
-DISTNAME=              php-${PHP_BASE_VERS}
-.endif
-CATEGORIES+=           www
+.include "../../lang/php/common.mk"



Home | Main Index | Thread Index | Old Index