Hello Stuart,

Thanks for the feedback.

On 11/23/17 23:48, Stuart Henderson wrote:
> On 2017/11/23 21:46, Martijn van Duren wrote:
>> Hello ports@,
>>
>> Here's the first real tricky patch for PHP.
>> Right now we have the -fastcgi package, which is nothing more than PHP's
>> cgi SAPI under a different name and is actually confusing considering
>> there's the fpm SAPI in -main. It originally took me quite some time to
>> figure out to what SAPI this package actually maps to, especially
>> considering it doesn't include the manpage.
>>
>> So I've addressed the following topics in this diff:
>> 1) Rename the package from -fastcgi to -cgi
>> 2) Rename the binary from php-fastcgi to php-cgi (or more precisely
>>    preserve the name from build-time)
>> 3) Add the php-cgi manpage. This is nothing more than a source of the
>>    php-cli manpage. Maybe we should copy the php-cli manpage to php-cgi
>>    instead of sourcing it?
>> 4) enable -cgi explicitly (we're packaging it, so be explicit about
>>    building it)
>> 5) Adjust COMMENT and DESCR. These probably need some love, but suffice
>>    for me.
>> 6) Add RUN_DEPENDS on -main. This is required for this patch's version
>>    of the manpage and adds the php.ini.
>>
>> This also leaves me with the question: what do we want to do with the
>> other SAPI modules? apxs2, cli, fpm, phpdbg (not build yet). Do we want
>> them all in separate packages, or maybe a subset? It would be my
>> personal preference to split them all and leave -main with just the
>> essentials (php.ini, phpize, SAPI-shared headers, etc).
>>
>> Thoughts, opinions, OKs?
>>
>> martijn@
>>
>> Index: 5.6/pkg/PLIST-cgi
>> ===================================================================
>> RCS file: 5.6/pkg/PLIST-cgi
>> diff -N 5.6/pkg/PLIST-cgi
>> --- /dev/null        1 Jan 1970 00:00:00 -0000
>> +++ 5.6/pkg/PLIST-cgi        23 Nov 2017 20:38:55 -0000
>> @@ -0,0 +1,6 @@
>> +@comment $OpenBSD: PLIST-fastcgi,v 1.2 2016/06/29 16:14:42 espie Exp $
>> +@option no-default-conflict
>> +@option is-branch
>> +@conflict php-cgi->=5.6,<5.7
>> +@bin bin/php-cgi-${PV}
>> +@man man/man1/php-cgi-${PV}.1
> 
> If this is meant to replace php-fastcgi then it needs this adding:
> 
> @pkgpath lang/php/5.6,-fastcgi

Done.

> @conflict php-fastcgi->=5.6,<5.7

Left out, since there's no overlapping names between the two packages,
which is what pkg_create(1) specifies should be the reason of usage.
Of course it's easy enough to add if you think it's still needed.
> 
> Also needs a quirks entry.

Done
> 
> To test:
> 
> - install old packages
> - build new php-* and quirks and copy them to /somepath
> - run "env TRUSTED_PKG_PATH=/somepath/ pkg_add -u" and make sure

Done
> 
> If it's not meant to replace php-fastcgi then it needs some quirks
> removal entry.

It's the same binary, so I think a replacement is better.
> 
>> Index: 7.0/patches/patch-sapi_cgi_php-cgi_1_in
>> ===================================================================
>> RCS file: 7.0/patches/patch-sapi_cgi_php-cgi_1_in
>> diff -N 7.0/patches/patch-sapi_cgi_php-cgi_1_in
>> --- /dev/null        1 Jan 1970 00:00:00 -0000
>> +++ 7.0/patches/patch-sapi_cgi_php-cgi_1_in  23 Nov 2017 20:38:55 -0000
>> @@ -0,0 +1,8 @@
>> +$OpenBSD$
>> +
>> +Index: sapi/cgi/php-cgi.1.in
>> +--- sapi/cgi/php-cgi.1.in.orig
>> ++++ sapi/cgi/php-cgi.1.in
>> +@@ -1 +1 @@
>> +-.so man1/php.1
>> ++.so man1/php-5.6.1
> 
> Wrong version.
Autch
It was meant to read .so man1/php-${PV}.1. Probably got overwritten and
overlooked during a final update-patches.
> 
> Did you figure out why it was copied rather than using .so
> before? There might be a reason for that.

It wasn't installed at all before, so this is the first time php-cgi(1)
is added. If it was copied I would've left it as is.

On second thought I do now reckon it's better to just copy the original
php.1. If -cli is going to be split of the .so file might not be there
and the content of the file hasn't been changed since it's creation 5
years ago so it's unlikely to get its own manpage any time soon.

Index: devel/quirks//Makefile
===================================================================
RCS file: /cvs/ports/devel/quirks/Makefile,v
retrieving revision 1.550
diff -u -p -a -u -r1.550 Makefile
--- devel/quirks//Makefile      20 Nov 2017 18:51:45 -0000      1.550
+++ devel/quirks//Makefile      24 Nov 2017 08:16:35 -0000
@@ -5,7 +5,7 @@ CATEGORIES =    devel databases
 DISTFILES =
 
 # API.rev
-PKGNAME =      quirks-2.395
+PKGNAME =      quirks-2.396
 PKG_ARCH =     *
 MAINTAINER =   Marc Espie <es...@openbsd.org>
 
Index: devel/quirks//files/Quirks.pm
===================================================================
RCS file: /cvs/ports/devel/quirks/files/Quirks.pm,v
retrieving revision 1.563
diff -u -p -a -u -r1.563 Quirks.pm
--- devel/quirks//files/Quirks.pm       20 Nov 2017 18:51:45 -0000      1.563
+++ devel/quirks//files/Quirks.pm       24 Nov 2017 08:16:35 -0000
@@ -498,6 +498,7 @@ my $stem_extensions = {
        'arm' => 'nyx',
        'luabitop' => 'lua-bitop',
        'livestreamer' => 'streamlink',
+       'php-fastcgi' => 'php-cgi',
 };
 
 my $obsolete_reason = {
Index: lang/php/Makefile.inc
===================================================================
RCS file: /cvs/ports/lang/php/Makefile.inc,v
retrieving revision 1.100
diff -u -p -a -u -r1.100 Makefile.inc
--- lang/php/Makefile.inc       23 Nov 2017 18:57:13 -0000      1.100
+++ lang/php/Makefile.inc       24 Nov 2017 08:16:35 -0000
@@ -3,10 +3,10 @@
 BROKEN-hppa=   no __sync_bool_compare_and_swap support nor asm fallback
 
 COMMENT-main=          server-side HTML-embedded scripting language
-COMMENT-fastcgi=       stand-alone FastCGI version of PHP
+COMMENT-cgi=           cgi sapi for php
 
 PKGNAME-main?=         php-${V}
-PKGNAME-fastcgi?=      php-fastcgi-${V}
+PKGNAME-cgi?=          php-cgi-${V}
 
 DISTFILES+=            php-${V}.tar.bz2
 
@@ -97,6 +97,7 @@ CONFIGURE_ARGS+=      --with-openssl \
                        --enable-sysvshm \
                        --enable-mbstring \
                        --enable-exif \
+                       --enable-cgi \
                        --enable-fpm \
                        --with-fpm-user=www \
                        --with-fpm-group=www
@@ -104,7 +105,7 @@ CONFIGURE_ARGS+=    --with-openssl \
 TEST_TARGET=           test
 TEST_FLAGS=            NO_INTERACTION=1
 
-MULTI_PACKAGES+=       -main -fastcgi
+MULTI_PACKAGES+=       -main -cgi
 
 #
 # Loadable php extensions by name that are included in all versions
@@ -304,12 +305,12 @@ PHPXS_SUBST+= -e 's,${i},${${i}},'
 WANTLIB-main+=         c crypto iconv intl lzma m pthread ssl xml2>=8 z
 WANTLIB-main+=         ncurses readline ${COMPILER_LIBCXX}
 
-WANTLIB-fastcgi=       ${WANTLIB-main}
+WANTLIB-cgi=           ${WANTLIB-main}
 LIB_DEPENDS-main=      devel/gettext \
                        textproc/libxml
 RUN_DEPENDS-main=      mail/femail,-chroot
-LIB_DEPENDS-fastcgi=   ${LIB_DEPENDS-main}
-RUN_DEPENDS-fastcgi=
+LIB_DEPENDS-cgi=       ${LIB_DEPENDS-main}
+RUN_DEPENDS-cgi=       php-${V}:lang/php/${PV}
 
 pre-fake:
        ${INSTALL_DATA_DIR} ${PREFIX}/${APACHE_MODULE_SUBDIR}/modules
@@ -324,7 +325,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-cgi:S/-//g}
 MODULE_NAME-${i}=      ${i}
 DESCR-${i}=            ${.CURDIR}/../files/DESCR-${i}
 PKGNAME-${i}=          php-${i}-${V}
@@ -337,7 +338,7 @@ RUN_DEPENDS-${i}+=  php-${V}:lang/php/${P
 .endfor
 
 DESCR-main=            ${.CURDIR}/../files/DESCR-main
-DESCR-fastcgi=         ${.CURDIR}/../files/DESCR-fastcgi
+DESCR-cgi=             ${.CURDIR}/../files/DESCR-cgi
 
 post-install:
        ${SUBST_DATA} ${.CURDIR}/../files/README-main \
@@ -347,7 +348,9 @@ post-install:
        ${INSTALL_DATA_DIR} ${WRKINST}/${CHROOT_DIR}/conf/php-${PV}.sample
        ${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}
+       ${INSTALL_PROGRAM} ${WRKBUILD}/sapi/cgi/php-cgi 
${PREFIX}/bin/php-cgi-${PV}
+# Make sure that php-cgi.1 still just sources php.1 when importing a new major 
version.
+       ${INSTALL_MAN} ${WRKSRC}/sapi/cli/php.1 
${PREFIX}/man/man1/php-cgi-${PV}.1
        ${INSTALL_PROGRAM} ${WRKBUILD}/sapi/fpm/php-fpm 
${PREFIX}/sbin/php-fpm-${PV}
        ${INSTALL_MAN} ${WRKBUILD}/sapi/fpm/php-fpm.8 
${PREFIX}/man/man8/php-fpm-${PV}.8
        ${INSTALL_DATA} ${WRKBUILD}/sapi/fpm/php-fpm.conf \
@@ -362,7 +365,7 @@ post-install:
        @perl -pi -e 
"s,!!PREFIX!!,${TRUEPREFIX},g;s,!!PV!!,${PV},g;s,!!MV!!,${PV:R},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-cgi:S/-//g}
        ${INSTALL_DATA} ${WRKBUILD}/modules/${m}.so \
                ${PREFIX}/${MODULES_SUBDIR}/${m}.so
        echo "extension=${m}.so" > \
Index: lang/php/5.6/Makefile
===================================================================
RCS file: /cvs/ports/lang/php/5.6/Makefile,v
retrieving revision 1.55
diff -u -p -a -u -r1.55 Makefile
--- lang/php/5.6/Makefile       17 Nov 2017 06:47:17 -0000      1.55
+++ lang/php/5.6/Makefile       24 Nov 2017 08:16:35 -0000
@@ -4,7 +4,7 @@ BROKEN-alpha=   pcre_jit_compile.c:65:2: e
 
 PV=            5.6
 V=             ${PV}.31
-REVISION=      0
+REVISION=      1
 
 MASTER_SITES0= https://download.suhosin.org/
 
Index: lang/php/5.6/pkg/PLIST-cgi
===================================================================
RCS file: lang/php/5.6/pkg/PLIST-cgi
diff -N lang/php/5.6/pkg/PLIST-cgi
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ lang/php/5.6/pkg/PLIST-cgi  24 Nov 2017 08:16:35 -0000
@@ -0,0 +1,7 @@
+@comment $OpenBSD: PLIST-fastcgi,v 1.2 2016/06/29 16:14:42 espie Exp $
+@option no-default-conflict
+@option is-branch
+@pkgpath lang/php/5.6,-fastcgi
+@conflict php-cgi->=5.6,<5.7
+@bin bin/php-cgi-${PV}
+@man man/man1/php-cgi-${PV}.1
Index: lang/php/5.6/pkg/PLIST-fastcgi
===================================================================
RCS file: lang/php/5.6/pkg/PLIST-fastcgi
diff -N lang/php/5.6/pkg/PLIST-fastcgi
--- lang/php/5.6/pkg/PLIST-fastcgi      29 Jun 2016 16:14:42 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,5 +0,0 @@
-@comment $OpenBSD: PLIST-fastcgi,v 1.2 2016/06/29 16:14:42 espie Exp $
-@option no-default-conflict
-@option is-branch
-@conflict php-fastcgi->=5.6,<5.7
-@bin bin/php-fastcgi-${PV}
Index: lang/php/7.0/Makefile
===================================================================
RCS file: /cvs/ports/lang/php/7.0/Makefile,v
retrieving revision 1.38
diff -u -p -a -u -r1.38 Makefile
--- lang/php/7.0/Makefile       17 Nov 2017 06:47:17 -0000      1.38
+++ lang/php/7.0/Makefile       24 Nov 2017 08:16:35 -0000
@@ -4,7 +4,7 @@ BROKEN-sparc64= SIGBUS during phar gener
 
 PV=            7.0
 V=             ${PV}.23
-REVISION=      0
+REVISION=      1
 
 BUILD_DEPENDS+=        devel/bison
 
Index: lang/php/7.0/pkg/PLIST-cgi
===================================================================
RCS file: lang/php/7.0/pkg/PLIST-cgi
diff -N lang/php/7.0/pkg/PLIST-cgi
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ lang/php/7.0/pkg/PLIST-cgi  24 Nov 2017 08:16:35 -0000
@@ -0,0 +1,7 @@
+@comment $OpenBSD: PLIST-fastcgi,v 1.2 2016/06/29 16:14:42 espie Exp $
+@option no-default-conflict
+@option is-branch
+@pkgpath lang/php/7.0,-fastcgi
+@conflict php-cgi->=7.0,<7.1
+@bin bin/php-cgi-${PV}
+@man man/man1/php-cgi-${PV}.1
Index: lang/php/7.0/pkg/PLIST-fastcgi
===================================================================
RCS file: lang/php/7.0/pkg/PLIST-fastcgi
diff -N lang/php/7.0/pkg/PLIST-fastcgi
--- lang/php/7.0/pkg/PLIST-fastcgi      29 Jun 2016 16:14:42 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,5 +0,0 @@
-@comment $OpenBSD: PLIST-fastcgi,v 1.2 2016/06/29 16:14:42 espie Exp $
-@option no-default-conflict
-@option is-branch
-@conflict php-fastcgi->=7.0,<7.1
-@bin bin/php-fastcgi-${PV}
Index: lang/php/files/DESCR-cgi
===================================================================
RCS file: lang/php/files/DESCR-cgi
diff -N lang/php/files/DESCR-cgi
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ lang/php/files/DESCR-cgi    24 Nov 2017 08:16:35 -0000
@@ -0,0 +1 @@
+PHP's CGI and FastCGI SAPI
Index: lang/php/files/DESCR-fastcgi
===================================================================
RCS file: lang/php/files/DESCR-fastcgi
diff -N lang/php/files/DESCR-fastcgi
--- lang/php/files/DESCR-fastcgi        27 Jun 2010 20:28:45 -0000      1.1.1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,4 +0,0 @@
-This is the core PHP binary compiled with FastCGI support
-(www.fastcgi.com). FastCGI deployments are generally faster than
-using PHP as a CGI, since the processes stay resident in memory
-between requests.

Reply via email to