diff options
23 files changed, 371 insertions, 60 deletions
diff --git a/Mk/bsd.php.mk b/Mk/bsd.php.mk index 0a2d70576061..4a23315074fd 100644 --- a/Mk/bsd.php.mk +++ b/Mk/bsd.php.mk @@ -102,7 +102,7 @@ check-makevars:: @${ECHO_CMD} "or WANT_PHP_MOD. Use only one of them." @${FALSE} . else -. if defined(PHP_VERSION) && ${PHP_SAPI:Mcgi} == "" && ${PHP_SAPI:Mmod} == "" +. if defined(PHP_VERSION) && ${PHP_SAPI:Mcgi} == "" && ${PHP_SAPI:Mfpm} == "" && ${PHP_SAPI:Mmod} == "" check-makevars:: @${ECHO_CMD} "This port requires the Apache Module or the CGI version of PHP, but you have" @${ECHO_CMD} "already installed a PHP port without them." @@ -112,7 +112,7 @@ check-makevars:: .else .if defined(WANT_PHP_CGI) -. if defined(PHP_VERSION) && ${PHP_SAPI:Mcgi} == "" +. if defined(PHP_VERSION) && ${PHP_SAPI:Mcgi} == "" && ${PHP_SAPI:Mfpm} == "" check-makevars:: @${ECHO_CMD} "This port requires the CGI version of PHP, but you have already" @${ECHO_CMD} "installed a PHP port without CGI." diff --git a/databases/php5-dba/files/patch-config.m4 b/databases/php5-dba/files/patch-config.m4 index 02761b927e42..348c70ed3173 100644 --- a/databases/php5-dba/files/patch-config.m4 +++ b/databases/php5-dba/files/patch-config.m4 @@ -1,9 +1,17 @@ ---- config.m4.orig 2007-12-06 15:17:43.000000000 +0100 -+++ config.m4 2008-12-11 12:50:27.000000000 +0100 -@@ -280,6 +280,34 @@ +--- config.m4.orig 2010-06-09 19:33:44.000000000 +0200 ++++ config.m4 2010-07-26 15:58:40.000000000 +0200 +@@ -285,6 +285,42 @@ THIS_PREFIX=$i THIS_INCLUDE=$i/db4/db.h break ++ elif test -f "$i/include/db50/db.h"; then ++ THIS_PREFIX=$i ++ THIS_INCLUDE=$i/include/db50/db.h ++ break ++ elif test -f "$i/include/db48/db.h"; then ++ THIS_PREFIX=$i ++ THIS_INCLUDE=$i/include/db48/db.h ++ break + elif test -f "$i/include/db47/db.h"; then + THIS_PREFIX=$i + THIS_INCLUDE=$i/include/db47/db.h @@ -32,15 +40,6 @@ + THIS_PREFIX=$i + THIS_INCLUDE=$i/include/db41/db.h + break - elif test -f "$i/include/db4.6/db.h"; then + elif test -f "$i/include/db5.0/db.h"; then THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db4.6/db.h -@@ -306,7 +334,7 @@ - break - fi - done -- PHP_DBA_DB_CHECK(4, db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)]) -+ PHP_DBA_DB_CHECK(4, db-4.7 db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)]) - fi - PHP_DBA_STD_RESULT(db4,Berkeley DB4) - + THIS_INCLUDE=$i/include/db5.0/db.h diff --git a/databases/php5-mysqli/files/patch-php_mysqli_structs.h b/databases/php5-mysqli/files/patch-php_mysqli_structs.h new file mode 100644 index 000000000000..d0daeee9ee54 --- /dev/null +++ b/databases/php5-mysqli/files/patch-php_mysqli_structs.h @@ -0,0 +1,10 @@ +--- php_mysqli_structs.h.orig 2010-07-26 15:52:54.000000000 +0200 ++++ php_mysqli_structs.h 2010-07-26 15:53:14.000000000 +0200 +@@ -54,6 +54,7 @@ + #define WE_HAD_MBSTATE_T + #endif + ++#define HAVE_ULONG 1 + #include <my_global.h> + + #if !defined(HAVE_MBRLEN) && defined(WE_HAD_MBRLEN) diff --git a/databases/php5-sybase_ct/files/patch-config.m4 b/databases/php5-sybase_ct/files/patch-config.m4 deleted file mode 100644 index ef121d7c4730..000000000000 --- a/databases/php5-sybase_ct/files/patch-config.m4 +++ /dev/null @@ -1,11 +0,0 @@ ---- config.m4.orig 2009-03-26 09:53:49.000000000 +0100 -+++ config.m4 2009-03-26 09:55:35.000000000 +0100 -@@ -31,7 +31,7 @@ - fi - - PHP_ADD_LIBPATH($SYBASE_CT_LIBDIR, SYBASE_CT_SHARED_LIBADD) -- if test -f $SYBASE_CT_INCDIR/tds.h; then -+ if test -f $SYBASE_CT_INCDIR/tds_sysdep_public.h; then - PHP_ADD_LIBRARY(ct,, SYBASE_CT_SHARED_LIBADD) - SYBASE_CT_LIBS="-L$SYBASE_CT_LIBDIR -lct" - else diff --git a/lang/php5/Makefile b/lang/php5/Makefile index dc506b278157..84a9d96511ca 100644 --- a/lang/php5/Makefile +++ b/lang/php5/Makefile @@ -6,8 +6,8 @@ # PORTNAME= php5 -PORTVERSION= 5.3.2 -PORTREVISION?= 1 +PORTVERSION= 5.3.3 +PORTREVISION?= 0 CATEGORIES?= lang devel www MASTER_SITES= ${MASTER_SITE_PHP} MASTER_SITE_SUBDIR= distributions @@ -27,6 +27,7 @@ LIB_DEPENDS= pcre.0:${PORTSDIR}/devel/pcre CONFIGURE_ARGS= \ --with-layout=GNU \ + --localstatedir=/var \ --with-config-file-scan-dir=${PREFIX}/etc/php \ --disable-all \ --enable-libxml \ @@ -38,7 +39,9 @@ USE_GNOME= libxml2 OPTIONS= CLI "Build CLI version" on \ CGI "Build CGI version" on \ + FPM "Build FPM version (experimental)" off \ APACHE "Build Apache module" off \ + AP2FILTER " Use Apache 2.x filter interface (experimental)" off \ DEBUG "Enable debug" off \ SUHOSIN "Enable Suhosin protection system" on \ MULTIBYTE "Enable zend multibyte support" off \ @@ -55,7 +58,7 @@ MAN1= php-config.1 phpize.1 PATCH_DIST_STRIP= -p1 .if !defined(WITHOUT_SUHOSIN) -PATCHFILES+= suhosin-patch-${PORTVERSION}-0.9.9.1.patch.gz:suhosin +PATCHFILES+= suhosin-patch-${PORTVERSION}-0.9.10.patch.gz:suhosin PATCH_SITES+= http://download.suhosin.org/:suhosin PLIST_SUB+= SUHOSIN="" .else @@ -63,7 +66,8 @@ PLIST_SUB+= SUHOSIN="@comment " .endif .if defined(WITH_MAILHEAD) -PATCHFILES+= php-${PORTVERSION}-mail-header.patch:mail +#PATCHFILES+= php-${PORTVERSION}-mail-header.patch:mail +PATCHFILES+= php-5.3.2-mail-header.patch:mail PATCH_SITES+= http://choon.net/opensource/php/:mail .endif @@ -84,12 +88,30 @@ PLIST_SUB+= CGI="@comment " CONFIGURE_ARGS+=--disable-cgi .endif +.if defined(WITH_FPM) +PHP_SAPI+= fpm +LIB_DEPENDS+= event-1.4:${PORTSDIR}/devel/libevent +MAN1+= php-fpm.1 +USE_RC_SUBR+= php-fpm +CONFIGURE_ARGS+=--enable-fpm \ + --with-fpm-user=${WWWOWN} \ + --with-fpm-group=${WWWGRP} \ + --with-libevent-dir=${LOCALBASE} +PLIST_SUB+= FPM="" +.else +PLIST_SUB+= FPM="@comment " +.endif + .if defined(WITH_APACHE) PHP_SAPI+= mod USE_APACHE= 1.3+ .include "${PORTSDIR}/Mk/bsd.apache.mk" .if ${APACHE_VERSION} > 13 +.if defined(WITH_AP2FILTER) +CONFIGURE_ARGS+=--with-apxs2filter=${APXS} +.else CONFIGURE_ARGS+=--with-apxs2=${APXS} +.endif .else CONFIGURE_ARGS+=--with-apxs=${APXS} .endif @@ -139,6 +161,10 @@ CONFIGURE_ARGS+=--disable-ipv6 post-patch: @${TOUCH} ${WRKSRC}/ext/php_config.h @${REINPLACE_CMD} "s|^\(extension_dir\)|; \1|" ${WRKSRC}/php.ini-* +.if defined(WITH_FPM) + @${REINPLACE_CMD} -e "s|^;\(pid\)|\1|;s|^;\(pm\.[a-z_]*_servers\)|\1|" \ + ${WRKSRC}/sapi/fpm/php-fpm.conf.in +.endif pre-configure: @${CAT} ${WRKSRC}/acinclude.m4 ${WRKSRC}/build/libtool.m4 > ${WRKSRC}/aclocal.m4 @@ -157,6 +183,9 @@ post-install: @${INSTALL_DATA} ${WRKSRC}/php.ini-production ${PREFIX}/etc @${INSTALL_DATA} ${WRKDIR}/php.conf ${PREFIX}/etc @${TOUCH} ${PREFIX}/include/php/ext/php_config.h +.if defined(WITH_FPM) + @${CP} -n ${PREFIX}/etc/php-fpm.conf.default ${PREFIX}/etc/php-fpm.conf +.endif .if defined(WITH_APACHE) @${CAT} ${PKGMESSAGE} .endif diff --git a/lang/php5/distinfo b/lang/php5/distinfo index 2a2b7d17372a..f8f7094648af 100644 --- a/lang/php5/distinfo +++ b/lang/php5/distinfo @@ -1,9 +1,9 @@ -MD5 (php-5.3.2.tar.bz2) = 46f500816125202c48a458d0133254a4 -SHA256 (php-5.3.2.tar.bz2) = 9a380a574adcb3a9abe3226e7c3a9bae619e8a1b90842ec2a7edf0ad92afdeda -SIZE (php-5.3.2.tar.bz2) = 10477662 -MD5 (suhosin-patch-5.3.2-0.9.9.1.patch.gz) = 4647b05330862d6a1fc4469245cc6ade -SHA256 (suhosin-patch-5.3.2-0.9.9.1.patch.gz) = a61f081022888bf78997e434744d6c0604194c73a00e70c1165524a0a6329de2 -SIZE (suhosin-patch-5.3.2-0.9.9.1.patch.gz) = 40847 +MD5 (php-5.3.3.tar.bz2) = 21ceeeb232813c10283a5ca1b4c87b48 +SHA256 (php-5.3.3.tar.bz2) = f2876750f3c54854a20e26a03ca229f2fbf89b8ee6176b9c0586cb9b2f0b3f9a +SIZE (php-5.3.3.tar.bz2) = 10662227 +MD5 (suhosin-patch-5.3.3-0.9.10.patch.gz) = b66b27c43b1332400ef8982944c3b95b +SHA256 (suhosin-patch-5.3.3-0.9.10.patch.gz) = f48489ff7d3fd3fc30429f7349f181c84caf2e03e672eb2d2b55b46adf6f602c +SIZE (suhosin-patch-5.3.3-0.9.10.patch.gz) = 41298 MD5 (php-5.3.2-mail-header.patch) = 012d8c4637422e724d5559513fcaaacb SHA256 (php-5.3.2-mail-header.patch) = 3c9faeef9080330a23286f787efec8489587c619d8910d70926359f1a9306d6c SIZE (php-5.3.2-mail-header.patch) = 3350 diff --git a/lang/php5/files/patch-acinclude.m4 b/lang/php5/files/patch-acinclude.m4 index 4f9a9462f947..d92738cdf776 100644 --- a/lang/php5/files/patch-acinclude.m4 +++ b/lang/php5/files/patch-acinclude.m4 @@ -5,11 +5,11 @@ dnl which array to append to? AC_DEFUN([PHP_ADD_SOURCES],[ - PHP_ADD_SOURCES_X($1, $2, $3, ifelse($4,cli,PHP_CLI_OBJS,ifelse($4,sapi,PHP_SAPI_OBJS,PHP_GLOBAL_OBJS))) -+ PHP_ADD_SOURCES_X($1, $2, $3, ifelse($4,cli,PHP_CLI_OBJS,ifelse($4,sapi,PHP_SAPI_OBJS,ifelse($4,cgi,PHP_CGI_OBJS,PHP_GLOBAL_OBJS)))) ++ PHP_ADD_SOURCES_X($1, $2, $3, ifelse($4,cli,PHP_CLI_OBJS,ifelse($4,sapi,PHP_SAPI_OBJS,ifelse($4,cgi,PHP_CGI_OBJS,ifelse($4,fpm,PHP_FPM_OBJS,PHP_GLOBAL_OBJS))))) ]) dnl -@@ -968,15 +968,8 @@ +@@ -968,15 +968,9 @@ if test "$3" != "shared" && test "$3" != "yes" && test "$4" = "cli"; then dnl ---------------------------------------------- CLI static module [PHP_]translit($1,a-z_-,A-Z__)[_SHARED]=no @@ -23,10 +23,11 @@ - ;; - esac + PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,cgi) ++ PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,fpm) EXT_CLI_STATIC="$EXT_CLI_STATIC $1" fi PHP_ADD_BUILD_DIR($ext_builddir) -@@ -1026,12 +1019,6 @@ +@@ -1026,12 +1020,6 @@ build to be successful. ]) fi @@ -39,7 +40,7 @@ dnl Some systems require that we link $2 to $1 when building ]) -@@ -2303,9 +2290,9 @@ +@@ -2303,9 +2291,9 @@ test -z "$PHP_IMAP_SSL" && PHP_IMAP_SSL=no dnl Fallbacks for different configure options diff --git a/lang/php5/files/patch-configure.in b/lang/php5/files/patch-configure.in index 3cdb4241f6a2..a37ca5c6e327 100644 --- a/lang/php5/files/patch-configure.in +++ b/lang/php5/files/patch-configure.in @@ -31,7 +31,7 @@ -all_targets="$lcov_target \$(OVERALL_TARGET) \$(PHP_MODULES) \$(PHP_ZEND_EX) \$(PHP_CLI_TARGET) $pharcmd" -install_targets="$install_modules install-build install-headers install-programs $install_pear $pharcmd_install" -+all_targets="$lcov_target \$(OVERALL_TARGET) \$(PHP_MODULES) \$(PHP_ZEND_EX) \$(PHP_CLI_TARGET) \$(PHP_CGI_TARGET) $pharcmd" ++all_targets="$lcov_target \$(OVERALL_TARGET) \$(PHP_MODULES) \$(PHP_ZEND_EX) \$(PHP_CLI_TARGET) \$(PHP_CGI_TARGET) \$(PHP_FPM_TARGET) $pharcmd" +install_targets="$PHP_INSTALL_CLI_TARGET $PHP_INSTALL_CGI_TARGET $install_modules install-build install-headers install-programs $install_pear $pharcmd_install" case $PHP_SAPI in @@ -40,7 +40,7 @@ - ;; - *) - install_targets="install-sapi $PHP_INSTALL_CLI_TARGET $install_targets" -+ apache|apache2handler) ++ apache|apache2handler|apache2filter) + install_targets="install-sapi $install_targets" ;; esac diff --git a/lang/php5/files/patch-sapi_apache2filter_config.m4 b/lang/php5/files/patch-sapi_apache2filter_config.m4 new file mode 100644 index 000000000000..48a46efa6796 --- /dev/null +++ b/lang/php5/files/patch-sapi_apache2filter_config.m4 @@ -0,0 +1,11 @@ +--- sapi/apache2filter/config.m4.orig 2010-07-26 13:06:55.000000000 +0200 ++++ sapi/apache2filter/config.m4 2010-07-26 13:07:19.000000000 +0200 +@@ -118,7 +118,7 @@ + ;; + esac + +- if test "$APXS_MPM" != "prefork" && test "$APXS_MPM" != "peruser"; then ++ if test "$APXS_MPM" != "prefork" && test "$APXS_MPM" != "peruser" && test "$APXS_MPM" != "itk"; then + PHP_BUILD_THREAD_SAFE + fi + AC_MSG_RESULT(yes) diff --git a/lang/php5/files/patch-sapi_fpm_Makefile.frag b/lang/php5/files/patch-sapi_fpm_Makefile.frag new file mode 100644 index 000000000000..205537ef04e2 --- /dev/null +++ b/lang/php5/files/patch-sapi_fpm_Makefile.frag @@ -0,0 +1,19 @@ +--- sapi/fpm/Makefile.frag.orig 2010-07-27 15:57:32.000000000 +0200 ++++ sapi/fpm/Makefile.frag 2010-07-27 15:57:06.000000000 +0200 +@@ -3,14 +3,14 @@ + $(builddir)/fpm: + @mkdir -p $(builddir)/fpm + +-$(SAPI_FPM_PATH): $(builddir)/fpm $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(SAPI_EXTRA_DEPS) ++$(SAPI_FPM_PATH): $(builddir)/fpm $(PHP_GLOBAL_OBJS) $(PHP_FPM_OBJS) $(FPM_EXTRA_DEPS) + $(BUILD_FPM) + + $(builddir)/fpm/fpm_conf.lo: $(builddir)/../../main/build-defs.h + + install-build: install-fpm + +-install-fpm: install-sapi ++install-fpm: + @echo "Installing PHP FPM binary: $(INSTALL_ROOT)$(sbindir)/" + @$(mkinstalldirs) $(INSTALL_ROOT)$(sbindir) + @$(mkinstalldirs) $(INSTALL_ROOT)$(localstatedir)/log diff --git a/lang/php5/files/patch-sapi_fpm_config.m4 b/lang/php5/files/patch-sapi_fpm_config.m4 new file mode 100644 index 000000000000..91c8744adede --- /dev/null +++ b/lang/php5/files/patch-sapi_fpm_config.m4 @@ -0,0 +1,50 @@ +--- sapi/fpm/config.m4.orig 2010-06-16 10:58:42.000000000 +0200 ++++ sapi/fpm/config.m4 2010-07-27 13:26:02.000000000 +0200 +@@ -562,10 +562,12 @@ + + PHP_FPM_CFLAGS="$LIBEVENT_CFLAGS -I$abs_srcdir/sapi/fpm" + +- SAPI_EXTRA_LIBS="$LIBEVENT_LIBS" +- PHP_SUBST(SAPI_EXTRA_LIBS) +- +- INSTALL_IT=":" ++ FPM_EXTRA_LIBS="$LIBEVENT_LIBS" ++ PHP_SUBST(FPM_EXTRA_LIBS) ++ ++ if test "$PHP_SAPI" = "default"; then ++ PHP_SAPI="fpm" ++ fi + PHP_FPM_FILES="fpm/fastcgi.c \ + fpm/fpm.c \ + fpm/fpm_children.c \ +@@ -590,7 +592,8 @@ + fpm/zlog.c \ + " + +- PHP_SELECT_SAPI(fpm, program, $PHP_FPM_FILES $PHP_FPM_TRACE_FILES, $PHP_FPM_CFLAGS, '$(SAPI_FPM_PATH)') ++ PHP_ADD_SOURCES(sapi/fpm, $PHP_FPM_FILES $PHP_FPM_TRACE_FILES, $PHP_FPM_CFLAGS, fpm) ++ PHP_ADD_SOURCES(/main, internal_functions.c,,fpm) + + case $host_alias in + *aix*) +@@ -600,11 +603,19 @@ + BUILD_FPM="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_SAPI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(SAPI_EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_FPM_PATH)" + ;; + *) +- BUILD_FPM="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(SAPI_EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_FPM_PATH)" ++ BUILD_FPM="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_FPM_OBJS) \$(EXTRA_LIBS) \$(FPM_EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_FPM_PATH)" + ;; + esac + ++ PHP_FPM_TARGET="\$(SAPI_FPM_PATH)" ++ PHP_INSTALL_FPM_TARGET="install-fpm" + PHP_SUBST(BUILD_FPM) ++ PHP_SUBST(PHP_FPM_OBJS) ++ PHP_SUBST(PHP_FPM_TARGET) ++ PHP_SUBST(PHP_INSTALL_FPM_TARGET) ++ if test "$PHP_SAPI" = "fpm" ; then ++ PHP_BUILD_PROGRAM($SAPI_FPM_PATH) ++ fi + else + AC_MSG_RESULT(no) + fi diff --git a/lang/php5/files/php-fpm.in b/lang/php5/files/php-fpm.in new file mode 100644 index 000000000000..af61d9364ca0 --- /dev/null +++ b/lang/php5/files/php-fpm.in @@ -0,0 +1,43 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: php-fpm +# REQUIRE: LOGIN +# KEYWORD: shutdown + +# +# Add the following line to /etc/rc.conf to enable php-fpm: +# php_fpm_enable="YES" +# + +. /etc/rc.subr + +name="php_fpm" +rcvar=`set_rcvar` + +load_rc_config "$name" + +: ${php_fpm_enable="NO"} + +extra_commands="reload logrotate" + +command="%%PREFIX%%/sbin/php-fpm" +pidfile="/var/run/php-fpm.pid" +sig_stop="QUIT" +sig_reload="USR2" +logrotate_cmd="php_fpm_logrotate" + +required_files="%%PREFIX%%/etc/php-fpm.conf" + +php_fpm_logrotate() { + if [ -z "$rc_pid" ]; then + _run_rc_notrunning + return 1 + fi + echo "Rotating logs $name." + kill -USR1 $rc_pid +} + +run_rc_command "$1" diff --git a/lang/php5/pkg-plist b/lang/php5/pkg-plist index d1324e25bad8..966415cee3ab 100644 --- a/lang/php5/pkg-plist +++ b/lang/php5/pkg-plist @@ -2,9 +2,13 @@ %%CGI%%bin/php-cgi bin/php-config bin/phpize +%%FPM%%sbin/php-fpm etc/php.conf etc/php.ini-development etc/php.ini-production +%%FPM%%@unexec if cmp -s %D/etc/php-fpm.conf %D/etc/php-fpm.conf.default; then rm -f %D/etc/php-fpm.conf; fi +%%FPM%%etc/php-fpm.conf.default +%%FPM%%@exec cp -n %D/%F %B/php-fpm.conf include/php/TSRM/TSRM.h include/php/TSRM/acconfig.h include/php/TSRM/readdir.h diff --git a/lang/php53/Makefile b/lang/php53/Makefile index dc506b278157..84a9d96511ca 100644 --- a/lang/php53/Makefile +++ b/lang/php53/Makefile @@ -6,8 +6,8 @@ # PORTNAME= php5 -PORTVERSION= 5.3.2 -PORTREVISION?= 1 +PORTVERSION= 5.3.3 +PORTREVISION?= 0 CATEGORIES?= lang devel www MASTER_SITES= ${MASTER_SITE_PHP} MASTER_SITE_SUBDIR= distributions @@ -27,6 +27,7 @@ LIB_DEPENDS= pcre.0:${PORTSDIR}/devel/pcre CONFIGURE_ARGS= \ --with-layout=GNU \ + --localstatedir=/var \ --with-config-file-scan-dir=${PREFIX}/etc/php \ --disable-all \ --enable-libxml \ @@ -38,7 +39,9 @@ USE_GNOME= libxml2 OPTIONS= CLI "Build CLI version" on \ CGI "Build CGI version" on \ + FPM "Build FPM version (experimental)" off \ APACHE "Build Apache module" off \ + AP2FILTER " Use Apache 2.x filter interface (experimental)" off \ DEBUG "Enable debug" off \ SUHOSIN "Enable Suhosin protection system" on \ MULTIBYTE "Enable zend multibyte support" off \ @@ -55,7 +58,7 @@ MAN1= php-config.1 phpize.1 PATCH_DIST_STRIP= -p1 .if !defined(WITHOUT_SUHOSIN) -PATCHFILES+= suhosin-patch-${PORTVERSION}-0.9.9.1.patch.gz:suhosin +PATCHFILES+= suhosin-patch-${PORTVERSION}-0.9.10.patch.gz:suhosin PATCH_SITES+= http://download.suhosin.org/:suhosin PLIST_SUB+= SUHOSIN="" .else @@ -63,7 +66,8 @@ PLIST_SUB+= SUHOSIN="@comment " .endif .if defined(WITH_MAILHEAD) -PATCHFILES+= php-${PORTVERSION}-mail-header.patch:mail +#PATCHFILES+= php-${PORTVERSION}-mail-header.patch:mail +PATCHFILES+= php-5.3.2-mail-header.patch:mail PATCH_SITES+= http://choon.net/opensource/php/:mail .endif @@ -84,12 +88,30 @@ PLIST_SUB+= CGI="@comment " CONFIGURE_ARGS+=--disable-cgi .endif +.if defined(WITH_FPM) +PHP_SAPI+= fpm +LIB_DEPENDS+= event-1.4:${PORTSDIR}/devel/libevent +MAN1+= php-fpm.1 +USE_RC_SUBR+= php-fpm +CONFIGURE_ARGS+=--enable-fpm \ + --with-fpm-user=${WWWOWN} \ + --with-fpm-group=${WWWGRP} \ + --with-libevent-dir=${LOCALBASE} +PLIST_SUB+= FPM="" +.else +PLIST_SUB+= FPM="@comment " +.endif + .if defined(WITH_APACHE) PHP_SAPI+= mod USE_APACHE= 1.3+ .include "${PORTSDIR}/Mk/bsd.apache.mk" .if ${APACHE_VERSION} > 13 +.if defined(WITH_AP2FILTER) +CONFIGURE_ARGS+=--with-apxs2filter=${APXS} +.else CONFIGURE_ARGS+=--with-apxs2=${APXS} +.endif .else CONFIGURE_ARGS+=--with-apxs=${APXS} .endif @@ -139,6 +161,10 @@ CONFIGURE_ARGS+=--disable-ipv6 post-patch: @${TOUCH} ${WRKSRC}/ext/php_config.h @${REINPLACE_CMD} "s|^\(extension_dir\)|; \1|" ${WRKSRC}/php.ini-* +.if defined(WITH_FPM) + @${REINPLACE_CMD} -e "s|^;\(pid\)|\1|;s|^;\(pm\.[a-z_]*_servers\)|\1|" \ + ${WRKSRC}/sapi/fpm/php-fpm.conf.in +.endif pre-configure: @${CAT} ${WRKSRC}/acinclude.m4 ${WRKSRC}/build/libtool.m4 > ${WRKSRC}/aclocal.m4 @@ -157,6 +183,9 @@ post-install: @${INSTALL_DATA} ${WRKSRC}/php.ini-production ${PREFIX}/etc @${INSTALL_DATA} ${WRKDIR}/php.conf ${PREFIX}/etc @${TOUCH} ${PREFIX}/include/php/ext/php_config.h +.if defined(WITH_FPM) + @${CP} -n ${PREFIX}/etc/php-fpm.conf.default ${PREFIX}/etc/php-fpm.conf +.endif .if defined(WITH_APACHE) @${CAT} ${PKGMESSAGE} .endif diff --git a/lang/php53/distinfo b/lang/php53/distinfo index 2a2b7d17372a..f8f7094648af 100644 --- a/lang/php53/distinfo +++ b/lang/php53/distinfo @@ -1,9 +1,9 @@ -MD5 (php-5.3.2.tar.bz2) = 46f500816125202c48a458d0133254a4 -SHA256 (php-5.3.2.tar.bz2) = 9a380a574adcb3a9abe3226e7c3a9bae619e8a1b90842ec2a7edf0ad92afdeda -SIZE (php-5.3.2.tar.bz2) = 10477662 -MD5 (suhosin-patch-5.3.2-0.9.9.1.patch.gz) = 4647b05330862d6a1fc4469245cc6ade -SHA256 (suhosin-patch-5.3.2-0.9.9.1.patch.gz) = a61f081022888bf78997e434744d6c0604194c73a00e70c1165524a0a6329de2 -SIZE (suhosin-patch-5.3.2-0.9.9.1.patch.gz) = 40847 +MD5 (php-5.3.3.tar.bz2) = 21ceeeb232813c10283a5ca1b4c87b48 +SHA256 (php-5.3.3.tar.bz2) = f2876750f3c54854a20e26a03ca229f2fbf89b8ee6176b9c0586cb9b2f0b3f9a +SIZE (php-5.3.3.tar.bz2) = 10662227 +MD5 (suhosin-patch-5.3.3-0.9.10.patch.gz) = b66b27c43b1332400ef8982944c3b95b +SHA256 (suhosin-patch-5.3.3-0.9.10.patch.gz) = f48489ff7d3fd3fc30429f7349f181c84caf2e03e672eb2d2b55b46adf6f602c +SIZE (suhosin-patch-5.3.3-0.9.10.patch.gz) = 41298 MD5 (php-5.3.2-mail-header.patch) = 012d8c4637422e724d5559513fcaaacb SHA256 (php-5.3.2-mail-header.patch) = 3c9faeef9080330a23286f787efec8489587c619d8910d70926359f1a9306d6c SIZE (php-5.3.2-mail-header.patch) = 3350 diff --git a/lang/php53/files/patch-acinclude.m4 b/lang/php53/files/patch-acinclude.m4 index 4f9a9462f947..d92738cdf776 100644 --- a/lang/php53/files/patch-acinclude.m4 +++ b/lang/php53/files/patch-acinclude.m4 @@ -5,11 +5,11 @@ dnl which array to append to? AC_DEFUN([PHP_ADD_SOURCES],[ - PHP_ADD_SOURCES_X($1, $2, $3, ifelse($4,cli,PHP_CLI_OBJS,ifelse($4,sapi,PHP_SAPI_OBJS,PHP_GLOBAL_OBJS))) -+ PHP_ADD_SOURCES_X($1, $2, $3, ifelse($4,cli,PHP_CLI_OBJS,ifelse($4,sapi,PHP_SAPI_OBJS,ifelse($4,cgi,PHP_CGI_OBJS,PHP_GLOBAL_OBJS)))) ++ PHP_ADD_SOURCES_X($1, $2, $3, ifelse($4,cli,PHP_CLI_OBJS,ifelse($4,sapi,PHP_SAPI_OBJS,ifelse($4,cgi,PHP_CGI_OBJS,ifelse($4,fpm,PHP_FPM_OBJS,PHP_GLOBAL_OBJS))))) ]) dnl -@@ -968,15 +968,8 @@ +@@ -968,15 +968,9 @@ if test "$3" != "shared" && test "$3" != "yes" && test "$4" = "cli"; then dnl ---------------------------------------------- CLI static module [PHP_]translit($1,a-z_-,A-Z__)[_SHARED]=no @@ -23,10 +23,11 @@ - ;; - esac + PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,cgi) ++ PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,fpm) EXT_CLI_STATIC="$EXT_CLI_STATIC $1" fi PHP_ADD_BUILD_DIR($ext_builddir) -@@ -1026,12 +1019,6 @@ +@@ -1026,12 +1020,6 @@ build to be successful. ]) fi @@ -39,7 +40,7 @@ dnl Some systems require that we link $2 to $1 when building ]) -@@ -2303,9 +2290,9 @@ +@@ -2303,9 +2291,9 @@ test -z "$PHP_IMAP_SSL" && PHP_IMAP_SSL=no dnl Fallbacks for different configure options diff --git a/lang/php53/files/patch-configure.in b/lang/php53/files/patch-configure.in index 3cdb4241f6a2..a37ca5c6e327 100644 --- a/lang/php53/files/patch-configure.in +++ b/lang/php53/files/patch-configure.in @@ -31,7 +31,7 @@ -all_targets="$lcov_target \$(OVERALL_TARGET) \$(PHP_MODULES) \$(PHP_ZEND_EX) \$(PHP_CLI_TARGET) $pharcmd" -install_targets="$install_modules install-build install-headers install-programs $install_pear $pharcmd_install" -+all_targets="$lcov_target \$(OVERALL_TARGET) \$(PHP_MODULES) \$(PHP_ZEND_EX) \$(PHP_CLI_TARGET) \$(PHP_CGI_TARGET) $pharcmd" ++all_targets="$lcov_target \$(OVERALL_TARGET) \$(PHP_MODULES) \$(PHP_ZEND_EX) \$(PHP_CLI_TARGET) \$(PHP_CGI_TARGET) \$(PHP_FPM_TARGET) $pharcmd" +install_targets="$PHP_INSTALL_CLI_TARGET $PHP_INSTALL_CGI_TARGET $install_modules install-build install-headers install-programs $install_pear $pharcmd_install" case $PHP_SAPI in @@ -40,7 +40,7 @@ - ;; - *) - install_targets="install-sapi $PHP_INSTALL_CLI_TARGET $install_targets" -+ apache|apache2handler) ++ apache|apache2handler|apache2filter) + install_targets="install-sapi $install_targets" ;; esac diff --git a/lang/php53/files/patch-sapi_apache2filter_config.m4 b/lang/php53/files/patch-sapi_apache2filter_config.m4 new file mode 100644 index 000000000000..48a46efa6796 --- /dev/null +++ b/lang/php53/files/patch-sapi_apache2filter_config.m4 @@ -0,0 +1,11 @@ +--- sapi/apache2filter/config.m4.orig 2010-07-26 13:06:55.000000000 +0200 ++++ sapi/apache2filter/config.m4 2010-07-26 13:07:19.000000000 +0200 +@@ -118,7 +118,7 @@ + ;; + esac + +- if test "$APXS_MPM" != "prefork" && test "$APXS_MPM" != "peruser"; then ++ if test "$APXS_MPM" != "prefork" && test "$APXS_MPM" != "peruser" && test "$APXS_MPM" != "itk"; then + PHP_BUILD_THREAD_SAFE + fi + AC_MSG_RESULT(yes) diff --git a/lang/php53/files/patch-sapi_fpm_Makefile.frag b/lang/php53/files/patch-sapi_fpm_Makefile.frag new file mode 100644 index 000000000000..205537ef04e2 --- /dev/null +++ b/lang/php53/files/patch-sapi_fpm_Makefile.frag @@ -0,0 +1,19 @@ +--- sapi/fpm/Makefile.frag.orig 2010-07-27 15:57:32.000000000 +0200 ++++ sapi/fpm/Makefile.frag 2010-07-27 15:57:06.000000000 +0200 +@@ -3,14 +3,14 @@ + $(builddir)/fpm: + @mkdir -p $(builddir)/fpm + +-$(SAPI_FPM_PATH): $(builddir)/fpm $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(SAPI_EXTRA_DEPS) ++$(SAPI_FPM_PATH): $(builddir)/fpm $(PHP_GLOBAL_OBJS) $(PHP_FPM_OBJS) $(FPM_EXTRA_DEPS) + $(BUILD_FPM) + + $(builddir)/fpm/fpm_conf.lo: $(builddir)/../../main/build-defs.h + + install-build: install-fpm + +-install-fpm: install-sapi ++install-fpm: + @echo "Installing PHP FPM binary: $(INSTALL_ROOT)$(sbindir)/" + @$(mkinstalldirs) $(INSTALL_ROOT)$(sbindir) + @$(mkinstalldirs) $(INSTALL_ROOT)$(localstatedir)/log diff --git a/lang/php53/files/patch-sapi_fpm_config.m4 b/lang/php53/files/patch-sapi_fpm_config.m4 new file mode 100644 index 000000000000..91c8744adede --- /dev/null +++ b/lang/php53/files/patch-sapi_fpm_config.m4 @@ -0,0 +1,50 @@ +--- sapi/fpm/config.m4.orig 2010-06-16 10:58:42.000000000 +0200 ++++ sapi/fpm/config.m4 2010-07-27 13:26:02.000000000 +0200 +@@ -562,10 +562,12 @@ + + PHP_FPM_CFLAGS="$LIBEVENT_CFLAGS -I$abs_srcdir/sapi/fpm" + +- SAPI_EXTRA_LIBS="$LIBEVENT_LIBS" +- PHP_SUBST(SAPI_EXTRA_LIBS) +- +- INSTALL_IT=":" ++ FPM_EXTRA_LIBS="$LIBEVENT_LIBS" ++ PHP_SUBST(FPM_EXTRA_LIBS) ++ ++ if test "$PHP_SAPI" = "default"; then ++ PHP_SAPI="fpm" ++ fi + PHP_FPM_FILES="fpm/fastcgi.c \ + fpm/fpm.c \ + fpm/fpm_children.c \ +@@ -590,7 +592,8 @@ + fpm/zlog.c \ + " + +- PHP_SELECT_SAPI(fpm, program, $PHP_FPM_FILES $PHP_FPM_TRACE_FILES, $PHP_FPM_CFLAGS, '$(SAPI_FPM_PATH)') ++ PHP_ADD_SOURCES(sapi/fpm, $PHP_FPM_FILES $PHP_FPM_TRACE_FILES, $PHP_FPM_CFLAGS, fpm) ++ PHP_ADD_SOURCES(/main, internal_functions.c,,fpm) + + case $host_alias in + *aix*) +@@ -600,11 +603,19 @@ + BUILD_FPM="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_SAPI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(SAPI_EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_FPM_PATH)" + ;; + *) +- BUILD_FPM="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(SAPI_EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_FPM_PATH)" ++ BUILD_FPM="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_FPM_OBJS) \$(EXTRA_LIBS) \$(FPM_EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_FPM_PATH)" + ;; + esac + ++ PHP_FPM_TARGET="\$(SAPI_FPM_PATH)" ++ PHP_INSTALL_FPM_TARGET="install-fpm" + PHP_SUBST(BUILD_FPM) ++ PHP_SUBST(PHP_FPM_OBJS) ++ PHP_SUBST(PHP_FPM_TARGET) ++ PHP_SUBST(PHP_INSTALL_FPM_TARGET) ++ if test "$PHP_SAPI" = "fpm" ; then ++ PHP_BUILD_PROGRAM($SAPI_FPM_PATH) ++ fi + else + AC_MSG_RESULT(no) + fi diff --git a/lang/php53/files/php-fpm.in b/lang/php53/files/php-fpm.in new file mode 100644 index 000000000000..af61d9364ca0 --- /dev/null +++ b/lang/php53/files/php-fpm.in @@ -0,0 +1,43 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: php-fpm +# REQUIRE: LOGIN +# KEYWORD: shutdown + +# +# Add the following line to /etc/rc.conf to enable php-fpm: +# php_fpm_enable="YES" +# + +. /etc/rc.subr + +name="php_fpm" +rcvar=`set_rcvar` + +load_rc_config "$name" + +: ${php_fpm_enable="NO"} + +extra_commands="reload logrotate" + +command="%%PREFIX%%/sbin/php-fpm" +pidfile="/var/run/php-fpm.pid" +sig_stop="QUIT" +sig_reload="USR2" +logrotate_cmd="php_fpm_logrotate" + +required_files="%%PREFIX%%/etc/php-fpm.conf" + +php_fpm_logrotate() { + if [ -z "$rc_pid" ]; then + _run_rc_notrunning + return 1 + fi + echo "Rotating logs $name." + kill -USR1 $rc_pid +} + +run_rc_command "$1" diff --git a/lang/php53/pkg-plist b/lang/php53/pkg-plist index d1324e25bad8..966415cee3ab 100644 --- a/lang/php53/pkg-plist +++ b/lang/php53/pkg-plist @@ -2,9 +2,13 @@ %%CGI%%bin/php-cgi bin/php-config bin/phpize +%%FPM%%sbin/php-fpm etc/php.conf etc/php.ini-development etc/php.ini-production +%%FPM%%@unexec if cmp -s %D/etc/php-fpm.conf %D/etc/php-fpm.conf.default; then rm -f %D/etc/php-fpm.conf; fi +%%FPM%%etc/php-fpm.conf.default +%%FPM%%@exec cp -n %D/%F %B/php-fpm.conf include/php/TSRM/TSRM.h include/php/TSRM/acconfig.h include/php/TSRM/readdir.h diff --git a/math/php5-gmp/Makefile b/math/php5-gmp/Makefile index 692c59dfdcc5..76a3cac8a415 100644 --- a/math/php5-gmp/Makefile +++ b/math/php5-gmp/Makefile @@ -5,7 +5,6 @@ # $FreeBSD$ # -PORTREVISION= 1 CATEGORIES= math MASTERDIR= ${.CURDIR}/../../lang/php5 |