diff -ruN --exclude=CVS ../php5-ice.orig/Makefile ./Makefile
--- ../php5-ice.orig/Makefile	2013-02-14 11:22:19.000000000 +0100
+++ ./Makefile	2013-06-02 19:07:09.000000000 +0200
@@ -1,42 +1,44 @@
-# New ports collection makefile for:	php-ice
-# Date created:				2007-08-21
-# Whom:					DIrk Ye <dirk.ye@gmail.com>
-#
+# Created by: DIrk Ye <dirk.ye@gmail.com>
 # $FreeBSD: ports/devel/php5-ice/Makefile,v 1.12 2013/02/14 10:22:19 svnexp Exp $
-#
 
 PORTNAME=	Ice
-PORTVERSION=	3.4.2
+PORTVERSION=	3.5.0
 CATEGORIES=	devel
-MASTER_SITES=	http://download.zeroc.com/Ice/3.4/
+MASTER_SITES=	http://download.zeroc.com/Ice/3.5/
 PKGNAMEPREFIX=	php5-
 DISTNAME=	Ice-${PORTVERSION}
 
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	An Ice (Internet Communications Engine) language mapping for PHP
 
+LICENSE=	GPLv2
+
+BUILD_DEPENDS=	mcpp:${PORTSDIR}/devel/mcpp
 LIB_DEPENDS=	Ice.${LIB_VRS}:${PORTSDIR}/devel/ice
 
+OPTIONS_DEFINE=	DEBUG DOCS NAMESPACES
+NAMESPACES_DESC=Use PHP namespaces (recommended)
+
+.include <bsd.port.options.mk>
+
 USE_GMAKE=	yes
-MAKE_ARGS+=	PHP_EXT_DIR=${PHP_EXT_DIR}
+MAKE_ARGS+=	PHP_EXT_DIR=${PHP_EXT_DIR} ICE_HOME=${PREFIX} \
+		PHP_HOME=${PREFIX} OPTIMIZE=yes
 USE_PHP=	yes
 USE_PHP_BUILD=	yes
-DEFAULT_PHP_VER=53
-IGNORE_WITH_PHP=5
+DEFAULT_PHP_VER=5
+IGNORE_WITH_PHP=4 52
 BUILD_WRKSRC=	${WRKSRC}/php
 INSTALL_WRKSRC=	${WRKSRC}/php
 
-LIB_VRS=	${PORTVERSION:S|.||g:C|2$||}
+LIB_VRS=	${PORTVERSION:S|.||g:C|0$||}
 PHP_MODNAME?=	IcePHP
 
 CFLAGS+=	-ftemplate-depth-128 -fPIC -DPIC -Wall -D_REENTRANT
-.if defined(DEBUG)
-CFLAGS+=	-g
-.else
+.if empty(PORT_OPTIONS:MDEBUG)
 CFLAGS+=	-DNDEBUG
 .endif
 
-.include <bsd.port.pre.mk>
 .if ${ARCH} == "ia64"
 BROKEN=		does not compile on ia64
 .endif
@@ -45,20 +47,37 @@
 MAKE_ENV=	LP64=yes
 .endif
 
-.if defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MNAMESPACES}
+MAKE_ARGS+=	USE_NAMESPACES=yes
+PLIST_SUB+=	NAMESPACES=""
+PLIST_SUB+=	NONAMESPACES="@comment "
+.else
+PLIST_SUB+=	NAMESPACES="@comment "
+PLIST_SUB+=	NONAMESPACES=""
+.endif
+
+.if empty(PORT_OPTIONS:MDOCS)
 MAKE_ENV+=	NOPORTDOCS=yes
 .endif
 
+.include <bsd.port.pre.mk>
+
 post-patch:
-	${REINPLACE_CMD} 's|%%INSTALL_PROGRAM%%|${INSTALL_PROGRAM}|g; \
+	@${SED} 's|%%PREFIX%%|${PREFIX}|g; \
+		s|%%DATADIR%%|${DATADIR}|g; \
+		s|%%DOCSDIR%%|${DOCSDIR}|g; \
+		s|%%INSTALL_PROGRAM%%|${INSTALL_PROGRAM}|g; \
+		s|%%INSTALL_DATA%%|${INSTALL_DATA}|g' \
+		${FILESDIR}/Make.rules.FreeBSD > ${WRKSRC}/cpp/config/Make.rules.FreeBSD
+	@${REINPLACE_CMD} 's|%%INSTALL_PROGRAM%%|${INSTALL_PROGRAM}|g; \
 		s|%%INSTALL_DATA%%|${INSTALL_DATA}|g; \
 		s|%%PREFIX%%|${PREFIX}|g ; \
 		s|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/php/config/Make.rules.php
+
 post-install:
 	@${MKDIR} ${PREFIX}/etc/php
 	@${ECHO_CMD} extension=${PHP_MODNAME}.so \
 		>> ${PREFIX}/etc/php/extensions.ini
-	@${CAT} ${PKGMESSAGE}
 
 add-plist-info:
 	@${ECHO_CMD} "@exec mkdir -p %D/etc/php" \
diff -ruN --exclude=CVS ../php5-ice.orig/distinfo ./distinfo
--- ../php5-ice.orig/distinfo	2011-06-28 15:44:49.000000000 +0200
+++ ./distinfo	2013-06-02 12:56:12.000000000 +0200
@@ -1,2 +1,2 @@
-SHA256 (Ice-3.4.2.tar.gz) = dcf0484495b6df0849ec90a00e8204fe5fe1c0d3882bb438bf2c1d062f15c979
-SIZE (Ice-3.4.2.tar.gz) = 5485106
+SHA256 (Ice-3.5.0.tar.gz) = 583d4a819d50ad8b79b1e9ad45abfa3078f981486271ca8cd9ede8fa420ff575
+SIZE (Ice-3.5.0.tar.gz) = 5388847
diff -ruN --exclude=CVS ../php5-ice.orig/files/Make.rules.FreeBSD ./files/Make.rules.FreeBSD
--- ../php5-ice.orig/files/Make.rules.FreeBSD	1970-01-01 01:00:00.000000000 +0100
+++ ./files/Make.rules.FreeBSD	2013-06-02 13:00:43.000000000 +0200
@@ -0,0 +1,21 @@
+mkshlib                 = $(CXX) -shared $(LDFLAGS) -o $(1) -Wl,-h,$(2) $(3) $(4)
+
+BASELIBS		= -lIceUtil -pthread -L$(LOCALBASE)/lib -liconv
+LIBS			= -lIce $(BASELIBS) 
+
+ICEUTIL_OS_LIBS         = -pthread
+
+PLATFORM_HAS_READLINE   := yes
+
+export LD_LIBRARY_PATH	:= $(libdir):$(LD_LIBRARY_PATH)
+
+lp64suffix		=
+create_runpath_symlink	= no
+prefix			= %%PREFIX%%
+install_slicedir	= %%DATADIR%%
+install_configdir	= %%DATADIR%%/config
+install_docdir		= %%DOCSDIR%%
+EXPAT_HOME		= $(LOCALBASE)
+INSTALL			= %%INSTALL_DATA%%
+INSTALL_PROGRAM		= %%INSTALL_PROGRAM%%
+MCPP_HOME		= $(LOCALBASE)
diff -ruN --exclude=CVS ../php5-ice.orig/files/patch-cpp+config+Make.rules.FreeBSD ./files/patch-cpp+config+Make.rules.FreeBSD
--- ../php5-ice.orig/files/patch-cpp+config+Make.rules.FreeBSD	2013-02-14 11:22:19.000000000 +0100
+++ ./files/patch-cpp+config+Make.rules.FreeBSD	1970-01-01 01:00:00.000000000 +0100
@@ -1,31 +0,0 @@
---- cpp/config/Make.rules.FreeBSD.orig	2008-08-02 08:12:53.000000000 +0800
-+++ cpp/config/Make.rules.FreeBSD	2008-08-02 08:14:46.000000000 +0800
-@@ -27,7 +27,7 @@
- endif
- 
- ifeq ($(OPTIMIZE),yes)
--    CXXFLAGS		+= -O3 -DNDEBUG
-+    CXXFLAGS		+= -O2 -DNDEBUG
- else
-     CXXFLAGS		+= -g
- endif
-@@ -37,15 +37,15 @@
- #
- CXXLIBS			=
- 
--mkshlib			= $(CXX) -shared $(LDFLAGS) -o $(1) -Wl,-h,$(2) $(3) $(4) -lc_r
-+mkshlib			= $(CXX) -shared $(LDFLAGS) -o $(1) -Wl,-h,$(2) $(3) $(4)
- 
- mklib			= ar cr $(1) $(2)
- 
--BASELIBS		= -lIceUtil -lc_r
-+BASELIBS		= -lIceUtil -pthread -L$(LOCALBASE)/lib -liconv
- LIBS			= -lIce $(BASELIBS)
- 
--ICEUTIL_OS_LIBS		= 
--ICE_OS_LIBS		= 
-+ICEUTIL_OS_LIBS		= -pthread
-+ICE_OS_LIBS		=
- 
- PLATFORM_HAS_READLINE	= yes
- 
diff -ruN --exclude=CVS ../php5-ice.orig/files/patch-cpp-config-Make.rules ./files/patch-cpp-config-Make.rules
--- ../php5-ice.orig/files/patch-cpp-config-Make.rules	1970-01-01 01:00:00.000000000 +0100
+++ ./files/patch-cpp-config-Make.rules	2013-06-02 12:59:47.000000000 +0200
@@ -0,0 +1,13 @@
+--- cpp.orig/config/Make.rules	Fri Mar 11 16:19:00 2013
++++ cpp/config/Make.rules	Fri May 19 22:00:09 2013
+@@ -233,7 +233,9 @@
+           DB_FLAGS          = -I/usr/local/include/db53
+           DB_LIBS           = -L/usr/local/$(libsubdir)/db53 -ldb_cxx
+       else
+-        DB_LIBS      = -ldb_cxx
++        DB_FLAGS          = -I%%BDB_INCLUDE_DIR%%
++        DB_LIBS           = -L%%BDB_LIB_DIR%% -l%%BDB_LIB_CXX_NAME%%
++        DB_RPATH_LINK     = $(call rpathlink,%%BDB_LIB_DIR%%)
+       endif
+    endif
+ endif
diff -ruN --exclude=CVS ../php5-ice.orig/files/patch-php+config+Make.rules.php ./files/patch-php+config+Make.rules.php
--- ../php5-ice.orig/files/patch-php+config+Make.rules.php	2010-08-15 14:22:09.000000000 +0200
+++ ./files/patch-php+config+Make.rules.php	1970-01-01 01:00:00.000000000 +0100
@@ -1,42 +0,0 @@
---- php/config/Make.rules.php.orig	2010-06-03 18:48:34.000000000 +0200
-+++ php/config/Make.rules.php	2010-07-30 14:43:46.000000000 +0200
-@@ -12,7 +12,9 @@
- # if it does not exist.
- #
- 
--prefix			?= /opt/Ice-$(VERSION)
-+ICE_HOME		= /usr/local
-+
-+prefix			?= /usr/local/lib/php/$(PHP_EXT_DIR)
- 
- #
- # The "root directory" for runpath embedded in executables. Can be unset
-@@ -25,7 +27,7 @@
- # Otherwise the Ice extension is built with debug information.
- #
- 
--#OPTIMIZE		= yes
-+OPTIMIZE		= yes
- 
- #
- # Define LP64 as yes if you want to build in 64 bit mode on a platform
-@@ -54,7 +56,7 @@
- # PHP_INCLUDE_DIR and PHP_LIB_DIR.
- #
- 
--PHP_HOME		?= /opt/php
-+PHP_HOME		?= /usr/local
- 
- #
- # Verifies the PHP_HOME is valid and attempts to adjust for platform variances
-@@ -100,8 +102,8 @@
- endif
- 
- libdir			= $(top_srcdir)/lib
--install_phpdir		= $(prefix)/php
--install_libdir		= $(prefix)/php
-+install_phpdir		= $(prefix)
-+install_libdir		= $(prefix)
- 
- #
- # Platform specific definitions
diff -ruN --exclude=CVS ../php5-ice.orig/files/patch-php-config-Make.rules.php ./files/patch-php-config-Make.rules.php
--- ../php5-ice.orig/files/patch-php-config-Make.rules.php	1970-01-01 01:00:00.000000000 +0100
+++ ./files/patch-php-config-Make.rules.php	2013-06-02 16:36:54.000000000 +0200
@@ -0,0 +1,23 @@
+--- php/config/Make.rules.php.orig	2013-03-11 15:19:47.000000000 +0000
++++ php/config/Make.rules.php	2013-06-02 14:36:13.744196194 +0000
+@@ -100,8 +100,8 @@
+ endif
+ 
+ libdir			= $(top_srcdir)/lib
+-install_phpdir		= $(prefix)/php
+-install_libdir		= $(prefix)/php
++install_phpdir		= $(prefix)/share/pear
++install_libdir		= $(prefix)/lib/php/$(PHP_EXT_DIR)
+ 
+ #
+ # Platform specific definitions
+@@ -155,7 +155,8 @@
+ endif
+ 
+ ifeq ($(installphplib),)
+-    installphplib	= $(INSTALL) $(1) $(2); \
++    installphplib	= mkdir -p $(2) ; \
++			  $(INSTALL) $(1) $(2); \
+ 			  chmod a+rx $(2)/$(notdir $(1))
+ endif
+ 
diff -ruN --exclude=CVS ../php5-ice.orig/files/patch-php-lib-Makefile ./files/patch-php-lib-Makefile
--- ../php5-ice.orig/files/patch-php-lib-Makefile	1970-01-01 01:00:00.000000000 +0100
+++ ./files/patch-php-lib-Makefile	2013-06-02 16:11:57.000000000 +0200
@@ -0,0 +1,12 @@
+--- php/lib/Makefile.orig	2013-06-02 12:11:06.451195440 +0000
++++ php/lib/Makefile	2013-06-02 12:16:29.249191742 +0000
+@@ -167,7 +167,8 @@
+ 	@echo "Installing generated code"
+ 	@for i in $(MODULES) ; \
+ 	do \
+-	    $(INSTALL_DATA) -r $$i $(install_phpdir) ; \
++	    mkdir -p $(install_phpdir)/$$i ; \
++	    $(INSTALL_DATA) $$i/*.php $(install_phpdir)/$$i ; \
+ 	done
+ 	@for i in $(MODULE_SRCS) ; \
+ 	do \
diff -ruN --exclude=CVS ../php5-ice.orig/files/patch-php-src-IcePHP-Communicator.cpp ./files/patch-php-src-IcePHP-Communicator.cpp
--- ../php5-ice.orig/files/patch-php-src-IcePHP-Communicator.cpp	1970-01-01 01:00:00.000000000 +0100
+++ ./files/patch-php-src-IcePHP-Communicator.cpp	2013-06-02 13:56:47.000000000 +0200
@@ -0,0 +1,11 @@
+--- php/src/IcePHP/Communicator.cpp.orig	2013-06-02 11:48:21.990197196 +0000
++++ php/src/IcePHP/Communicator.cpp	2013-06-02 11:48:29.692195174 +0000
+@@ -1341,7 +1341,7 @@
+     //
+     zend_class_entry ce;
+ #ifdef ICEPHP_USE_NAMESPACES
+-    INIT_NS_CLASS_ENTRY(ce, STRCAST("Ice"), STRCAST("Communicator"), _interfaceMethods);
++    INIT_NS_CLASS_ENTRY(ce, "Ice", "Communicator", _interfaceMethods);
+ #else
+     INIT_CLASS_ENTRY(ce, "Ice_Communicator", _interfaceMethods);
+ #endif
diff -ruN --exclude=CVS ../php5-ice.orig/files/patch-php-src-IcePHP-Connection.cpp ./files/patch-php-src-IcePHP-Connection.cpp
--- ../php5-ice.orig/files/patch-php-src-IcePHP-Connection.cpp	1970-01-01 01:00:00.000000000 +0100
+++ ./files/patch-php-src-IcePHP-Connection.cpp	2013-06-02 13:56:47.000000000 +0200
@@ -0,0 +1,47 @@
+--- php/src/IcePHP/Connection.cpp.orig	2013-06-02 11:48:58.022196354 +0000
++++ php/src/IcePHP/Connection.cpp	2013-06-02 11:50:59.494195380 +0000
+@@ -360,7 +360,7 @@
+     //
+     zend_class_entry ce;
+ #ifdef ICEPHP_USE_NAMESPACES
+-    INIT_NS_CLASS_ENTRY(ce, STRCAST("Ice"), STRCAST("Connection"), _interfaceMethods);
++    INIT_NS_CLASS_ENTRY(ce, "Ice", "Connection", _interfaceMethods);
+ #else
+     INIT_CLASS_ENTRY(ce, "Ice_Connection", _interfaceMethods);
+ #endif
+@@ -380,7 +380,7 @@
+     // Register the ConnectionInfo class.
+     //
+ #ifdef ICEPHP_USE_NAMESPACES
+-    INIT_NS_CLASS_ENTRY(ce, STRCAST("Ice"), STRCAST("ConnectionInfo"), _connectionInfoClassMethods);
++    INIT_NS_CLASS_ENTRY(ce, "Ice", "ConnectionInfo", _connectionInfoClassMethods);
+ #else
+     INIT_CLASS_ENTRY(ce, "Ice_ConnectionInfo", _connectionInfoClassMethods);
+ #endif
+@@ -396,7 +396,7 @@
+     // Register the IPConnectionInfo class.
+     //
+ #ifdef ICEPHP_USE_NAMESPACES
+-    INIT_NS_CLASS_ENTRY(ce, STRCAST("Ice"), STRCAST("IPConnectionInfo"), NULL);
++    INIT_NS_CLASS_ENTRY(ce, "Ice", "IPConnectionInfo", NULL);
+ #else
+     INIT_CLASS_ENTRY(ce, "Ice_IPConnectionInfo", NULL);
+ #endif
+@@ -415,7 +415,7 @@
+     // Register the TCPConnectionInfo class.
+     //
+ #ifdef ICEPHP_USE_NAMESPACES
+-    INIT_NS_CLASS_ENTRY(ce, STRCAST("Ice"), STRCAST("TCPConnectionInfo"), NULL);
++    INIT_NS_CLASS_ENTRY(ce, "Ice", "TCPConnectionInfo", NULL);
+ #else
+     INIT_CLASS_ENTRY(ce, "Ice_TCPConnectionInfo", NULL);
+ #endif
+@@ -426,7 +426,7 @@
+     // Register the UDPConnectionInfo class.
+     //
+ #ifdef ICEPHP_USE_NAMESPACES
+-    INIT_NS_CLASS_ENTRY(ce, STRCAST("Ice"), STRCAST("UDPConnectionInfo"), NULL);
++    INIT_NS_CLASS_ENTRY(ce, "Ice", "UDPConnectionInfo", NULL);
+ #else
+     INIT_CLASS_ENTRY(ce, "Ice_UDPConnectionInfo", NULL);
+ #endif
diff -ruN --exclude=CVS ../php5-ice.orig/files/patch-php-src-IcePHP-Endpoint.cpp ./files/patch-php-src-IcePHP-Endpoint.cpp
--- ../php5-ice.orig/files/patch-php-src-IcePHP-Endpoint.cpp	1970-01-01 01:00:00.000000000 +0100
+++ ./files/patch-php-src-IcePHP-Endpoint.cpp	2013-06-02 13:56:47.000000000 +0200
@@ -0,0 +1,56 @@
+--- php/src/IcePHP/Endpoint.cpp.orig	2013-06-02 11:51:19.569193334 +0000
++++ php/src/IcePHP/Endpoint.cpp	2013-06-02 11:52:06.348197336 +0000
+@@ -274,7 +274,7 @@
+     //
+     zend_class_entry ce;
+ #ifdef ICEPHP_USE_NAMESPACES
+-    INIT_NS_CLASS_ENTRY(ce, STRCAST("Ice"), STRCAST("Endpoint"), _interfaceMethods);
++    INIT_NS_CLASS_ENTRY(ce, "Ice", "Endpoint", _interfaceMethods);
+ #else
+     INIT_CLASS_ENTRY(ce, "Ice_Endpoint", _interfaceMethods);
+ #endif
+@@ -293,7 +293,7 @@
+     // Register the EndpointInfo class.
+     //
+ #ifdef ICEPHP_USE_NAMESPACES
+-    INIT_NS_CLASS_ENTRY(ce, STRCAST("Ice"), STRCAST("EndpointInfo"), _endpointInfoMethods);
++    INIT_NS_CLASS_ENTRY(ce, "Ice", "EndpointInfo", _endpointInfoMethods);
+ #else
+     INIT_CLASS_ENTRY(ce, "Ice_EndpointInfo", _endpointInfoMethods);
+ #endif
+@@ -309,7 +309,7 @@
+     // Register the IPEndpointInfo class.
+     //
+ #ifdef ICEPHP_USE_NAMESPACES
+-    INIT_NS_CLASS_ENTRY(ce, STRCAST("Ice"), STRCAST("IPEndpointInfo"), NULL);
++    INIT_NS_CLASS_ENTRY(ce, "Ice", "IPEndpointInfo", NULL);
+ #else
+     INIT_CLASS_ENTRY(ce, "Ice_IPEndpointInfo", NULL);
+ #endif
+@@ -324,7 +324,7 @@
+     // Register the TCPEndpointInfo class.
+     //
+ #ifdef ICEPHP_USE_NAMESPACES
+-    INIT_NS_CLASS_ENTRY(ce, STRCAST("Ice"), STRCAST("TCPEndpointInfo"), NULL);
++    INIT_NS_CLASS_ENTRY(ce, "Ice", "TCPEndpointInfo", NULL);
+ #else
+     INIT_CLASS_ENTRY(ce, "Ice_TCPEndpointInfo", NULL);
+ #endif
+@@ -335,7 +335,7 @@
+     // Register the UDPEndpointInfo class.
+     //
+ #ifdef ICEPHP_USE_NAMESPACES
+-    INIT_NS_CLASS_ENTRY(ce, STRCAST("Ice"), STRCAST("UDPEndpointInfo"), NULL);
++    INIT_NS_CLASS_ENTRY(ce, "Ice", "UDPEndpointInfo", NULL);
+ #else
+     INIT_CLASS_ENTRY(ce, "Ice_UDPEndpointInfo", NULL);
+ #endif
+@@ -350,7 +350,7 @@
+     // Register the OpaqueEndpointInfo class.
+     //
+ #ifdef ICEPHP_USE_NAMESPACES
+-    INIT_NS_CLASS_ENTRY(ce, STRCAST("Ice"), STRCAST("OpaqueEndpointInfo"), NULL);
++    INIT_NS_CLASS_ENTRY(ce, "Ice", "OpaqueEndpointInfo", NULL);
+ #else
+     INIT_CLASS_ENTRY(ce, "Ice_OpaqueEndpointInfo", NULL);
+ #endif
diff -ruN --exclude=CVS ../php5-ice.orig/files/patch-php-src-IcePHP-Init.cpp ./files/patch-php-src-IcePHP-Init.cpp
--- ../php5-ice.orig/files/patch-php-src-IcePHP-Init.cpp	1970-01-01 01:00:00.000000000 +0100
+++ ./files/patch-php-src-IcePHP-Init.cpp	2013-06-02 13:56:47.000000000 +0200
@@ -0,0 +1,15 @@
+--- php/src/IcePHP/Init.cpp.orig	2013-03-11 15:19:47.000000000 +0000
++++ php/src/IcePHP/Init.cpp	2013-06-02 11:44:16.052196522 +0000
+@@ -22,10 +22,10 @@
+ 
+ ZEND_DECLARE_MODULE_GLOBALS(ice)
+ 
+-ZEND_BEGIN_ARG_INFO(Ice_initialize_arginfo, 1)
++ZEND_BEGIN_ARG_INFO_EX(Ice_initialize_arginfo, 1, ZEND_RETURN_VALUE, static_cast<zend_uint>(-1))
+ ZEND_END_ARG_INFO()
+ 
+-ZEND_BEGIN_ARG_INFO(Ice_createProperties_arginfo, 1)
++ZEND_BEGIN_ARG_INFO_EX(Ice_createProperties_arginfo, 1, ZEND_RETURN_VALUE, static_cast<zend_uint>(-1))
+ ZEND_END_ARG_INFO()
+ 
+ #define ICEPHP_COMMUNICATOR_FUNCTIONS \
diff -ruN --exclude=CVS ../php5-ice.orig/files/patch-php-src-IcePHP-Logger.cpp ./files/patch-php-src-IcePHP-Logger.cpp
--- ../php5-ice.orig/files/patch-php-src-IcePHP-Logger.cpp	1970-01-01 01:00:00.000000000 +0100
+++ ./files/patch-php-src-IcePHP-Logger.cpp	2013-06-02 13:56:47.000000000 +0200
@@ -0,0 +1,11 @@
+--- php/src/IcePHP/Logger.cpp.orig	2013-06-02 11:52:25.727195546 +0000
++++ php/src/IcePHP/Logger.cpp	2013-06-02 11:52:39.876195038 +0000
+@@ -269,7 +269,7 @@
+     //
+     zend_class_entry ce;
+ #ifdef ICEPHP_USE_NAMESPACES
+-    INIT_NS_CLASS_ENTRY(ce, STRCAST("Ice"), STRCAST("Logger"), _interfaceMethods);
++    INIT_NS_CLASS_ENTRY(ce, "Ice", "Logger", _interfaceMethods);
+ #else
+     INIT_CLASS_ENTRY(ce, "Ice_Logger", _interfaceMethods);
+ #endif
diff -ruN --exclude=CVS ../php5-ice.orig/files/patch-php-src-IcePHP-Properties.cpp ./files/patch-php-src-IcePHP-Properties.cpp
--- ../php5-ice.orig/files/patch-php-src-IcePHP-Properties.cpp	1970-01-01 01:00:00.000000000 +0100
+++ ./files/patch-php-src-IcePHP-Properties.cpp	2013-06-02 13:56:47.000000000 +0200
@@ -0,0 +1,11 @@
+--- php/src/IcePHP/Properties.cpp.orig	2013-06-02 11:52:55.531198249 +0000
++++ php/src/IcePHP/Properties.cpp	2013-06-02 11:53:07.786227648 +0000
+@@ -641,7 +641,7 @@
+     //
+     zend_class_entry ce;
+ #ifdef ICEPHP_USE_NAMESPACES
+-    INIT_NS_CLASS_ENTRY(ce, STRCAST("Ice"), STRCAST("Properties"), _interfaceMethods);
++    INIT_NS_CLASS_ENTRY(ce, "Ice", "Properties", _interfaceMethods);
+ #else
+     INIT_CLASS_ENTRY(ce, "Ice_Properties", _interfaceMethods);
+ #endif
diff -ruN --exclude=CVS ../php5-ice.orig/files/patch-php-src-IcePHP-Proxy.cpp ./files/patch-php-src-IcePHP-Proxy.cpp
--- ../php5-ice.orig/files/patch-php-src-IcePHP-Proxy.cpp	1970-01-01 01:00:00.000000000 +0100
+++ ./files/patch-php-src-IcePHP-Proxy.cpp	2013-06-02 13:56:47.000000000 +0200
@@ -0,0 +1,11 @@
+--- php/src/IcePHP/Proxy.cpp.orig	2013-06-02 11:54:02.594196824 +0000
++++ php/src/IcePHP/Proxy.cpp	2013-06-02 11:53:46.793198453 +0000
+@@ -1702,7 +1702,7 @@
+     //
+     zend_class_entry ce;
+ #ifdef ICEPHP_USE_NAMESPACES
+-    INIT_NS_CLASS_ENTRY(ce, STRCAST("Ice"), STRCAST("ObjectPrx"), _proxyMethods);
++    INIT_NS_CLASS_ENTRY(ce, "Ice", "ObjectPrx", _proxyMethods);
+ #else
+     INIT_CLASS_ENTRY(ce, "Ice_ObjectPrx", _proxyMethods);
+ #endif
diff -ruN --exclude=CVS ../php5-ice.orig/pkg-message ./pkg-message
--- ../php5-ice.orig/pkg-message	2009-05-23 17:22:28.000000000 +0200
+++ ./pkg-message	1970-01-01 01:00:00.000000000 +0100
@@ -1,20 +0,0 @@
-
-----------------------------------------------------------------------------
-                      Attention for FreeBSD-i386 user 
-----------------------------------------------------------------------------
-
-If the php fails with:
-
-	terminate called after throwing an instance of 'IceUtil::ThreadSyscallException'
-	  what():  RecMutex.cpp:96: IceUtil::ThreadSyscallException:
-	...
-
-Try to start it with:
-
-	$ LD_PRELOAD=/usr/lib/libc_r.so php
-
-or for FreeBSD version 7 and above:
-
-	$ LD_PRELOAD=/usr/lib/libpthread.so php
-
-----------------------------------------------------------------------------
diff -ruN --exclude=CVS ../php5-ice.orig/pkg-plist ./pkg-plist
--- ../php5-ice.orig/pkg-plist	2010-08-15 14:22:09.000000000 +0200
+++ ./pkg-plist	2013-06-02 19:07:34.000000000 +0200
@@ -1,145 +1,74 @@
-lib/php/%%PHP_EXT_DIR%%/ICE_LICENSE
-lib/php/%%PHP_EXT_DIR%%/Ice.php
 lib/php/%%PHP_EXT_DIR%%/IcePHP.so
-lib/php/%%PHP_EXT_DIR%%/LICENSE
-lib/php/%%PHP_EXT_DIR%%/Glacier2.php
-lib/php/%%PHP_EXT_DIR%%/Glacier2/PermissionsVerifier.php
-lib/php/%%PHP_EXT_DIR%%/Glacier2/PermissionsVerifierF.php
-lib/php/%%PHP_EXT_DIR%%/Glacier2/Router.php
-lib/php/%%PHP_EXT_DIR%%/Glacier2/RouterF.php
-lib/php/%%PHP_EXT_DIR%%/Glacier2/SSLInfo.php
-lib/php/%%PHP_EXT_DIR%%/Glacier2/Session.php
-lib/php/%%PHP_EXT_DIR%%/Ice/BuiltinSequences.php
-lib/php/%%PHP_EXT_DIR%%/Ice/Communicator.php
-lib/php/%%PHP_EXT_DIR%%/Ice/CommunicatorF.php
-lib/php/%%PHP_EXT_DIR%%/Ice/Connection.php
-lib/php/%%PHP_EXT_DIR%%/Ice/ConnectionF.php
-lib/php/%%PHP_EXT_DIR%%/Ice/Current.php
-lib/php/%%PHP_EXT_DIR%%/Ice/Endpoint.php
-lib/php/%%PHP_EXT_DIR%%/Ice/EndpointF.php
-lib/php/%%PHP_EXT_DIR%%/Ice/EndpointTypes.php
-lib/php/%%PHP_EXT_DIR%%/Ice/FacetMap.php
-lib/php/%%PHP_EXT_DIR%%/Ice/Identity.php
-lib/php/%%PHP_EXT_DIR%%/Ice/ImplicitContext.php
-lib/php/%%PHP_EXT_DIR%%/Ice/ImplicitContextF.php
-lib/php/%%PHP_EXT_DIR%%/Ice/LocalException.php
-lib/php/%%PHP_EXT_DIR%%/Ice/Locator.php
-lib/php/%%PHP_EXT_DIR%%/Ice/LocatorF.php
-lib/php/%%PHP_EXT_DIR%%/Ice/Logger.php
-lib/php/%%PHP_EXT_DIR%%/Ice/LoggerF.php
-lib/php/%%PHP_EXT_DIR%%/Ice/ObjectAdapterF.php
-lib/php/%%PHP_EXT_DIR%%/Ice/ObjectFactory.php
-lib/php/%%PHP_EXT_DIR%%/Ice/ObjectFactoryF.php
-lib/php/%%PHP_EXT_DIR%%/Ice/Plugin.php
-lib/php/%%PHP_EXT_DIR%%/Ice/PluginF.php
-lib/php/%%PHP_EXT_DIR%%/Ice/Process.php
-lib/php/%%PHP_EXT_DIR%%/Ice/ProcessF.php
-lib/php/%%PHP_EXT_DIR%%/Ice/Properties.php
-lib/php/%%PHP_EXT_DIR%%/Ice/PropertiesF.php
-lib/php/%%PHP_EXT_DIR%%/Ice/Router.php
-lib/php/%%PHP_EXT_DIR%%/Ice/RouterF.php
-lib/php/%%PHP_EXT_DIR%%/Ice/SliceChecksumDict.php
-lib/php/%%PHP_EXT_DIR%%/Ice/Stats.php
-lib/php/%%PHP_EXT_DIR%%/Ice/StatsF.php
-lib/php/%%PHP_EXT_DIR%%/IceBox.php
-lib/php/%%PHP_EXT_DIR%%/IceBox/IceBox.php
-lib/php/%%PHP_EXT_DIR%%/IceGrid.php
-lib/php/%%PHP_EXT_DIR%%/IceGrid/Admin.php
-lib/php/%%PHP_EXT_DIR%%/IceGrid/Descriptor.php
-lib/php/%%PHP_EXT_DIR%%/IceGrid/Exception.php
-lib/php/%%PHP_EXT_DIR%%/IceGrid/FileParser.php
-lib/php/%%PHP_EXT_DIR%%/IceGrid/Locator.php
-lib/php/%%PHP_EXT_DIR%%/IceGrid/Observer.php
-lib/php/%%PHP_EXT_DIR%%/IceGrid/Query.php
-lib/php/%%PHP_EXT_DIR%%/IceGrid/Registry.php
-lib/php/%%PHP_EXT_DIR%%/IceGrid/Session.php
-lib/php/%%PHP_EXT_DIR%%/IceGrid/UserAccountMapper.php
-lib/php/%%PHP_EXT_DIR%%/IcePatch2.php
-lib/php/%%PHP_EXT_DIR%%/IcePatch2/FileInfo.php
-lib/php/%%PHP_EXT_DIR%%/IcePatch2/FileServer.php
-lib/php/%%PHP_EXT_DIR%%/IceStorm.php
-lib/php/%%PHP_EXT_DIR%%/IceStorm/IceStorm.php
-lib/php/%%PHP_EXT_DIR%%/slice/Freeze/BackgroundSaveEvictor.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Freeze/CatalogData.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Freeze/Connection.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Freeze/ConnectionF.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Freeze/DB.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Freeze/Evictor.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Freeze/EvictorF.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Freeze/EvictorStorage.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Freeze/Exception.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Freeze/Transaction.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Freeze/TransactionalEvictor.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Glacier2/PermissionsVerifier.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Glacier2/PermissionsVerifierF.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Glacier2/Router.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Glacier2/RouterF.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Glacier2/SSLInfo.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Glacier2/Session.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/BuiltinSequences.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/Communicator.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/CommunicatorF.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/Connection.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/ConnectionF.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/Current.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/Endpoint.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/EndpointF.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/EndpointTypes.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/FacetMap.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/Identity.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/ImplicitContext.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/ImplicitContextF.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/LocalException.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/Locator.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/LocatorF.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/Logger.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/LoggerF.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/ObjectAdapter.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/ObjectAdapterF.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/ObjectFactory.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/ObjectFactoryF.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/Plugin.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/PluginF.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/Process.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/ProcessF.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/Properties.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/PropertiesF.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/Router.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/RouterF.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/ServantLocator.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/ServantLocatorF.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/SliceChecksumDict.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/Stats.ice
-lib/php/%%PHP_EXT_DIR%%/slice/Ice/StatsF.ice
-lib/php/%%PHP_EXT_DIR%%/slice/IceBox/IceBox.ice
-lib/php/%%PHP_EXT_DIR%%/slice/IceGrid/Admin.ice
-lib/php/%%PHP_EXT_DIR%%/slice/IceGrid/Descriptor.ice
-lib/php/%%PHP_EXT_DIR%%/slice/IceGrid/Exception.ice
-lib/php/%%PHP_EXT_DIR%%/slice/IceGrid/FileParser.ice
-lib/php/%%PHP_EXT_DIR%%/slice/IceGrid/Locator.ice
-lib/php/%%PHP_EXT_DIR%%/slice/IceGrid/Observer.ice
-lib/php/%%PHP_EXT_DIR%%/slice/IceGrid/Query.ice
-lib/php/%%PHP_EXT_DIR%%/slice/IceGrid/Registry.ice
-lib/php/%%PHP_EXT_DIR%%/slice/IceGrid/Session.ice
-lib/php/%%PHP_EXT_DIR%%/slice/IceGrid/UserAccountMapper.ice
-lib/php/%%PHP_EXT_DIR%%/slice/IcePatch2/FileInfo.ice
-lib/php/%%PHP_EXT_DIR%%/slice/IcePatch2/FileServer.ice
-lib/php/%%PHP_EXT_DIR%%/slice/IceSSL/ConnectionInfo.ice
-lib/php/%%PHP_EXT_DIR%%/slice/IceSSL/EndpointInfo.ice
-lib/php/%%PHP_EXT_DIR%%/slice/IceStorm/IceStorm.ice
-@dirrmtry lib/php/%%PHP_EXT_DIR%%/Glacier2
-@dirrmtry lib/php/%%PHP_EXT_DIR%%/Ice
-@dirrmtry lib/php/%%PHP_EXT_DIR%%/IceBox
-@dirrmtry lib/php/%%PHP_EXT_DIR%%/IceGrid
-@dirrmtry lib/php/%%PHP_EXT_DIR%%/IcePatch2
-@dirrmtry lib/php/%%PHP_EXT_DIR%%/IceStorm
-@dirrmtry lib/php/%%PHP_EXT_DIR%%/slice/Freeze
-@dirrmtry lib/php/%%PHP_EXT_DIR%%/slice/Glacier2
-@dirrmtry lib/php/%%PHP_EXT_DIR%%/slice/Ice
-@dirrmtry lib/php/%%PHP_EXT_DIR%%/slice/IceBox
-@dirrmtry lib/php/%%PHP_EXT_DIR%%/slice/IceGrid
-@dirrmtry lib/php/%%PHP_EXT_DIR%%/slice/IcePatch2
-@dirrmtry lib/php/%%PHP_EXT_DIR%%/slice/IceSSL
-@dirrmtry lib/php/%%PHP_EXT_DIR%%/slice/IceStorm
-@dirrmtry lib/php/%%PHP_EXT_DIR%%/slice
+share/pear/Glacier2.php
+share/pear/Glacier2/Metrics.php
+share/pear/Glacier2/PermissionsVerifier.php
+share/pear/Glacier2/PermissionsVerifierF.php
+share/pear/Glacier2/Router.php
+share/pear/Glacier2/RouterF.php
+share/pear/Glacier2/SSLInfo.php
+share/pear/Glacier2/Session.php
+%%NONAMESPACES%%share/pear/Ice.php
+%%NAMESPACES%%share/pear/Ice_ns.php
+share/pear/Ice/BuiltinSequences.php
+share/pear/Ice/Communicator.php
+share/pear/Ice/CommunicatorF.php
+share/pear/Ice/Connection.php
+share/pear/Ice/ConnectionF.php
+share/pear/Ice/Current.php
+share/pear/Ice/Endpoint.php
+share/pear/Ice/EndpointF.php
+share/pear/Ice/EndpointTypes.php
+share/pear/Ice/FacetMap.php
+share/pear/Ice/Identity.php
+share/pear/Ice/ImplicitContext.php
+share/pear/Ice/ImplicitContextF.php
+share/pear/Ice/Instrumentation.php
+share/pear/Ice/InstrumentationF.php
+share/pear/Ice/LocalException.php
+share/pear/Ice/Locator.php
+share/pear/Ice/LocatorF.php
+share/pear/Ice/Logger.php
+share/pear/Ice/LoggerF.php
+share/pear/Ice/Metrics.php
+share/pear/Ice/ObjectAdapterF.php
+share/pear/Ice/ObjectFactory.php
+share/pear/Ice/ObjectFactoryF.php
+share/pear/Ice/Plugin.php
+share/pear/Ice/PluginF.php
+share/pear/Ice/Process.php
+share/pear/Ice/ProcessF.php
+share/pear/Ice/Properties.php
+share/pear/Ice/PropertiesF.php
+share/pear/Ice/Router.php
+share/pear/Ice/RouterF.php
+share/pear/Ice/SliceChecksumDict.php
+share/pear/Ice/Stats.php
+share/pear/Ice/StatsF.php
+share/pear/Ice/Version.php
+share/pear/IceBox.php
+share/pear/IceBox/IceBox.php
+share/pear/IceGrid.php
+share/pear/IceGrid/Admin.php
+share/pear/IceGrid/Descriptor.php
+share/pear/IceGrid/Exception.php
+share/pear/IceGrid/FileParser.php
+share/pear/IceGrid/Locator.php
+share/pear/IceGrid/Observer.php
+share/pear/IceGrid/Query.php
+share/pear/IceGrid/Registry.php
+share/pear/IceGrid/Session.php
+share/pear/IceGrid/UserAccountMapper.php
+share/pear/IcePatch2.php
+share/pear/IcePatch2/FileInfo.php
+share/pear/IcePatch2/FileServer.php
+share/pear/IceStorm.php
+share/pear/IceStorm/IceStorm.php
+share/pear/IceStorm/Metrics.php
+@dirrmtry share/pear/Glacier2
+@dirrmtry share/pear/Ice
+@dirrmtry share/pear/IceBox
+@dirrmtry share/pear/IceGrid
+@dirrmtry share/pear/IcePatch2
+@dirrmtry share/pear/IceStorm
+@dirrmtry share/pear
 @dirrmtry lib/php/%%PHP_EXT_DIR%%
