Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- use SUBST_CMD instead of a perl regex for sample config for apache …
…httpd's

modphp, possible without pain now that we have UPDATE_PLIST_ARGS.

- install empty php-fpm.d directory and handle pkg_delete -c with @extraunexec

- cat www.conf to the end of php-fpm.conf on all of !5.6, previously this was
just done on 7.0. (not installing this to php-fpm.d/www.conf to avoid making
a conflicting config for updating users).
  • Loading branch information
sthen committed Oct 17, 2018
1 parent 89caf6c commit 8c40c6d
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 25 deletions.
4 changes: 3 additions & 1 deletion lang/php/5.6/Makefile
@@ -1,8 +1,10 @@
# $OpenBSD: Makefile,v 1.87 2018/10/17 07:19:23 sthen Exp $
# $OpenBSD: Makefile,v 1.88 2018/10/17 12:44:02 sthen Exp $

PV= 5.6
V= ${PV}.38
REVISION= 1
REVISION-main= 2
REVISION-apache=2

MASTER_SITES0= https://download.suhosin.org/

Expand Down
4 changes: 2 additions & 2 deletions lang/php/5.6/pkg/PLIST-apache
@@ -1,9 +1,9 @@
@comment $OpenBSD: PLIST-apache,v 1.2 2018/06/08 19:42:40 kili Exp $
@comment $OpenBSD: PLIST-apache,v 1.3 2018/10/17 12:44:02 sthen Exp $
@option no-default-conflict
@option is-branch
@conflict php->=5.6,<=5.6.36p8
@conflict php-apache->=5.6,<5.7
lib/php-${PV}/libphp5.so
@sample ${MODPHP_CONFIG_PATH}/modules.sample/
share/examples/php-${PV}/php.conf
share/examples/php-${PV}/modphp.conf
@sample ${MODPHP_CONFIG_PATH}/modules.sample/php-${PV}.conf
4 changes: 3 additions & 1 deletion lang/php/7.0/Makefile
@@ -1,8 +1,10 @@
# $OpenBSD: Makefile,v 1.70 2018/10/17 07:14:46 sthen Exp $
# $OpenBSD: Makefile,v 1.71 2018/10/17 12:44:02 sthen Exp $

PV= 7.0
V= ${PV}.32
REVISION= 2
REVISION-main= 3
REVISION-apache=3

BUILD_DEPENDS+= devel/bison

Expand Down
4 changes: 2 additions & 2 deletions lang/php/7.0/pkg/PLIST-apache
@@ -1,9 +1,9 @@
@comment $OpenBSD: PLIST-apache,v 1.2 2018/06/08 19:42:40 kili Exp $
@comment $OpenBSD: PLIST-apache,v 1.3 2018/10/17 12:44:02 sthen Exp $
@option no-default-conflict
@option is-branch
@conflict php->=7.0,<=7.0.30p8
@conflict php-apache->=7.0,<7.1
lib/php-${PV}/libphp7.so
@sample ${MODPHP_CONFIG_PATH}/modules.sample/
share/examples/php-${PV}/php.conf
share/examples/php-${PV}/modphp.conf
@sample ${MODPHP_CONFIG_PATH}/modules.sample/php-${PV}.conf
4 changes: 3 additions & 1 deletion lang/php/7.0/pkg/PLIST-main
@@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST-main,v 1.18 2018/09/05 08:52:59 espie Exp $
@comment $OpenBSD: PLIST-main,v 1.19 2018/10/17 12:44:02 sthen Exp $
@option no-default-conflict
@option is-branch
@conflict php->=7.0,<7.1
Expand All @@ -8,6 +8,7 @@
@pkgpath lang/php/5.4
@pkgpath lang/php/7.0,-fpm
@extraunexec rm -f ${SYSCONFDIR}/php-${PV}/php-${PV}.sample/*
@extraunexec rm -f ${SYSCONFDIR}/php-fpm.d/*
@mode 1700
@owner www
@group www
Expand All @@ -32,6 +33,7 @@ lib/php-${PV}/modules/opcache.so
share/doc/pkg-readmes/${PKGSTEM}
share/examples/php-${PV}/
@sample ${SYSCONFDIR}/php-${PV}.sample/
@sample ${SYSCONFDIR}/php-fpm.d/
share/examples/php-${PV}/opcache.ini
@sample ${SYSCONFDIR}/php-${PV}.sample/opcache.ini
share/examples/php-${PV}/php-fpm.conf
Expand Down
4 changes: 3 additions & 1 deletion lang/php/7.1/Makefile
@@ -1,8 +1,10 @@
# $OpenBSD: Makefile,v 1.3 2018/10/17 07:14:46 sthen Exp $
# $OpenBSD: Makefile,v 1.4 2018/10/17 12:44:02 sthen Exp $

PV= 7.1
V= ${PV}.23
REVISION= 0
REVISION-main= 1
REVISION-apache=1

BUILD_DEPENDS+= devel/bison

Expand Down
4 changes: 2 additions & 2 deletions lang/php/7.1/pkg/PLIST-apache
@@ -1,8 +1,8 @@
@comment $OpenBSD: PLIST-apache,v 1.1 2018/09/28 22:22:03 sthen Exp $
@comment $OpenBSD: PLIST-apache,v 1.2 2018/10/17 12:44:02 sthen Exp $
@option no-default-conflict
@option is-branch
@conflict php-apache->=7.1,<7.2
lib/php-${PV}/libphp7.so
@sample ${MODPHP_CONFIG_PATH}/modules.sample/
share/examples/php-${PV}/php.conf
share/examples/php-${PV}/modphp.conf
@sample ${MODPHP_CONFIG_PATH}/modules.sample/php-${PV}.conf
4 changes: 3 additions & 1 deletion lang/php/7.1/pkg/PLIST-main
@@ -1,8 +1,9 @@
@comment $OpenBSD: PLIST-main,v 1.1 2018/09/28 22:22:03 sthen Exp $
@comment $OpenBSD: PLIST-main,v 1.2 2018/10/17 12:44:02 sthen Exp $
@option no-default-conflict
@option is-branch
@conflict php->=7.1,<7.2
@extraunexec rm -f ${SYSCONFDIR}/php-${PV}/php-${PV}.sample/*
@extraunexec rm -f ${SYSCONFDIR}/php-fpm.d/*
@mode 1700
@owner www
@group www
Expand All @@ -27,6 +28,7 @@ lib/php-${PV}/modules/opcache.so
share/doc/pkg-readmes/${PKGSTEM}
share/examples/php-${PV}/
@sample ${SYSCONFDIR}/php-${PV}.sample/
@sample ${SYSCONFDIR}/php-fpm.d/
share/examples/php-${PV}/opcache.ini
@sample ${SYSCONFDIR}/php-${PV}.sample/opcache.ini
share/examples/php-${PV}/php-fpm.conf
Expand Down
4 changes: 3 additions & 1 deletion lang/php/7.2/Makefile
@@ -1,8 +1,10 @@
# $OpenBSD: Makefile,v 1.3 2018/10/17 07:14:46 sthen Exp $
# $OpenBSD: Makefile,v 1.4 2018/10/17 12:44:02 sthen Exp $

PV= 7.2
V= ${PV}.11
REVISION= 0
REVISION-main= 1
REVISION-apache=1

BUILD_DEPENDS+= devel/bison

Expand Down
4 changes: 2 additions & 2 deletions lang/php/7.2/pkg/PLIST-apache
@@ -1,8 +1,8 @@
@comment $OpenBSD: PLIST-apache,v 1.1 2018/09/28 22:22:03 sthen Exp $
@comment $OpenBSD: PLIST-apache,v 1.2 2018/10/17 12:44:02 sthen Exp $
@option no-default-conflict
@option is-branch
@conflict php-apache->=7.2,<7.3
lib/php-${PV}/libphp7.so
@sample ${MODPHP_CONFIG_PATH}/modules.sample/
share/examples/php-${PV}/php.conf
share/examples/php-${PV}/modphp.conf
@sample ${MODPHP_CONFIG_PATH}/modules.sample/php-${PV}.conf
4 changes: 3 additions & 1 deletion lang/php/7.2/pkg/PLIST-main
@@ -1,8 +1,9 @@
@comment $OpenBSD: PLIST-main,v 1.1 2018/09/28 22:22:03 sthen Exp $
@comment $OpenBSD: PLIST-main,v 1.2 2018/10/17 12:44:02 sthen Exp $
@option no-default-conflict
@option is-branch
@conflict php->=7.2,<7.3
@extraunexec rm -f ${SYSCONFDIR}/php-${PV}/php-${PV}.sample/*
@extraunexec rm -f ${SYSCONFDIR}/php-fpm.d/*
@mode 1700
@owner www
@group www
Expand All @@ -27,6 +28,7 @@ lib/php-${PV}/modules/opcache.so
share/doc/pkg-readmes/${PKGSTEM}
share/examples/php-${PV}/
@sample ${SYSCONFDIR}/php-${PV}.sample/
@sample ${SYSCONFDIR}/php-fpm.d/
share/examples/php-${PV}/opcache.ini
@sample ${SYSCONFDIR}/php-${PV}.sample/opcache.ini
share/examples/php-${PV}/php-fpm.conf
Expand Down
15 changes: 7 additions & 8 deletions lang/php/Makefile.inc
@@ -1,4 +1,4 @@
# $OpenBSD: Makefile.inc,v 1.123 2018/10/17 07:14:46 sthen Exp $
# $OpenBSD: Makefile.inc,v 1.124 2018/10/17 12:44:02 sthen Exp $

BROKEN-hppa= no __sync_bool_compare_and_swap support nor asm fallback

Expand Down Expand Up @@ -414,8 +414,10 @@ CONFIGURE_ARGS+= --with-mssql=shared,${LOCALBASE}
.endif

# some variables to substitute
SUBST_VARS+= MODPHP_CONFIG_PATH SV PV
SUBST_VARS+= MODPHP_CONFIG_PATH SV PV MV
UPDATE_PLIST_ARGS+= -i MV
PHP_VERSION= ${V}
MV= ${PV:R}
SV= ${PV:S/.//}

.for i in TRUEPREFIX MODULES_DIR PHP_VERSION APACHE_MODULE_DIR
Expand Down Expand Up @@ -473,15 +475,12 @@ post-install:
${INSTALL_MAN} ${WRKBUILD}/sapi/fpm/php-fpm.8 ${PREFIX}/man/man8/php-fpm-${PV}.8
${INSTALL_DATA} ${WRKBUILD}/sapi/fpm/php-fpm.conf \
${PREFIX}/share/examples/php-${PV}/php-fpm.conf
.if ${PV} == "7.0"
.if ${PV} != 5.6
cat ${WRKBUILD}/sapi/fpm/www.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;s,!!MV!!,${PV:R},g" \
${PREFIX}/share/examples/php-${PV}/php.conf
${SUBST_CMD} -m 644 -c ${.CURDIR}/../files/php.conf \
${PREFIX}/share/examples/php-${PV}/modphp.conf

.for m in ${PHP_EXTENSIONS:S/-//g}
.if ${BUILD_PACKAGES:M-$m}
Expand Down
4 changes: 2 additions & 2 deletions lang/php/files/php.conf
@@ -1,6 +1,6 @@
LoadModule php!!MV!!_module !!PREFIX!!/lib/php-!!PV!!/libphp!!MV!!.so
LoadModule php${MV}_module ${TRUEPREFIX}/lib/php-${PV}/libphp${MV}.so

<IfModule mod_php!!MV!!.c>
<IfModule mod_php${MV}.c>
AddType application/x-httpd-php .php .phtml .php3
AddType application/x-httpd-php-source .phps
# Most php configs require this
Expand Down

0 comments on commit 8c40c6d

Please sign in to comment.