Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Jan 2024 16:27:19 GMT
From:      Muhammad Moinur Rahman <bofh@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: e8d69259d834 - main - lang/php81: Moved man to share/man
Message-ID:  <202401271627.40RGRJQl037991@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by bofh:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e8d69259d834aea5a90e6fede00d63d73930b5e6

commit e8d69259d834aea5a90e6fede00d63d73930b5e6
Author:     Johan Hendriks <joh.hendriks@gmail.com>
AuthorDate: 2024-01-27 13:06:47 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2024-01-27 16:26:52 +0000

    lang/php81: Moved man to share/man
    
    - Add profile support in php-fpm rc script for running multiple php
      master process
---
 lang/php81/Makefile         |  3 ++-
 lang/php81/files/php-fpm.in | 53 +++++++++++++++++++++++++++++++++++++--------
 lang/php81/pkg-plist        | 12 +++++-----
 3 files changed, 52 insertions(+), 16 deletions(-)

diff --git a/lang/php81/Makefile b/lang/php81/Makefile
index abfebe77fa6c..49e612fc4c63 100644
--- a/lang/php81/Makefile
+++ b/lang/php81/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	php81
 DISTVERSION=	8.1.27
-PORTREVISION?=	0
+PORTREVISION?=	1
 CATEGORIES?=	lang devel www
 MASTER_SITES=	PHP/distributions
 DISTNAME=	php-${DISTVERSION}
@@ -25,6 +25,7 @@ LIB_DEPENDS=	libargon2.so:security/libargon2 \
 		libpcre2-8.so:devel/pcre2
 
 GNU_CONFIGURE=		yes
+GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
 CONFIGURE_ARGS+=	--disable-all \
 			--program-prefix="" \
 			--with-config-file-scan-dir=${PREFIX}/etc/php \
diff --git a/lang/php81/files/php-fpm.in b/lang/php81/files/php-fpm.in
index c234856b0e54..511e53426b71 100644
--- a/lang/php81/files/php-fpm.in
+++ b/lang/php81/files/php-fpm.in
@@ -6,8 +6,13 @@
 
 #
 # Add the following line to /etc/rc.conf to enable php-fpm:
-# php_fpm_enable="YES"
-#
+# php-fpm_enable (bool):        Set to "NO" by default.
+#                               Set it to "YES" to enable nginx
+# php-fpm_profiles (str):       Set to "" by default.
+#                               Define your profiles here.
+# php_fpm_pid_prefix (str):     Set to "" by default.
+#                               When using profiles manually assign value to "php_fpm_"
+#                               for prevent collision with other PIDs names.
 
 . /etc/rc.subr
 
@@ -17,23 +22,53 @@ rcvar=php_fpm_enable
 start_precmd="php_fpm_prestart"
 restart_precmd="php_fpm_checkconfig"
 reload_precmd="php_fpm_checkconfig"
+command="%%PREFIX%%/sbin/php-fpm"
 configtest_cmd="php_fpm_checkconfig"
+_pidprefix="/var/run"
+pidfile="${_pidprefix}/php-fpm.pid"
+required_files="%%PREFIX%%/etc/php-fpm.conf"
 
-load_rc_config "$name"
+load_rc_config "${name}"
 
 : ${php_fpm_enable="NO"}
 : ${php_fpm_umask=""}
 
-extra_commands="reload configtest logrotate"
+if [ -n "$2" ]; then
+        profile="$2"
+        if [ "x${php_fpm_profiles}" != "x" ]; then
+                pidfile="${_pidprefix}/${php_fpm_pid_prefix}php-fpm-${profile}.pid"
+                eval php_fpm_configfile="\${php_fpm_${profile}_configfile:-}"
+                if [ "x${php_fpm_configfile}" = "x" ]; then
+                        echo "You must define a configuration file (php_fpm_${profile}_configfile)"
+                        exit 1
+                fi
+                required_files="${php_fpm_configfile}"
+                eval php_fpm_enable="\${php_fpm_${profile}_enable:-${php_fpm_enable}}"
+                php_fpm_flags="-y ${php_fpm_configfile} -g ${pidfile}"
+        else
+                echo "$0: extra argument ignored"
+        fi
+else
+        if [ "x${php_fpm_profiles}" != "x" -a "x$1" != "x" ]; then
+                for profile in ${php_fpm_profiles}; do
+                        echo "===> php_fpm profile: ${profile}"
+                        /usr/local/etc/rc.d/php-fpm $1 ${profile}
+                        retcode="$?"
+                        if [ "0${retcode}" -ne 0 ]; then
+                                failed="${profile} (${retcode}) ${failed:-}"
+                        else
+                                success="${profile} ${success:-}"
+                        fi
+                done
+                exit 0
+        fi
+fi
 
-command="%%PREFIX%%/sbin/php-fpm"
-pidfile="/var/run/php-fpm.pid"
+extra_commands="reload configtest logrotate"
 sig_stop="QUIT"
 sig_reload="USR2"
 logrotate_cmd="php_fpm_logrotate"
 
-required_files="%%PREFIX%%/etc/php-fpm.conf"
-
 php_fpm_logrotate() {
         if [ -z "$rc_pid" ]; then
                 _run_rc_notrunning
@@ -46,7 +81,7 @@ php_fpm_logrotate() {
 php_fpm_checkconfig()
 {
         echo "Performing sanity check on php-fpm configuration:"
-        eval ${command} -t
+        eval ${command} ${php_fpm_flags} -t
 }
 
 php_fpm_prestart()
diff --git a/lang/php81/pkg-plist b/lang/php81/pkg-plist
index bf8a092bc4cb..9b1ef314b1e5 100644
--- a/lang/php81/pkg-plist
+++ b/lang/php81/pkg-plist
@@ -300,10 +300,10 @@ lib/php/build/phpize.m4
 lib/php/build/pkg.m4
 lib/php/build/run-tests.php
 lib/php/build/shtool
-%%CGI%%man/man1/php-cgi.1.gz
-man/man1/php-config.1.gz
-%%CLI%%man/man1/php.1.gz
-%%PHPDBG%%man/man1/phpdbg.1.gz
-man/man1/phpize.1.gz
-%%FPM%%man/man8/php-fpm.8.gz
+%%CGI%%share/man/man1/php-cgi.1.gz
+share/man/man1/php-config.1.gz
+%%CLI%%share/man/man1/php.1.gz
+%%PHPDBG%%share/man/man1/phpdbg.1.gz
+share/man/man1/phpize.1.gz
+%%FPM%%share/man/man8/php-fpm.8.gz
 %%FPM%%share/php/fpm/status.html



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202401271627.40RGRJQl037991>