pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

p5-FCGI-Daemon: moved to pkgsrc www



Module Name:	pkgsrc-wip
Committed By:	Adrian Steinmann <ast%NetBSD.org@localhost>
Pushed By:	ast
Date:		Wed Nov 4 14:58:02 2026 +0100
Changeset:	747c8888d428f68f310c20f44abbad0fb7865354

Modified Files:
	Makefile
Removed Files:
	p5-FCGI-Daemon/COMMIT_MSG
	p5-FCGI-Daemon/DESCR
	p5-FCGI-Daemon/Makefile
	p5-FCGI-Daemon/PLIST
	p5-FCGI-Daemon/distinfo
	p5-FCGI-Daemon/files/fcgi_daemon.sh
	p5-FCGI-Daemon/patches/patch-lib-FCGI-Daemon.pm

Log Message:
p5-FCGI-Daemon: moved to pkgsrc www

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=747c8888d428f68f310c20f44abbad0fb7865354

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                                        |   1 -
 p5-FCGI-Daemon/COMMIT_MSG                       |   3 -
 p5-FCGI-Daemon/DESCR                            |  12 --
 p5-FCGI-Daemon/Makefile                         |  47 -----
 p5-FCGI-Daemon/PLIST                            |   7 -
 p5-FCGI-Daemon/distinfo                         |   6 -
 p5-FCGI-Daemon/files/fcgi_daemon.sh             |  76 -------
 p5-FCGI-Daemon/patches/patch-lib-FCGI-Daemon.pm | 259 ------------------------
 8 files changed, 411 deletions(-)

diffs:
diff --git a/Makefile b/Makefile
index 1ba41be061..ae2a6d6280 100644
--- a/Makefile
+++ b/Makefile
@@ -2965,7 +2965,6 @@ SUBDIR+=	p5-Encode-compat
 SUBDIR+=	p5-Exception-Base
 SUBDIR+=	p5-Exception-Class-TryCatch
 SUBDIR+=	p5-Exporter-Tidy
-SUBDIR+=	p5-FCGI-Daemon
 SUBDIR+=	p5-FFI-Platypus
 SUBDIR+=	p5-File-Map
 SUBDIR+=	p5-Frontier-RPC
diff --git a/p5-FCGI-Daemon/COMMIT_MSG b/p5-FCGI-Daemon/COMMIT_MSG
deleted file mode 100644
index 22af97835b..0000000000
--- a/p5-FCGI-Daemon/COMMIT_MSG
+++ /dev/null
@@ -1,3 +0,0 @@
-www/p5-FCGI-Daemon: Add Fast CGI daemon for use with nginx web server.
-
-Packaged in wip by ast
diff --git a/p5-FCGI-Daemon/DESCR b/p5-FCGI-Daemon/DESCR
deleted file mode 100644
index 77a3bfabce..0000000000
--- a/p5-FCGI-Daemon/DESCR
+++ /dev/null
@@ -1,12 +0,0 @@
-FCGI::Daemon is a small FastCGI server for use as CGI-wrapper for
-CGI applications.
-
-Like mod_perl, FCGI-Daemon stays persistent in memory to accelerate
-unmodified CGI applications written in Perl.
-
-FCGI-Daemon run CGI scripts with RLIMITs and predefined number of
-workers.
-
-FCGI-Daemon checks for executable in path and correctly sets
-PATH_INFO environment variable which is crucial for some CGI
-applications like fossil (http://fossil-scm.org).
diff --git a/p5-FCGI-Daemon/Makefile b/p5-FCGI-Daemon/Makefile
deleted file mode 100644
index 48d5ba9ece..0000000000
--- a/p5-FCGI-Daemon/Makefile
+++ /dev/null
@@ -1,47 +0,0 @@
-# $NetBSD$
-
-PKGBASE=	FCGI-Daemon
-DISTNAME=	${PKGBASE}-0.20220206
-PKGNAME=	p5-${DISTNAME}
-PKGREVISION=	1
-CATEGORIES=	www perl5
-MASTER_SITES=	${MASTER_SITE_PERL_CPAN:=FCGI/}
-
-MAINTAINER=	ast%NetBSD.org@localhost
-HOMEPAGE=	https://metacpan.org/release/FCGI-Daemon
-COMMENT=	Perl-aware Fast CGI daemon for use with nginx web server
-LICENSE=	gnu-agpl-v3
-
-USE_TOOLS+=	perl:run
-
-DEPENDS+=	p5-FCGI>=0.82:../../www/p5-FCGI
-DEPENDS+=	p5-BSD-Resource>=1.29:../../devel/p5-BSD-Resource
-DEPENDS+=	p5-FCGI-ProcManager>=0.28:../../www/p5-FCGI-ProcManager
-
-FCGID_EG_DIR=	share/examples/fcgi-daemon
-FCGID_NGINX=	nginx/common.conf nginx/ikiwiki.conf nginx/sample.conf
-
-INSTALLATION_DIRS+=	${FCGID_EG_DIR} ${FCGID_EG_DIR}/nginx
-INSTALLATION_DIRS+=	${PERL5_SUB_INSTALLVENDORMAN3DIR}
-INSTALLATION_DIRS+=	${PERL5_SUB_INSTALLVENDORLIB}/FCGI
-
-REPLACE_PERL=	lib/FCGI/Daemon.pm
-
-RCD_SCRIPTS=	fcgi_daemon
-
-do-install:
-	${INSTALL_SCRIPT} \
-		${WRKSRC}/blib/lib/FCGI/Daemon.pm \
-			${DESTDIR}${PREFIX}/${PERL5_SUB_INSTALLVENDORLIB}/FCGI
-	${INSTALL_MAN} \
-		${WRKSRC}/blib/man3/FCGI::Daemon.3 \
-			${DESTDIR}${PREFIX}/${PERL5_SUB_INSTALLVENDORMAN3DIR}
-
-post-install:
-.for file in ${FCGID_NGINX}
-	${INSTALL_DATA} ${WRKSRC}/examples/${file} \
-		${DESTDIR}${PREFIX}/${FCGID_EG_DIR}/nginx
-.endfor
-
-.include "../../lang/perl5/module.mk"
-.include "../../mk/bsd.pkg.mk"
diff --git a/p5-FCGI-Daemon/PLIST b/p5-FCGI-Daemon/PLIST
deleted file mode 100644
index b55593abb6..0000000000
--- a/p5-FCGI-Daemon/PLIST
+++ /dev/null
@@ -1,7 +0,0 @@
-@comment $NetBSD$
-${PERL5_SUB_INSTALLVENDORLIB}/FCGI/Daemon.pm
-lib/perl5/vendor_perl/man/man3/FCGI::Daemon.3
-share/examples/fcgi-daemon/nginx/common.conf
-share/examples/fcgi-daemon/nginx/ikiwiki.conf
-share/examples/fcgi-daemon/nginx/sample.conf
-share/examples/rc.d/fcgi_daemon
diff --git a/p5-FCGI-Daemon/distinfo b/p5-FCGI-Daemon/distinfo
deleted file mode 100644
index 53f700de86..0000000000
--- a/p5-FCGI-Daemon/distinfo
+++ /dev/null
@@ -1,6 +0,0 @@
-$NetBSD$
-
-BLAKE2s (FCGI-Daemon-0.20220206.tar.gz) = ca58656d54596755b961fd4f0430c49c8a31b658341fb7471092125f0ec6dd7d
-SHA512 (FCGI-Daemon-0.20220206.tar.gz) = 827d3940f18c66c9cc155aa3045fb24e6afecef6ce9b03d3a8344e339749216db63ab39910ec826c2b7a992b4d21c3fede634355fffc3241892737743eb1b1dc
-Size (FCGI-Daemon-0.20220206.tar.gz) = 25156 bytes
-SHA1 (patch-lib-FCGI-Daemon.pm) = 3e9a640c06ead3dd46c34ab8b14e03362512951d
diff --git a/p5-FCGI-Daemon/files/fcgi_daemon.sh b/p5-FCGI-Daemon/files/fcgi_daemon.sh
deleted file mode 100644
index 2ff32f19e1..0000000000
--- a/p5-FCGI-Daemon/files/fcgi_daemon.sh
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/bin/sh
-#
-# $NetBSD$
-#
-
-# PROVIDE: fcgi_daemon
-# REQUIRE: DAEMON
-# BEFORE:  LOGIN
-
-$_rc_subr_loaded . /etc/rc.subr
-
-name="fcgi_daemon"
-pidfile="/var/run/${name}.pid"
-sockfile="/var/run/${name}.sock"
-rcvar=$name
-
-start_cmd="fcgi_daemon_start"
-status_cmd="fcgi_daemon_status"
-stop_cmd="fcgi_daemon_stop"
-
-extra_commands="status"
-
-fcgi_daemon_args="-p ${pidfile} -s ${sockfile} -u nginx -g nginx -w 2 -d"
-
-cmd_args=${fcgi_daemon_flags:-$fcgi_daemon_args}
-
-perl='/usr/pkg/bin/perl'
-[ -x ${perl} ] || { echo "Missing ${perl}">&2; exit 1; }
-
-cmd=`${perl} -MFCGI::Daemon -e 'print $INC{"FCGI/Daemon.pm"}' 2>/dev/null`
-[ -f "${cmd}" ] || { echo "Missing FCGI::Daemon Perl module">&2; exit 1; }
-
-fcgi_daemon_start()
-{
-    /usr/bin/env - ${perl} ${cmd} ${cmd_args}
-    if [ $? -eq 0 ]; then
-        echo "$name manager and workers started."
-    else
-        echo "$name failed to start."
-    fi
-}
-
-fcgi_daemon_status()
-{
-    local pids p t
-
-    pids=`/usr/bin/pgrep FCGI::Daemon`
-    [ -z "$pids" ] && { echo "No $name running."; exit 1; }
-
-    # list all FCGI::Daemon processes
-    t=/bin/cat
-    for p in $pids; do
-        /bin/ps -ouser,group,pid,ppid,cpu,vsz,rss,wchan,time,command -p $p | $t
-        t='/usr/bin/tail -1'
-    done
-
-    # list all socket files
-    /usr/bin/sockstat -l | /usr/bin/head -1
-    /usr/bin/sockstat -l | /usr/bin/grep ${sockfile}
-
-    return 0
-}
-
-fcgi_daemon_stop()
-{
-    kill `cat ${pidfile} 2>/dev/null` >/dev/null 2>&1
-    if [ $? -eq 0 ]; then
-        echo "$name stopped."
-    else
-        echo "Failed to stop $name."
-        fcgi_daemon_status
-    fi
-}
-
-load_rc_config $name
-run_rc_command "$1"
diff --git a/p5-FCGI-Daemon/patches/patch-lib-FCGI-Daemon.pm b/p5-FCGI-Daemon/patches/patch-lib-FCGI-Daemon.pm
deleted file mode 100644
index 997a2a8c90..0000000000
--- a/p5-FCGI-Daemon/patches/patch-lib-FCGI-Daemon.pm
+++ /dev/null
@@ -1,259 +0,0 @@
-$NetBSD$
-
-Add an option -X to enable debugging.
-
-Unlink files without testing for existence as we ignore exit status
-anyway.
-
-Use POSIX calls setgid and setuid to non-root user when running as
-"root" daemon.
-
-Use only $EFFECTIVE_USER_ID to discrimiate if we need to set[gu]id
-and don't install signal handlers INT and TERM as FCGI::ProcManager
-does that.
-
-Close socket when running as root (manager) and remove files in
-pm_die() routine.
-
-Instead of using a non-portable /proc/$$/status read to get memory
-usage on Linux, use a non-portable /bin/ps command on BSD platforms.
-
-Mention NetBSD and pkgsrc in POD.
-
-Make sure all test pass.
- 
-
---- lib/FCGI/Daemon.pm.orig	2022-02-06 15:23:10.000000000 +0000
-+++ lib/FCGI/Daemon.pm	2022-07-28 16:42:18.127502146 +0000
-@@ -6,6 +6,7 @@
- package FCGI::Daemon;
- our $VERSION = '0.20220206';
- use 5.14.2;
-+use POSIX;
- use English '-no_match_vars';
- use BSD::Resource;                      # on Debian available as libbsd-resource-perl
- use FCGI 0.82;                          # on Debian available as libfcgi-perl
-@@ -25,6 +26,7 @@
- =cut
- 
- my %o;
-+my $DEBUG = 0;
- 
- __PACKAGE__->run() unless caller();     # modulino i.e. executable rather than module
- 
-@@ -39,9 +41,7 @@
- sub dieif {
-     if($ARG[0]){
-         my $err=$ARG[1];
--        for my $f ( @o{'pidfile','sockfile'} ) {
--            unlink $f if -f $f; 
--        }        
-+        unlink $o{$_} for qw(pidfile sockfile);
-         print "Error - $err:\n",$ARG[0],"\n";
-         exit 1;
-     }
-@@ -51,7 +51,7 @@
-     Modulino-style main routine
- =cut
- sub run {
--    getopts('hde:f:q:p:s:g:u:m:c:l:w:',\%o) or help(0);
-+    getopts('hde:f:q:p:s:g:u:m:c:l:w:X',\%o) or help(0);
-     help(2) if $o{'h'};
- 
-     $o{sockfile}=$o{'s'}||'/var/run/fcgi-daemon.sock';
-@@ -63,21 +63,18 @@
-     $o{max_evals}=defined $o{'e'} ? $o{'e'} : 10240;   #max evals before exit - paranoid to free memory if leaks
-     $o{file_pattern}=$o{'f'}||qr{\.pl};
-     $o{leak_threshold}=$o{'l'}||1.3;
-+    $DEBUG++ if $o{'X'};
- 
--    if($REAL_USER_ID==$EFFECTIVE_USER_ID and $EFFECTIVE_USER_ID==0){        # if run as root
-+    if($EFFECTIVE_USER_ID==0){
-         $o{gid}=$o{g}||'www-data'; $o{gid_num}=scalar getgrnam($o{gid});
-         $o{uid}=$o{u}||'www-data'; $o{uid_num}=scalar getpwnam($o{uid});
-     }
- 
--    local $SIG{INT}= local $SIG{TERM}= sub{
--        # actually FCGI::ProcManager override our TERM handler so .sock and .pid files will be removed only by sysv script... :(
--        $o{fcgi_pm}->pm_remove_pid_file() if $o{fcgi_pm};
--        for my $f ( @o{'pidfile','sockfile'} ) {
--            unlink $f if -f $f; 
--        }    
--        $o{fcgi_pm}->pm_die() if $o{fcgi_pm};   #pm_die() does not return
--        exit 0;
--    };
-+    if ($DEBUG) {
-+        use Data::Dumper;
-+        $Data::Dumper::Indent = 1;
-+        warn Data::Dumper->Dump([\%o],['o']);
-+    }
- 
-     # daemonize
-     if($o{'d'}){
-@@ -85,10 +82,10 @@
-         local $PROGRAM_NAME='FCGI::Daemon';
-         defined(my $pid=fork) or die "Can't fork: $!";
-         exit if $pid;
--        eval {use POSIX qw(setsid); POSIX::setsid();} or die q{Can't start a new session: }.$OS_ERROR;
-+        POSIX::setsid() or die q{Can't start a new session: }.$OS_ERROR;
-         open *STDIN,'<','/dev/null';
-         open *STDOUT,'>>','/dev/null';
--        open *STDERR,'>>','/dev/null';
-+        open *STDERR,'>>','/dev/null' unless $DEBUG;
-         umask 022;
-     }
- 
-@@ -98,32 +95,24 @@
-                                         pid_fname=>$o{pidfile}
-                                       });
-     print "Opening socket $o{sockfile}\n";
-+    $o{socket_fh} = FCGI::OpenSocket($o{sockfile},$o{prefork}*$o{queue});
-     my $rqst=FCGI::Request(\*STDIN,\*STDOUT,\*STDERR,\%req_env,
--             FCGI::OpenSocket($o{sockfile},$o{prefork}*$o{queue}),
--             FCGI::FAIL_ACCEPT_ON_INTR())
-+             $o{socket_fh}, FCGI::FAIL_ACCEPT_ON_INTR())
-         or die "Error: Unable to create FCGI::Request...";
- 
--    if(defined $o{gid_num} and defined $o{uid_num}){                # if run as root
--        chown $o{uid_num},$o{gid_num},$o{sockfile}                  # chown SOCKfile
--            or dieif($OS_ERROR,'Unable to chown SOCKfile');
-+    # drop privileges if run as root
-+    if(defined $o{uid_num} && defined $o{gid_num}) {
-+        my $old_euid = $EFFECTIVE_USER_ID;
-+        chown $o{uid_num},$o{gid_num},$o{sockfile}
-+            or dieif($OS_ERROR,'Unable to chown SOCKfile '.$o{sockfile});
-+        POSIX::setgid($o{gid_num}) or dieif($OS_ERROR,
-+            "UID $old_euid couldn't change group to $o{gid} ($o{gid_num})");
-+        POSIX::setuid($o{uid_num}) or dieif($OS_ERROR,
-+            "UID $old_euid couldn't change user to $o{uid} ($o{uid_num})");
-     }
- 
-     $o{fcgi_pm}->pm_manage();   # from now on we are worker process
- 
--    # drop privileges if run as root
--    if(defined $o{gid_num} and defined $o{uid_num}){
--       my $gid = getgrnam($o{gid});
--       $EFFECTIVE_GROUP_ID = "$gid $gid";
--       dieif($OS_ERROR,'Unable to effective group_id to '.$o{gid});
--       $REAL_GROUP_ID = $gid;
--       dieif($OS_ERROR,'Unable to change real group_id to '.$o{gid});
--       my $uid = getpwnam($o{uid});
--       $EFFECTIVE_USER_ID = $uid;
--       dieif($OS_ERROR,'Unable to change effective user_id to '.$o{uid});
--       $REAL_USER_ID  = $uid;
--       dieif($OS_ERROR,'Unable to change real user_id to '.$o{uid});
--    }
--
-     ## set rlimit(s)
-     setrlimit(RLIMIT_AS, $o{rlimit_vmem}, $o{rlimit_vmem})
-       or warn "Unable to set RLIMIT_AS.\n";
-@@ -181,21 +170,37 @@
-                 delete $main::{$_};
-             }
- 
--            if(open my $STAT,'<',"/proc/$$/status"){
--                my %stat;
--                while(my ($k,$v)=split /\:\s+/,<$STAT>){
--                    chop $v;
--                    $stat{$k}=$v;
-+            exit unless --$o{max_evals};
-+
-+            # exit if child takes too much resident memory
-+            my %stat = ();
-+            if ( $OSNAME =~ m{bsd}oi ) {
-+                if (open my $STAT,'-|',"/bin/ps -o vsz,rss -p $$") {
-+                    while(<$STAT>) {
-+                        if ( m{^\s*(\d+)\s+(\d+)$}o ) {
-+                             $stat{VmSize} = $1;
-+                             $stat{VmRSS} = $2;
-+                             last;
-+                        }
-+                    }
-+                    close $STAT;
-                 }
--                close $STAT;
--                # check if child takes too much resident memory and terminate if necessary
--                if($stat{VmSize}/$stat{VmRSS}<$o{leak_threshold}){
--                    print {*STDERR} 'fcgi-daemon :: terminating child - memory leak? '
--                    ."VmSize:$stat{VmSize}; VmRSS:$stat{VmRSS}; Ratio:".$stat{VmSize}/$stat{VmRSS};
--                    exit;
-+            } else {
-+                if(open my $STAT,'<',"/proc/$$/status"){
-+                    while(my ($k,$v)=split /\:\s+/,<$STAT>){
-+                        chop $v;
-+                        $stat{$k}=$v;
-+                    }
-+                    close $STAT;
-                 }
-             }
--            exit unless --$o{max_evals};
-+            if ( $stat{VmSize} && $stat{VmRSS}
-+                   && ($stat{VmSize}/$stat{VmRSS}<$o{leak_threshold}) ) {
-+                 die 'fcgi-daemon :: terminating child - memory leak? '
-+                     ."VmSize:$stat{VmSize}; VmRSS:$stat{VmRSS}; Ratio:"
-+                     .$stat{VmSize}/$stat{VmRSS};
-+            }
-+
-             next REQ_LOOP;
-         }
- 
-@@ -253,6 +258,24 @@
-     return;
- }
- 
-+=head2 managing_init ()
-+    close socket as manager
-+=cut
-+sub managing_init {
-+    # manager (running as root) doesn't need to listen on the socket
-+    close $o{socket_fh} if $EFFECTIVE_USER_ID==0;
-+    return $o{fcgi_pm}->managing_init(shift @_);
-+}
-+
-+=head2 pm_die()
-+    exit cleanly
-+=cut
-+sub pm_die {
-+    # manager (running as root) can remove these better
-+    unlink $o{$_} for qw(pidfile sockfile);
-+    return $o{fcgi_pm}->pm_die(shift @_);
-+}
-+
- # overriding process names
- sub FCGI::ProcManager::pm_change_process_name {
-     my ($self,$name)=@_;
-@@ -293,7 +316,7 @@
- CGI applications.
- 
- Like mod_perl FCGI-Daemon stay persistent in memory and accelerate
--unmodified CGI applications written in Perl. 
-+unmodified CGI applications written in Perl.
- 
- FCGI-Daemon run CGI scripts with RLIMITs and predefined number of workers.
- 
-@@ -302,7 +325,7 @@
- 
- FCGI-Daemon check for executable in path and correctly set PATH_INFO
- environment variable which is crucial for some CGI applications like
--fossil (L<http://fossil-scm.org>). 
-+fossil (L<http://fossil-scm.org>).
- (Lack of this functionality make cgiwrap-fcgi.pl unsuitable for some scripts.)
- 
- 
-@@ -351,6 +374,7 @@
-   -u www-data                     # user name to become (if run as root)
-   -g www-data                     # group name to become (if run as root)
-   -d                              # daemonize (run in background)
-+  -X                              # enable debugging
- 
- All options are optional.
- 
-@@ -410,7 +434,7 @@
- 
- =head1 COMPATIBILITY
- 
--Tested only on GNU/Linux systems.
-+Tested on GNU/Linux and NetBSD systems (pkgsrc).
- NOT tested and not expected to work on Windows.
- 
- =head1 NOTES


Home | Main Index | Thread Index | Old Index