From f45382eec92fcf9251b39ab4a891c05bee1021af Mon Sep 17 00:00:00 2001 From: sthen Date: Fri, 19 Nov 2021 12:46:59 +0000 Subject: [PATCH] De-conflict php-apache and php-embed which had the same libphpX.so filename and directory. This moves the module for Apache httpd from lib/php-X.Y/libphpX.so to lib/apache2/php-X.Y/libphpX.so. The installed /var/www/conf/modules.sample/php-X.Y.conf is of course updated to reflect the change, however if anyone uses php-apache and doesn't follow the recommended config symlink they will need to adapt their config. --- lang/php/7.4/Makefile | 4 +-- lang/php/7.4/pkg/PLIST-apache | 5 ++-- lang/php/7.4/pkg/PLIST-embed | 4 +-- lang/php/8.0/Makefile | 3 +- lang/php/8.0/pkg/PLIST-apache | 5 ++-- lang/php/8.0/pkg/PLIST-embed | 4 +-- lang/php/Makefile.inc | 55 ++++++++++++++++------------------- lang/php/files/php.conf | 2 +- 8 files changed, 40 insertions(+), 42 deletions(-) diff --git a/lang/php/7.4/Makefile b/lang/php/7.4/Makefile index 90632aa8ea0..ad6ce8ec10f 100644 --- a/lang/php/7.4/Makefile +++ b/lang/php/7.4/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.39 2021/11/19 11:29:04 sthen Exp $ +# $OpenBSD: Makefile,v 1.40 2021/11/19 12:47:00 sthen Exp $ PORTROACH= limit:^7\.4 PHP_VERSION= 7.4.26 @@ -6,7 +6,7 @@ PHP_VERSION= 7.4.26 DEFAULT_PHP= Yes PHP_PKGSPEC= <7.5 # keep >= 0 for 7.0->7.1 -REVISION= 1 +REVISION= 2 DEBUG_PACKAGES= ${BUILD_PACKAGES} diff --git a/lang/php/7.4/pkg/PLIST-apache b/lang/php/7.4/pkg/PLIST-apache index 2755dbe710e..41a277fc0fd 100644 --- a/lang/php/7.4/pkg/PLIST-apache +++ b/lang/php/7.4/pkg/PLIST-apache @@ -1,4 +1,4 @@ -@comment $OpenBSD: PLIST-apache,v 1.4 2021/11/19 10:31:13 sthen Exp $ +@comment $OpenBSD: PLIST-apache,v 1.5 2021/11/19 12:47:00 sthen Exp $ @option no-default-conflict @option is-branch @conflict php-apache-${PHP_PKGSPEC} @@ -7,7 +7,8 @@ @pkgpath lang/php/7.1,-apache @pkgpath lang/php/7.2,-apache @pkgpath lang/php/7.3,-apache -@so lib/php-${PV}/libphp7.so +${APACHE_DIR}/ +@so ${APACHE_DIR}/${SAPI_SO} @sample ${MODPHP_CONFIG_PATH}/modules.sample/ share/examples/php-${PV}/modphp.conf @sample ${MODPHP_CONFIG_PATH}/modules.sample/php-${PV}.conf diff --git a/lang/php/7.4/pkg/PLIST-embed b/lang/php/7.4/pkg/PLIST-embed index 0a7f21710ff..a6a84bf3a0e 100644 --- a/lang/php/7.4/pkg/PLIST-embed +++ b/lang/php/7.4/pkg/PLIST-embed @@ -1,7 +1,7 @@ -@comment $OpenBSD: PLIST-embed,v 1.3 2021/11/19 10:31:13 sthen Exp $ +@comment $OpenBSD: PLIST-embed,v 1.4 2021/11/19 12:47:00 sthen Exp $ @option no-default-conflict @option is-branch @conflict php-embed-${PHP_PKGSPEC} -@so lib/php-${PV}/libphp${MV}.so +@so lib/php-${PV}/${SAPI_SO} share/php-${PV}/include/sapi/embed/ share/php-${PV}/include/sapi/embed/php_embed.h diff --git a/lang/php/8.0/Makefile b/lang/php/8.0/Makefile index 0234768dbee..81266cba2fa 100644 --- a/lang/php/8.0/Makefile +++ b/lang/php/8.0/Makefile @@ -1,8 +1,9 @@ -# $OpenBSD: Makefile,v 1.16 2021/11/19 09:56:25 sthen Exp $ +# $OpenBSD: Makefile,v 1.17 2021/11/19 12:47:00 sthen Exp $ PORTROACH= limit:^8\.0 PHP_VERSION= 8.0.13 PHP_PKGSPEC= >=8.0,<8.1 +REVISION= 0 DEBUG_PACKAGES= ${BUILD_PACKAGES} diff --git a/lang/php/8.0/pkg/PLIST-apache b/lang/php/8.0/pkg/PLIST-apache index 9642ae43607..8351697b2e2 100644 --- a/lang/php/8.0/pkg/PLIST-apache +++ b/lang/php/8.0/pkg/PLIST-apache @@ -1,8 +1,9 @@ -@comment $OpenBSD: PLIST-apache,v 1.1 2021/02/24 19:13:50 sthen Exp $ +@comment $OpenBSD: PLIST-apache,v 1.2 2021/11/19 12:47:00 sthen Exp $ @option no-default-conflict @option is-branch @conflict php-apache-${PHP_PKGSPEC} -@so lib/php-${PV}/libphp.so +${APACHE_DIR}/ +@so ${APACHE_DIR}/${SAPI_SO} @sample ${MODPHP_CONFIG_PATH}/modules.sample/ share/examples/php-${PV}/modphp.conf @sample ${MODPHP_CONFIG_PATH}/modules.sample/php-${PV}.conf diff --git a/lang/php/8.0/pkg/PLIST-embed b/lang/php/8.0/pkg/PLIST-embed index fa94dcbbd48..8d7a039881c 100644 --- a/lang/php/8.0/pkg/PLIST-embed +++ b/lang/php/8.0/pkg/PLIST-embed @@ -1,7 +1,7 @@ -@comment $OpenBSD: PLIST-embed,v 1.1 2021/10/20 20:45:59 sthen Exp $ +@comment $OpenBSD: PLIST-embed,v 1.2 2021/11/19 12:47:00 sthen Exp $ @option no-default-conflict @option is-branch @conflict php-embed-${PHP_PKGSPEC} -@so lib/php-${PV}/libphp${MV}.so +@so lib/php-${PV}/${SAPI_SO} share/php-${PV}/include/sapi/embed/ share/php-${PV}/include/sapi/embed/php_embed.h diff --git a/lang/php/Makefile.inc b/lang/php/Makefile.inc index b184495d458..da3bec17256 100644 --- a/lang/php/Makefile.inc +++ b/lang/php/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.167 2021/11/19 11:29:04 sthen Exp $ +# $OpenBSD: Makefile.inc,v 1.168 2021/11/19 12:46:59 sthen Exp $ BROKEN-hppa= no __sync_bool_compare_and_swap support nor asm fallback @@ -32,10 +32,6 @@ PERMIT_PACKAGE= Yes MODPHP_CONFIG_PATH= /var/www/conf -# where the main php module is stored (outside the chroot) -APACHE_MODULE_SUBDIR= lib/php-${PV} -APACHE_MODULE_DIR= ${LOCALBASE}/${APACHE_MODULE_SUBDIR} - # where the PEAR and extension modules are (inside the chroot) CHROOT_DIR?= /var/www MODULES_SUBDIR= lib/php-${PV}/modules @@ -127,11 +123,16 @@ PSEUDO_FLAVORS= ${PHP_EXTENSIONS:C/-(pdo_)?mysqli?//:C/-(pcntl|shmop|zip)//:C/- PSEUDO_FLAVORS+= embed FLAVOR ?= +# where the main php module is stored (outside the chroot) .if ${FLAVOR:Membed} -MULTI_PACKAGES= -main -embed +MULTI_PACKAGES= -main -embed +SAPI_DIR= lib/php-${PV} .else -MULTI_PACKAGES= ${SAPI} ${PHP_EXTENSIONS} +MULTI_PACKAGES= ${SAPI} ${PHP_EXTENSIONS} +SAPI_DIR= lib/apache2/php-${PV} +APACHE_DIR= ${SAPI_DIR} .endif +SAPI_SO= libphp${MV}.so .include .if ${FLAVOR:Membed} @@ -459,28 +460,14 @@ WANTLIB-zip= bz2 crypto lzma pthread ssl z zip # some variables to substitute SUBST_VARS+= CHROOT_DIR MODPHP_CONFIG_PATH SV PV MV PHP_PKGSPEC +SUBST_VARS+= APACHE_DIR SAPI_SO UPDATE_PLIST_ARGS+= -i MV DEFAULT_PHP?= No - -.for i in TRUEPREFIX MODULES_DIR PHP_VERSION APACHE_MODULE_DIR -PHPXS_SUBST+= -e 's,${i},${${i}},' -.endfor - -pre-fake: - ${INSTALL_DATA_DIR} ${PREFIX}/${APACHE_MODULE_SUBDIR}/modules +DESTDIRNAME= INSTALL_ROOT INSTALL_TARGET= install-binaries install-build install-headers install-programs # not: install-modules install-pear install-sapi install-pharcmd -DESTDIRNAME= INSTALL_ROOT - -pre-configure: - ${SUBST_CMD} ${WRKSRC}/main/php_ini.c - @perl -pi -e "s,OPENBSD_PEAR_ROOT,'${CHROOT_DIR}/pear',g;" \ - -e "s,OPENBSD_PREFIX,${TRUEPREFIX},;" \ - ${WRKSRC}/scripts/phpize.in \ - ${WRKSRC}/scripts/php-config.in - .for i in ${MULTI_PACKAGES:N-main:S/-//g} DESCR-${i}= ${.CURDIR}/../files/DESCR-${i} PKGNAME-${i}= php-${i}-${PHP_VERSION} @@ -495,6 +482,16 @@ DESCR-main= ${.CURDIR}/../files/DESCR-main # build failure if re2c was installed during autoconf but later junked. BUILD_DEPENDS+= devel/re2c +pre-configure: + ${SUBST_CMD} ${WRKSRC}/main/php_ini.c + @perl -pi -e "s,OPENBSD_PEAR_ROOT,'${CHROOT_DIR}/pear',g;" \ + -e "s,OPENBSD_PREFIX,${TRUEPREFIX},;" \ + ${WRKSRC}/scripts/phpize.in \ + ${WRKSRC}/scripts/php-config.in + +pre-fake: + ${INSTALL_DATA_DIR} ${PREFIX}/${MODULES_SUBDIR} + post-install: ${SUBST_DATA} ${.CURDIR}/../files/README-main \ ${PREFIX}/share/doc/pkg-readmes/${PKGSTEM-main} @@ -514,6 +511,11 @@ post-install: rmdir ${PREFIX}/share/php .endif +.if ${BUILD_PACKAGES:M-apache} || ${BUILD_PACKAGES:M-embed} + ${INSTALL_DATA_DIR} ${PREFIX}/${SAPI_DIR} + ${INSTALL_DATA} ${WRKBUILD}/.libs/${SAPI_SO} ${PREFIX}/${SAPI_DIR} +.endif + .for m in ${ZEND_EXTENSIONS:S/-//g} cd ${PREFIX}; \ ${INSTALL_DATA} ${WRKBUILD}/modules/$m.so ${MODULES_SUBDIR}/$m.so; \ @@ -538,13 +540,6 @@ post-install: .if ${BUILD_PACKAGES:M-apache} ${SUBST_CMD} -m 644 -c ${.CURDIR}/../files/php.conf \ ${PREFIX}/share/examples/php-${PV}/modphp.conf - ${INSTALL_DATA} ${WRKBUILD}/.libs/libphp${MV}.so \ - ${PREFIX}/${APACHE_MODULE_SUBDIR}/ -.endif - -.if ${BUILD_PACKAGES:M-embed} - ${INSTALL_DATA} ${WRKBUILD}/.libs/libphp${MV}.so \ - ${PREFIX}/lib/php-${PV}/ .endif .if ${DEFAULT_PHP:L} == yes diff --git a/lang/php/files/php.conf b/lang/php/files/php.conf index ff96a3c9c8d..afc96411a31 100644 --- a/lang/php/files/php.conf +++ b/lang/php/files/php.conf @@ -1,4 +1,4 @@ -LoadModule php${MV}_module ${TRUEPREFIX}/lib/php-${PV}/libphp${MV}.so +LoadModule php${MV}_module ${TRUEPREFIX}/${APACHE_DIR}/${SAPI_SO} AddType application/x-httpd-php .php .phtml .php3