diff options
author | ale <ale@FreeBSD.org> | 2010-07-27 23:13:54 +0800 |
---|---|---|
committer | ale <ale@FreeBSD.org> | 2010-07-27 23:13:54 +0800 |
commit | 056af63857f7a8cd8b08d1b9adeea479041b294e (patch) | |
tree | 7d867dd93b2a9cbbeaf76fbc988c5cedbef5d9bd /lang/php5 | |
parent | c8bbaa422da7834b6e094849b4b852618f4382eb (diff) | |
download | freebsd-ports-gnome-056af63857f7a8cd8b08d1b9adeea479041b294e.tar.gz freebsd-ports-gnome-056af63857f7a8cd8b08d1b9adeea479041b294e.tar.zst freebsd-ports-gnome-056af63857f7a8cd8b08d1b9adeea479041b294e.zip |
Update to 5.3.3 release:
- add FPM sapi (experimental) [1]
- add apache2filter sapi (experimental)
PR: ports/148956 [1]
Submitted by: mm
Diffstat (limited to 'lang/php5')
-rw-r--r-- | lang/php5/Makefile | 37 | ||||
-rw-r--r-- | lang/php5/distinfo | 12 | ||||
-rw-r--r-- | lang/php5/files/patch-acinclude.m4 | 9 | ||||
-rw-r--r-- | lang/php5/files/patch-configure.in | 4 | ||||
-rw-r--r-- | lang/php5/files/patch-sapi_apache2filter_config.m4 | 11 | ||||
-rw-r--r-- | lang/php5/files/patch-sapi_fpm_Makefile.frag | 19 | ||||
-rw-r--r-- | lang/php5/files/patch-sapi_fpm_config.m4 | 50 | ||||
-rw-r--r-- | lang/php5/files/php-fpm.in | 43 | ||||
-rw-r--r-- | lang/php5/pkg-plist | 4 |
9 files changed, 173 insertions, 16 deletions
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 |