Latest PHP eclasses from the overlay
authorStuart Herbert <stuart@gentoo.org>
Thu, 8 Sep 2005 20:32:49 +0000 (20:32 +0000)
committerStuart Herbert <stuart@gentoo.org>
Thu, 8 Sep 2005 20:32:49 +0000 (20:32 +0000)
eclass/php4_4-sapi.eclass
eclass/php5_0-sapi.eclass
eclass/php5_1-sapi.eclass

index 139f130670cf289aca3391ad3350c7a5a69bcef9..a893b2bfacf887d9fb8e97650618017e8b198bec 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/php4_4-sapi.eclass,v 1.1 2005/09/04 10:54:53 stuart Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/php4_4-sapi.eclass,v 1.2 2005/09/08 20:32:49 stuart Exp $
 #
 # ########################################################################
 #
@@ -126,7 +126,8 @@ PHP_INI_FILE="php.ini"
 # the patch for different versions of PHP
 
 case "${PV}" in
-       4.4.0) HARDENEDPHP_PATCH="hardening-patch-${PV}-0.4.1.patch.gz" ;;
+       4.3.11) HARDENEDPHP_PATCH="hardening-patch-${PV}-0.4.2.patch.gz" ;;
+       4.4.0) HARDENEDPHP_PATCH="hardening-patch-${PV}-0.4.2.patch.gz" ;;
 esac
 
 [ -n "${HARDENEDPHP_PATCH}" ] && SRC_URI="${SRC_URI} hardenedphp? ( http://www.hardened-php.net/${HARDENEDPHP_PATCH} )"
@@ -183,6 +184,9 @@ php4_4-sapi_check_awkward_uses() {
        # Hardened-PHP doesn't work well with Apache; needs further investigation
        confutils_use_conflict "hardenedphp" "apache" "apache2"
 
+       # Hardened-PHP doesn't work with fastbuild enabled
+       confutils_use_conflict "hardenedphp" "fastbuild"
+
        # IMAP support
        php_check_imap
 
@@ -280,6 +284,15 @@ php4_4-sapi_src_unpack() {
        # fastbuild support
        use fastbuild && epatch ${FILESDIR}/4.4.0/fastbuild.patch
 
+       # run aclocal if hardenedphp is enabled, else rebuilding the configure dies
+       if use hardenedphp && [ -n "${HARDENEDPHP_PATCH}" ] ; then
+               # patch to support libtool 1.5
+               epatch ${FILESDIR}/4.4.0/php4-hphp-acinclude.patch
+               einfo "Running aclocal for hardenedphp"
+               WANT_AUTOMAKE=1.6 aclocal || die "Unable to run aclocal successfully"
+               libtoolize --copy --force || die "Unable to run libtoolize successfully"
+       fi
+
        # rebuild configure to make sure it's up to date
        einfo "Rebuilding configure script"
        WANT_AUTOCONF=2.5 autoconf -W no-cross || die "Unable to regenerate configure script"
@@ -551,11 +564,60 @@ php4_4-sapi_install_ini() {
 }
 
 php4_4-sapi_pkg_postinst() {
+       # Create the symlinks for php-cli
+       if useq cli ; then
+               if test -h "/usr/bin/php"; then
+                       ewarn "/usr/bin/php is a symlink."
+                       ewarn "The PHP packages will not update that symlink,"
+                       ewarn "please check it and do so yourself if you need"
+                       ewarn "to, using eselect."
+                       ewarn "For example with the command:"
+                       ewarn "eselect php set php4"
+                       ewarn "to symlink to /usr/lib/php4/bin/php."
+                       ewarn
+               else
+                       eselect php set php4
+               fi
+       fi
+
+       # Create the symlinks for php-cgi
+       if useq cgi ; then
+               if test -h "/usr/bin/php-cgi"; then
+                       ewarn "/usr/bin/php-cgi is a symlink."
+                       ewarn "The PHP packages will not update that symlink,"
+                       ewarn "please check it and do so yourself if you need"
+                       ewarn "to, using eselect."
+                       ewarn "For example with the command:"
+                       ewarn "eselect php-cgi set php4"
+                       ewarn "to symlink to /usr/lib/php4/bin/php-cgi."
+                       ewarn
+               else
+                       eselect php-cgi set php4
+               fi
+       fi
+
+       # Create the symlinks for php-devel
+       if test -h "/usr/bin/phpize" || test -h "/usr/bin/php-config" ; then
+               ewarn "/usr/bin/phpize and/or /usr/bin/php-config are symlinks."
+               ewarn "The PHP packages will not update these symlinks,"
+               ewarn "please check them and do so yourself if you need"
+               ewarn "to, using eselect."
+               ewarn "For example with the command:"
+               ewarn "eselect php-devel set php4"
+               ewarn "to symlink to /usr/lib/php4/bin/phpize and"
+               ewarn "/usr/lib/php4/bin/php-config."
+               ewarn
+       else
+               eselect php-devel set php4
+       fi
+
        ewarn "If you have additional third party PHP extensions (such as"
        ewarn "dev-php4/phpdbg) you may need to recompile them now."
+       ewarn
 
        if useq curl; then
                ewarn "Please be aware that CURL can allow the bypass of open_basedir restrictions."
                ewarn "This can be a security risk!"
+               ewarn
        fi
 }
index 181aa4fda8a0559d6d1056e2c9851d5d4c3dcd4a..0153217f2f7d1134e22b20b6a33f5a3a73fbe9c9 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/php5_0-sapi.eclass,v 1.1 2005/09/04 10:54:53 stuart Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/php5_0-sapi.eclass,v 1.2 2005/09/08 20:32:49 stuart Exp $
 #
 # ########################################################################
 #
@@ -126,6 +126,7 @@ PHP_INI_FILE="php.ini"
 
 case "${PV}" in
        5.0.4) HARDENEDPHP_PATCH="hardening-patch-${PV}-0.4.1.patch.gz" ;;
+       5.0.5) HARDENEDPHP_PATCH="hardening-patch-${PV}-0.4.2.patch.gz" ;;
 esac
 
 [ -n "${HARDENEDPHP_PATCH}" ] && SRC_URI="${SRC_URI} hardenedphp? ( http://www.hardened-php.net/${HARDENEDPHP_PATCH} )"
@@ -278,6 +279,15 @@ php5_0-sapi_src_unpack() {
                epatch ${FILESDIR}/5.1.0/php5-prefork.patch || die "Unable to patch for prefork support"
        fi
 
+       # run aclocal if hardenedphp is enabled, else rebuilding the configure dies
+       if use hardenedphp && [ -n "${HARDENEDPHP_PATCH}" ] ; then
+               # patch to support libtool 1.5
+               epatch ${FILESDIR}/5.0.0/php5-hphp-acinclude.patch
+               einfo "Running aclocal for hardenedphp"
+               WANT_AUTOMAKE=1.6 aclocal || die "Unable to run aclocal successfully"
+               libtoolize --copy --force || die "Unable to run libtoolize successfully"
+       fi
+
        # rebuild configure to make sure it's up to date
        einfo "Rebuilding configure script"
        WANT_AUTOCONF=2.5 autoconf -W no-cross || die "Unable to regenerate configure script"
@@ -547,11 +557,60 @@ php5_0-sapi_install_ini() {
 }
 
 php5_0-sapi_pkg_postinst() {
+       # Create the symlinks for php-cli
+       if useq cli ; then
+               if test -h "/usr/bin/php"; then
+                       ewarn "/usr/bin/php is a symlink."
+                       ewarn "The PHP packages will not update that symlink,"
+                       ewarn "please check it and do so yourself if you need"
+                       ewarn "to, using eselect."
+                       ewarn "For example with the command:"
+                       ewarn "eselect php set php5"
+                       ewarn "to symlink to /usr/lib/php5/bin/php."
+                       ewarn
+               else
+                       eselect php set php5
+               fi
+       fi
+
+       # Create the symlinks for php-cgi
+       if useq cgi ; then
+               if test -h "/usr/bin/php-cgi"; then
+                       ewarn "/usr/bin/php-cgi is a symlink."
+                       ewarn "The PHP packages will not update that symlink,"
+                       ewarn "please check it and do so yourself if you need"
+                       ewarn "to, using eselect."
+                       ewarn "For example with the command:"
+                       ewarn "eselect php-cgi set php5"
+                       ewarn "to symlink to /usr/lib/php5/bin/php-cgi."
+                       ewarn
+               else
+                       eselect php-cgi set php5
+               fi
+       fi
+
+       # Create the symlinks for php-devel
+       if test -h "/usr/bin/phpize" || test -h "/usr/bin/php-config" ; then
+               ewarn "/usr/bin/phpize and/or /usr/bin/php-config are symlinks."
+               ewarn "The PHP packages will not update these symlinks,"
+               ewarn "please check them and do so yourself if you need"
+               ewarn "to, using eselect."
+               ewarn "For example with the command:"
+               ewarn "eselect php-devel set php5"
+               ewarn "to symlink to /usr/lib/php5/bin/phpize and"
+               ewarn "/usr/lib/php5/bin/php-config."
+               ewarn
+       else
+               eselect php-devel set php5
+       fi
+
        ewarn "If you have additional third party PHP extensions (such as"
        ewarn "dev-php5/phpdbg) you may need to recompile them now."
+       ewarn
 
        if useq curl; then
                ewarn "Please be aware that CURL can allow the bypass of open_basedir restrictions."
                ewarn "This can be a security risk!"
+               ewarn
        fi
 }
index 51bd04cbda685f3d76f5e0441b0fde84fde2a99a..1cc83735d960a6963d69ecc9981ac64f61489640 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/php5_1-sapi.eclass,v 1.2 2005/09/04 15:15:37 swegener Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/php5_1-sapi.eclass,v 1.3 2005/09/08 20:32:49 stuart Exp $
 #
 # ########################################################################
 #
@@ -178,6 +178,9 @@ php5_1-sapi_check_awkward_uses() {
        # Hardened-PHP doesn't work well with Apache; needs further investigation
        confutils_use_conflict "hardenedphp" "apache" "apache2"
 
+       # Hardened-PHP doesn't work with fastbuild enabled
+       confutils_use_conflict "hardenedphp" "fastbuild"
+
        # IMAP support
        php_check_imap
 
@@ -289,6 +292,13 @@ php5_1-sapi_src_unpack() {
        # fastbuild support
        use fastbuild && epatch ${FILESDIR}/5.1.0/fastbuild.patch
 
+       # run aclocal if hardenedphp is enabled, else rebuilding the configure dies
+       if use hardenedphp && [ -n "${HARDENEDPHP_PATCH}" ] ; then
+               einfo "Running aclocal for hardenedphp"
+               WANT_AUTOMAKE=1.6 aclocal || die "Unable to run aclocal successfully"
+               libtoolize --copy --force || die "Unable to run libtoolize successfully"
+       fi
+
        # rebuild configure to make sure it's up to date
        einfo "Rebuilding configure script"
        WANT_AUTOCONF=2.5 autoconf -W no-cross || die "Unable to regenerate configure script"
@@ -483,7 +493,7 @@ php5_1-sapi_src_compile() {
        else
                enable_extension_enable         "sqlite-utf8"   "nls"           0
        fi
-
+       
        # Zend-GOTO-VM support
        if useq vm-goto ; then
                my_conf="${my_conf} --with-zend-vm=GOTO"
@@ -581,11 +591,60 @@ php5_1-sapi_install_ini() {
 }
 
 php5_1-sapi_pkg_postinst() {
+       # Create the symlinks for php-cli
+       if useq cli ; then
+               if test -h "/usr/bin/php"; then
+                       ewarn "/usr/bin/php is a symlink."
+                       ewarn "The PHP packages will not update that symlink,"
+                       ewarn "please check it and do so yourself if you need"
+                       ewarn "to, using eselect."
+                       ewarn "For example with the command:"
+                       ewarn "eselect php set php5"
+                       ewarn "to symlink to /usr/lib/php5/bin/php."
+                       ewarn
+               else
+                       eselect php set php5
+               fi
+       fi
+
+       # Create the symlinks for php-cgi
+       if useq cgi ; then
+               if test -h "/usr/bin/php-cgi"; then
+                       ewarn "/usr/bin/php-cgi is a symlink."
+                       ewarn "The PHP packages will not update that symlink,"
+                       ewarn "please check it and do so yourself if you need"
+                       ewarn "to, using eselect."
+                       ewarn "For example with the command:"
+                       ewarn "eselect php-cgi set php5"
+                       ewarn "to symlink to /usr/lib/php5/bin/php-cgi."
+                       ewarn
+               else
+                       eselect php-cgi set php5
+               fi
+       fi
+
+       # Create the symlinks for php-devel
+       if test -h "/usr/bin/phpize" || test -h "/usr/bin/php-config" ; then
+               ewarn "/usr/bin/phpize and/or /usr/bin/php-config are symlinks."
+               ewarn "The PHP packages will not update these symlinks,"
+               ewarn "please check them and do so yourself if you need"
+               ewarn "to, using eselect."
+               ewarn "For example with the command:"
+               ewarn "eselect php-devel set php5"
+               ewarn "to symlink to /usr/lib/php5/bin/phpize and"
+               ewarn "/usr/lib/php5/bin/php-config."
+               ewarn
+       else
+               eselect php-devel set php5
+       fi
+
        ewarn "If you have additional third party PHP extensions (such as"
        ewarn "dev-php5/phpdbg) you may need to recompile them now."
+       ewarn
 
        if useq curl; then
                ewarn "Please be aware that CURL can allow the bypass of open_basedir restrictions."
                ewarn "This can be a security risk!"
+               ewarn
        fi
 }