Skip to content

Commit

Permalink
make sure to read the correct php configuraion file, noticed by ajaco…
Browse files Browse the repository at this point in the history
…utot@
  • Loading branch information
rnagy committed Jul 14, 2011
1 parent e331622 commit 447c212
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 29 deletions.
6 changes: 3 additions & 3 deletions lang/php/5.2/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.13 2011/07/09 00:41:44 robert Exp $
# $OpenBSD: Makefile,v 1.14 2011/07/14 12:40:48 robert Exp $

# doesn't set USE_LIBTOOL but use the bundled one because it needs some
# specific options we don't have.
Expand All @@ -9,8 +9,8 @@ SUHOSIN_PHPV= 5.2.16
SUHOSIN_P_V= 0.9.7

REVISION= 3
REVISION-main= 3
REVISION-fastcgi= 4
REVISION-main= 4
REVISION-fastcgi= 5

INI_TEMPLATES= dist recommended

Expand Down
12 changes: 12 additions & 0 deletions lang/php/5.2/patches/patch-main_php_ini_c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$OpenBSD: patch-main_php_ini_c,v 1.1 2011/07/14 12:40:48 robert Exp $
--- main/php_ini.c.orig.port Thu Jul 14 13:33:12 2011
+++ main/php_ini.c Thu Jul 14 13:07:26 2011
@@ -489,7 +489,7 @@ int php_init_config(TSRMLS_D)

/* If still no ini file found, search for php.ini file in search path */
if (!fh.handle.fp) {
- fh.handle.fp = php_fopen_with_path("php.ini", "r", php_ini_search_path, &php_ini_opened_path TSRMLS_CC);
+ fh.handle.fp = php_fopen_with_path("php-${PV}.ini", "r", php_ini_search_path, &php_ini_opened_path TSRMLS_CC);
if (fh.handle.fp) {
fh.filename = php_ini_opened_path;
}
8 changes: 2 additions & 6 deletions lang/php/5.2/pkg/PLIST-main
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
@comment $OpenBSD: PLIST-main,v 1.4 2011/05/12 14:30:12 robert Exp $
@comment $OpenBSD: PLIST-main,v 1.5 2011/07/14 12:40:48 robert Exp $
@option no-default-conflict
@conflict php->=5.2,<5.3
@conflict php5-core->=5.2
@pkgpath lang/php/5.2
@pkgpath www/php5/core,-main
@pkgpath www/php5/extensions,-mbstring
%%SHARED%%
@comment @exec install -d ${PHP_CONFIG_PATH}/php-${PV}/
@comment @exec install -d ${PHP_CONFIG_PATH}/php-${PV}.sample/
@exec install -d ${SYSCONFDIR}/php-${PV}/
@exec install -d ${SYSCONFDIR}/php-${PV}.sample/
!%%no_suhosin%%
@mode 1700
@owner www
@group www
@sample /var/www/tmp/
@comment @extraunexec rm -fr ${PHP_CONFIG_PATH}/php-${PV}/
@comment @unexec-delete rm -fr ${PHP_CONFIG_PATH}/php-${PV}.sample/
@extraunexec rm -fr ${SYSCONFDIR}/php-${PV}/
@unexec-delete rm -fr ${SYSCONFDIR}/php-${PV}.sample/
@mode
Expand All @@ -32,7 +28,7 @@ lib/php-${PV}/modules/
@man man/man1/phpize-${PV}.1
share/examples/php-${PV}/
share/examples/php-${PV}/php.conf
@sample ${PHP_CONFIG_PATH}/modules.sample/php-${PV}.conf
@sample /var/www/conf/modules.sample/php-${PV}.conf
share/examples/php-${PV}/php.ini-dist
share/examples/php-${PV}/php.ini-recommended
@sample ${SYSCONFDIR}/php-${PV}.ini
Expand Down
5 changes: 3 additions & 2 deletions lang/php/5.3/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# $OpenBSD: Makefile,v 1.11 2011/07/09 00:41:44 robert Exp $
# $OpenBSD: Makefile,v 1.12 2011/07/14 12:40:48 robert Exp $

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

REVISION-fastcgi= 0
REVISION-main= 0
REVISION-fastcgi= 1

INI_TEMPLATES= development production

Expand Down
12 changes: 12 additions & 0 deletions lang/php/5.3/patches/patch-main_php_ini_c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$OpenBSD: patch-main_php_ini_c,v 1.1 2011/07/14 12:40:48 robert Exp $
--- main/php_ini.c.orig.port Thu Jul 14 13:33:12 2011
+++ main/php_ini.c Thu Jul 14 13:07:26 2011
@@ -489,7 +489,7 @@ int php_init_config(TSRMLS_D)

/* If still no ini file found, search for php.ini file in search path */
if (!fh.handle.fp) {
- fh.handle.fp = php_fopen_with_path("php.ini", "r", php_ini_search_path, &php_ini_opened_path TSRMLS_CC);
+ fh.handle.fp = php_fopen_with_path("php-${PV}.ini", "r", php_ini_search_path, &php_ini_opened_path TSRMLS_CC);
if (fh.handle.fp) {
fh.filename = php_ini_opened_path;
}
8 changes: 2 additions & 6 deletions lang/php/5.3/pkg/PLIST-main
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
@comment $OpenBSD: PLIST-main,v 1.5 2011/05/12 14:30:12 robert Exp $
@comment $OpenBSD: PLIST-main,v 1.6 2011/07/14 12:40:48 robert Exp $
@option no-default-conflict
@conflict php->=5.3,<5.4
@conflict php5-core->=5.2
@conflict php5-core-fastcgi->=5.2
@pkgpath lang/php/5.3
%%SHARED%%
@comment @exec install -d ${PHP_CONFIG_PATH}/php-${PV}/
@comment @exec install -d ${PHP_CONFIG_PATH}/php-${PV}.sample/
@exec install -d ${SYSCONFDIR}/php-${PV}/
@exec install -d ${SYSCONFDIR}/php-${PV}.sample/
!%%no_suhosin%%
@mode 1700
@owner www
@group www
@sample /var/www/tmp/
@comment @extraunexec rm -fr ${PHP_CONFIG_PATH}/php-${PV}/
@comment @unexec-delete rm -fr ${PHP_CONFIG_PATH}/php-${PV}.sample/
@extraunexec rm -fr ${SYSCONFDIR}/php-${PV}/
@unexec-delete rm -fr ${SYSCONFDIR}/php-${PV}.sample/
@mode
Expand All @@ -31,7 +27,7 @@ lib/php-${PV}/modules/
@man man/man1/phpize-${PV}.1
share/examples/php-${PV}/
share/examples/php-${PV}/php.conf
@sample ${PHP_CONFIG_PATH}/modules.sample/php-${PV}.conf
@sample /var/www/conf/modules.sample/php-${PV}.conf
share/examples/php-${PV}/php.ini-development
share/examples/php-${PV}/php.ini-production
@sample ${SYSCONFDIR}/php-${PV}.ini
Expand Down
12 changes: 6 additions & 6 deletions lang/php/Makefile.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $OpenBSD: Makefile.inc,v 1.15 2011/07/09 00:41:44 robert Exp $
# $OpenBSD: Makefile.inc,v 1.16 2011/07/14 12:40:48 robert Exp $

# This port currently only works with archs supporting dynamic loading
# and has Apache that supports DSO's.
Expand Down Expand Up @@ -36,8 +36,7 @@ PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes

PHP_CONFIG_PATH= /var/www/conf
PHP_CONFIG_FILE= ${PHP_CONFIG_PATH}/php-${PV}.ini
MODPHP_CONFIG_PATH= /var/www/conf

# where the main php module is stored (outside the chroot)
APACHE_MODULE_SUBDIR= lib/php-${PV}
Expand Down Expand Up @@ -68,7 +67,7 @@ MAKE_ENV= ${CONFIGURE_ENV}
CONFIGURE_ARGS+= --enable-shared \
--disable-static \
--disable-rpath \
--with-config-file-path=${PHP_CONFIG_PATH} \
--with-config-file-path=${SYSCONFDIR} \
--enable-inline-optimization \
--with-pic \
--with-pear=${LOCALBASE}/share/php-${PV} \
Expand Down Expand Up @@ -300,10 +299,10 @@ LIB_DEPENDS-xsl= textproc/libxslt
WANTLIB-xsl= ${MODLIBICONV_WANTLIB} m xml2 z xslt>=3 exslt

# some variables to substitute
SUBST_VARS= PHP_CONFIG_FILE PHP_CONFIG_PATH PV ^MODULE_NAME
SUBST_VARS= MODPHP_CONFIG_PATH PV ^MODULE_NAME
PHP_VERSION= ${V}

.for i in TRUEPREFIX PHP_CONFIG_FILE MODULES_DIR PHP_VERSION APACHE_MODULE_DIR
.for i in TRUEPREFIX MODULES_DIR PHP_VERSION APACHE_MODULE_DIR
PHPXS_SUBST+= -e 's,${i},${${i}},'
.endfor

Expand Down Expand Up @@ -336,6 +335,7 @@ INSTALL_TARGET= install-headers install-build install-programs
DESTDIRNAME= INSTALL_ROOT

pre-configure:
${SUBST_CMD} ${WRKSRC}/main/php_ini.c
@perl -pi -e "s,OPENBSD_PEAR_ROOT,'${CHROOT_DIR}/pear',g" \
${WRKSRC}/scripts/phpize.in \
${WRKSRC}/scripts/php-config.in
Expand Down
8 changes: 4 additions & 4 deletions lang/php/files/MESSAGE-main
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
To enable the php-${PV} module please create a symbolic
link from ${PHP_CONFIG_PATH}/modules.sample/php-${PV}.conf
to ${PHP_CONFIG_PATH}/modules/php-${PV}.conf.
link from ${MODPHP_CONFIG_PATH}/modules.sample/php-${PV}.conf
to ${MODPHP_CONFIG_PATH}/modules/php-${PV}.conf.

ln -s ${PHP_CONFIG_PATH}/modules.sample/php-${PV}.conf \
${PHP_CONFIG_PATH}/modules/php.conf
ln -s ${MODPHP_CONFIG_PATH}/modules.sample/php-${PV}.conf \
${MODPHP_CONFIG_PATH}/modules/php.conf

The recommended php configuration has been installed
to ${SYSCONFDIR}/php-${PV}.ini.
4 changes: 2 additions & 2 deletions lang/php/files/UNMESSAGE-main
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
To completely deinstall the package you need to
remove the symbolic link from ${PHP_CONFIG_PATH}/modules
remove the symbolic link from ${MODPHP_CONFIG_PATH}/modules
by performing the following step as root:

rm -rf ${PHP_CONFIG_PATH}/modules/php.conf
rm -rf ${MODPHP_CONFIG_PATH}/modules/php.conf

0 comments on commit 447c212

Please sign in to comment.