Skip to content

Commit

Permalink
update php/5.3 to 5.3.8 and enable fpm support. the original fpm diff
Browse files Browse the repository at this point in the history
was from william@ but i had a slightly different approach of implementing
it in the port itself.
  • Loading branch information
rnagy committed Aug 27, 2011
1 parent 3b37ec5 commit f5ea2e4
Show file tree
Hide file tree
Showing 12 changed files with 138 additions and 53 deletions.
20 changes: 15 additions & 5 deletions lang/php/5.3/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# $OpenBSD: Makefile,v 1.14 2011/07/22 10:28:54 sthen Exp $
# $OpenBSD: Makefile,v 1.15 2011/08/27 13:13:13 robert Exp $

PV= 5.3
V= ${PV}.6
V= ${PV}.8
SUHOSIN_PHPV= ${V}
SUHOSIN_P_V= 0.9.10

REVISION-main= 1
REVISION-fastcgi= 2

INI_TEMPLATES= development production

# fpm
PKGNAME-fpm?= php-fpm-${V}
MULTI_PACKAGES+= -fpm
COMMENT-fpm= stand-alone FPM version of PHP
CONFIGURE_ARGS+= --enable-fpm \
--localstatedir=/var \
--with-fpm-user=www \
--with-fpm-group=www
LIB_DEPENDS-fpm= ${LIB_DEPENDS-main}
WANTLIB-fpm= ${WANTLIB-main}
RUN_DEPENDS-fpm= ${RUN_DEPENDS-main} \
php-${V}:lang/php/${PV}

.include <bsd.port.mk>
20 changes: 10 additions & 10 deletions lang/php/5.3/distinfo
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
MD5 (php-5.3.6.tar.gz) = iKKwAEe8U6+7vfEOviilfg==
MD5 (php-5.3.8.tar.gz) = 9M5A1dFWymapltu4oOdmag==
MD5 (suhosin-0.9.32.1.tar.gz) = JqhvD2hKZWw+eJ4+tOwdsw==
MD5 (suhosin-patch-5.3.6-0.9.10.patch.gz) = qjp7nadDlx4b1/T/nASLHA==
RMD160 (php-5.3.6.tar.gz) = WNtkT6w9TL/gnobONyp5vWOxj1M=
MD5 (suhosin-patch-5.3.8-0.9.10.patch.gz) = CFguUC/tgiHGV3BCykXduA==
RMD160 (php-5.3.8.tar.gz) = 7wt3tRKoD/tj+YOkr/IomIaAFEk=
RMD160 (suhosin-0.9.32.1.tar.gz) = YYTu8za509XIhafR3L8g2XsFXo0=
RMD160 (suhosin-patch-5.3.6-0.9.10.patch.gz) = 2WxsTCkahBFQfms2nFkKvruNmeE=
SHA1 (php-5.3.6.tar.gz) = mrzepFjAlseJUEcn6QcG1whel1U=
RMD160 (suhosin-patch-5.3.8-0.9.10.patch.gz) = GfeJv0ml/tLNiLGZ/YrF0f+pvcg=
SHA1 (php-5.3.8.tar.gz) = CtG8v+0BQtFyLsID4myxDvUkxwQ=
SHA1 (suhosin-0.9.32.1.tar.gz) = k/yx1flmkcTFCAihTdPW1Lv+pFE=
SHA1 (suhosin-patch-5.3.6-0.9.10.patch.gz) = jcLHUUEr3JIfVnn639rcZq0phow=
SHA256 (php-5.3.6.tar.gz) = UhqdFAtMqzJK7O7TFAmnl94gaAhCBxAW1gzFrjzJRi4=
SHA1 (suhosin-patch-5.3.8-0.9.10.patch.gz) = PDjoc1hLj54yWoE8ybGXo0JZUJk=
SHA256 (php-5.3.8.tar.gz) = vRdSgiYNSZMkmdom5a6NgejlQSOuIuFv/JbJ7e6Ojw8=
SHA256 (suhosin-0.9.32.1.tar.gz) = 0oOry9GAPqoRu9kctarnJ7K7qzoAod6FEPhdjMWY5JA=
SHA256 (suhosin-patch-5.3.6-0.9.10.patch.gz) = SLgVHqRB5JpD86dRsKqc73334FWUizNdCRaN8DGUP1E=
SIZE (php-5.3.6.tar.gz) = 14368718
SHA256 (suhosin-patch-5.3.8-0.9.10.patch.gz) = Cg2sDkNDWW8r/O8n3PcYBSS3i7HS0sqHg3Cn0PgxPSY=
SIZE (php-5.3.8.tar.gz) = 14789551
SIZE (suhosin-0.9.32.1.tar.gz) = 119117
SIZE (suhosin-patch-5.3.6-0.9.10.patch.gz) = 40024
SIZE (suhosin-patch-5.3.8-0.9.10.patch.gz) = 41175
19 changes: 10 additions & 9 deletions lang/php/5.3/patches/patch-aclocal_m4
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
$OpenBSD: patch-aclocal_m4,v 1.4 2011/06/18 19:49:50 sthen Exp $
--- aclocal.m4.orig.port Wed Jan 5 16:41:34 2011
+++ aclocal.m4 Sat Jun 18 12:17:01 2011
$OpenBSD: patch-aclocal_m4,v 1.5 2011/08/27 13:13:13 robert Exp $
--- aclocal.m4.orig.port Thu Mar 17 03:55:54 2011
+++ aclocal.m4 Sat Aug 6 21:37:33 2011
@@ -194,7 +194,7 @@ dnl the path is interpreted relative to the top build-
dnl
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
@@ -973,15 +973,7 @@ dnl ---------------------------------------------- Sha
@@ -973,15 +973,8 @@ dnl ---------------------------------------------- Sha
if test "$3" != "shared" && test "$3" != "yes" && test "$4" = "cli"; then
dnl ---------------------------------------------- CLI static module
[PHP_]translit($1,a-z_-,A-Z__)[_SHARED]=no
Expand All @@ -24,10 +24,11 @@ $OpenBSD: patch-aclocal_m4,v 1.4 2011/06/18 19:49:50 sthen Exp $
- ;;
- 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)
@@ -1031,12 +1023,6 @@ You either need to build $1 shared or build $2 statica
@@ -1031,12 +1024,6 @@ You either need to build $1 shared or build $2 statica
build to be successful.
])
fi
Expand All @@ -40,7 +41,7 @@ $OpenBSD: patch-aclocal_m4,v 1.4 2011/06/18 19:49:50 sthen Exp $
dnl Some systems require that we link $2 to $1 when building
])

@@ -2279,10 +2265,9 @@ AC_DEFUN([PHP_SETUP_KERBEROS],[
@@ -2280,10 +2267,9 @@ AC_DEFUN([PHP_SETUP_KERBEROS],[
if test "$PHP_KERBEROS_DIR"; then
found_kerberos=yes
PHP_ADD_LIBPATH($PHP_KERBEROS_DIR/$PHP_LIBDIR, $1)
Expand All @@ -53,7 +54,7 @@ $OpenBSD: patch-aclocal_m4,v 1.4 2011/06/18 19:49:50 sthen Exp $
PHP_ADD_INCLUDE($PHP_KERBEROS_DIR/include)
fi
fi
@@ -2330,7 +2315,7 @@ AC_DEFUN([PHP_SETUP_OPENSSL],[
@@ -2331,7 +2317,7 @@ AC_DEFUN([PHP_SETUP_OPENSSL],[
AC_MSG_ERROR([OpenSSL version 0.9.6 or greater required.])
fi

Expand All @@ -62,7 +63,7 @@ $OpenBSD: patch-aclocal_m4,v 1.4 2011/06/18 19:49:50 sthen Exp $
PHP_EVAL_LIBLINE($OPENSSL_LIBS, $1)
PHP_EVAL_INCLINE($OPENSSL_INCS)
fi
@@ -4324,7 +4309,7 @@ bsdi[[45]]*)
@@ -4325,7 +4311,7 @@ bsdi[[45]]*)
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
Expand Down
8 changes: 4 additions & 4 deletions lang/php/5.3/patches/patch-configure_in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$OpenBSD: patch-configure_in,v 1.3 2011/06/18 19:49:50 sthen Exp $
--- configure.in.orig.port Sat Jun 18 12:14:45 2011
+++ configure.in Sat Jun 18 12:17:01 2011
$OpenBSD: patch-configure_in,v 1.4 2011/08/27 13:13:13 robert Exp $
--- configure.in.orig.port Sat Aug 6 21:37:30 2011
+++ configure.in Sat Aug 6 21:46:07 2011
@@ -960,7 +960,7 @@ enable_static=yes

case $php_build_target in
Expand Down Expand Up @@ -37,7 +37,7 @@ $OpenBSD: patch-configure_in,v 1.3 2011/06/18 19:49:50 sthen Exp $
fi;

-all_targets="$lcov_target \$(OVERALL_TARGET) \$(PHP_MODULES) \$(PHP_ZEND_EX) \$(PHP_CLI_TARGET) $pharcmd"
+all_targets="$lcov_target \$(OVERALL_TARGET) \$(PHP_MODULES) \$(PHP_CLI_TARGET) \$(PHP_CGI_TARGET) $pharcmd"
+all_targets="$lcov_target \$(OVERALL_TARGET) \$(PHP_MODULES) \$(PHP_CLI_TARGET) \$(PHP_CGI_TARGET) \$(PHP_FPM_TARGET) $pharcmd"
install_targets="$install_modules install-build install-headers install-programs $install_pear $pharcmd_install"

case $PHP_SAPI in
Expand Down
26 changes: 9 additions & 17 deletions lang/php/5.3/patches/patch-ext_gd_config_m4
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
$OpenBSD: patch-ext_gd_config_m4,v 1.3 2011/06/18 19:49:50 sthen Exp $
--- ext/gd/config.m4.orig.port Wed May 27 09:18:24 2009
+++ ext/gd/config.m4 Sat Jun 18 12:14:48 2011
@@ -108,13 +108,13 @@ AC_DEFUN([PHP_GD_PNG],[
AC_MSG_ERROR([PNG support requires ZLIB. Use --with-zlib-dir=<DIR>])
fi
--- ext/gd/config.m4.orig.port Thu Aug 25 19:09:16 2011
+++ ext/gd/config.m4 Thu Aug 25 19:10:18 2011
@@ -97,7 +97,7 @@
if test "$PHP_PNG_DIR" != "no"; then

- if test ! -f $GD_PNG_DIR/include/png.h; then
+ if test ! -f $GD_PNG_DIR/include/libpng/png.h; then
AC_MSG_ERROR([png.h not found.])
fi
for i in $PHP_PNG_DIR /usr/local /usr; do
- test -f $i/include/png.h && GD_PNG_DIR=$i && break
+ test -f $i/include/libpng/png.h && GD_PNG_DIR=$i && break
done

PHP_CHECK_LIBRARY(png,png_write_image,
[
- PHP_ADD_INCLUDE($GD_PNG_DIR/include)
+ PHP_ADD_INCLUDE($GD_PNG_DIR/include/libpng)
PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(png, $GD_PNG_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
],[
if test -z "$GD_PNG_DIR"; then
9 changes: 4 additions & 5 deletions lang/php/5.3/patches/patch-ext_openssl_config0_m4
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
$OpenBSD: patch-ext_openssl_config0_m4,v 1.2 2011/06/18 19:49:50 sthen Exp $
--- ext/openssl/config0.m4.orig.port Sun Jan 7 18:38:22 2007
+++ ext/openssl/config0.m4 Sat Jun 18 12:14:50 2011
@@ -16,7 +16,7 @@ if test "$PHP_OPENSSL" != "no"; then
--- ext/openssl/config0.m4.orig.port Thu Aug 25 19:08:39 2011
+++ ext/openssl/config0.m4 Thu Aug 25 19:09:03 2011
@@ -16,7 +16,7 @@
PHP_SETUP_KERBEROS(OPENSSL_SHARED_LIBADD)
fi

- AC_CHECK_LIB(ssl, DSA_get_default_method, AC_DEFINE(HAVE_DSA_DEFAULT_METHOD, 1, [OpenSSL 0.9.7 or later]))
+ AC_CHECK_LIB(ssl, DSA_get_default_method, AC_DEFINE(HAVE_DSA_DEFAULT_METHOD, 1, [OpenSSL 0.9.7 or later]),, [-lcrypto])
AC_CHECK_LIB(crypto, X509_free, AC_DEFINE(HAVE_DSA_DEFAULT_METHOD, 1, [OpenSSL 0.9.7 or later]))

PHP_SETUP_OPENSSL(OPENSSL_SHARED_LIBADD,
[
11 changes: 11 additions & 0 deletions lang/php/5.3/patches/patch-sapi_fpm_Makefile_frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- sapi/fpm/Makefile.frag.orig.port Thu Aug 25 19:33:35 2011
+++ sapi/fpm/Makefile.frag Thu Aug 25 19:33:53 2011
@@ -3,7 +3,7 @@
$(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) $(SAPI_EXTRA_DEPS)
$(BUILD_FPM)

$(builddir)/fpm/fpm_conf.lo: $(builddir)/../../main/build-defs.h
44 changes: 44 additions & 0 deletions lang/php/5.3/patches/patch-sapi_fpm_config_m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
--- sapi/fpm/config.m4.orig.port Sun Jun 26 17:48:11 2011
+++ sapi/fpm/config.m4 Thu Aug 25 19:35:16 2011
@@ -423,7 +423,9 @@

PHP_FPM_CFLAGS="-I$abs_srcdir/sapi/fpm"

- INSTALL_IT=":"
+ if test "$PHP_SAPI" = "default"; then
+ PHP_SAPI="fpm"
+ fi
PHP_FPM_FILES="fpm/fastcgi.c \
fpm/fpm.c \
fpm/fpm_children.c \
@@ -449,7 +451,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*)
@@ -459,11 +462,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) \$(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
3 changes: 3 additions & 0 deletions lang/php/5.3/pkg/DESCR-fpm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI
implementation with some additional features useful for sites of
any size, especially busier sites.
6 changes: 6 additions & 0 deletions lang/php/5.3/pkg/PLIST-fpm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@comment $OpenBSD: PLIST-fpm,v 1.1 2011/08/27 13:13:13 robert Exp $
@man man/man8/php-fpm-${PV}.8
@bin sbin/php-fpm-${PV}
share/examples/php-${PV}/php-fpm.conf
@sample ${SYSCONFDIR}/php-fpm.conf
@rcscript ${RCDIR}/php_fpm
15 changes: 15 additions & 0 deletions lang/php/5.3/pkg/php_fpm.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
#
# $OpenBSD: php_fpm.rc,v 1.1 2011/08/27 13:13:13 robert Exp $

daemon="${TRUEPREFIX}/sbin/php-fpm-${PV}"

. /etc/rc.d/rc.subr

pexp="php-fpm-${PV}: master.*"

rc_reload() {
pkill -USR2 -f "^${pexp}"
}

rc_cmd $1
10 changes: 7 additions & 3 deletions lang/php/Makefile.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $OpenBSD: Makefile.inc,v 1.18 2011/07/22 10:19:23 sthen Exp $
# $OpenBSD: Makefile.inc,v 1.19 2011/08/27 13:13:13 robert Exp $

# This port currently only works with archs supporting dynamic loading
# and has Apache that supports DSO's.
Expand Down Expand Up @@ -341,7 +341,7 @@ pre-configure:
${WRKSRC}/scripts/phpize.in \
${WRKSRC}/scripts/php-config.in

.for i in ${MULTI_PACKAGES:N-main:N-fastcgi:S/-//g}
.for i in ${MULTI_PACKAGES:N-main:N-fastcgi:N-fpm:S/-//g}
MODULE_NAME-${i}= ${i}
DESCR-${i}= ${.CURDIR}/../files/DESCR-${i}
MESSAGE-${i}= ${.CURDIR}/../files/MESSAGE-ext
Expand All @@ -367,12 +367,16 @@ post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/php-${PV}
${INSTALL_PROGRAM} ${WRKBUILD}/sapi/cli/php ${PREFIX}/bin/php-${PV}
${INSTALL_PROGRAM} ${WRKBUILD}/sapi/cgi/php-cgi ${PREFIX}/bin/php-fastcgi-${PV}
.if ${V:M5.3*}
${INSTALL_DATA} ${WRKBUILD}/sapi/fpm/php-fpm.conf \
${PREFIX}/share/examples/php-${PV}/php-fpm.conf
.endif
${INSTALL_DATA} ${.CURDIR}/../files/php.conf \
${PREFIX}/share/examples/php-${PV}/php.conf
@perl -pi -e "s,!!PREFIX!!,${TRUEPREFIX},g;s,!!PV!!,${PV},g" \
${PREFIX}/share/examples/php-${PV}/php.conf

.for m in ${MULTI_PACKAGES:N-main:N-fastcgi:S/-//g}
.for m in ${MULTI_PACKAGES:N-main:N-fastcgi:N-fpm:S/-//g}
${INSTALL_DATA} ${WRKBUILD}/modules/${m}.so \
${PREFIX}/${MODULES_SUBDIR}/${m}.so
echo "extension=${m}.so" > \
Expand Down

0 comments on commit f5ea2e4

Please sign in to comment.