[21422] trunk/dports/perl

source_changes at macosforge.org source_changes at macosforge.org
Tue Jan 23 21:17:27 PST 2007


Revision: 21422
          http://trac.macosforge.org/projects/macports/changeset/21422
Author:   markd at macports.org
Date:     2007-01-23 21:17:26 -0800 (Tue, 23 Jan 2007)

Log Message:
-----------
New port p5-cgi-speedycgi.

Added Paths:
-----------
    trunk/dports/perl/p5-cgi-speedycgi/
    trunk/dports/perl/p5-cgi-speedycgi/Portfile
    trunk/dports/perl/p5-cgi-speedycgi/files/
    trunk/dports/perl/p5-cgi-speedycgi/files/patch-Makefile.PL
    trunk/dports/perl/p5-cgi-speedycgi/files/patch-mod_speedycgi2.c
    trunk/dports/perl/p5-cgi-speedycgi/files/patch-src--SpeedyMake.pl
    trunk/dports/perl/p5-cgi-speedycgi/files/patch-src-speedy_perl.h
    trunk/dports/perl/p5-cgi-speedycgi/files/patch-src_speedy_main.c

Added: trunk/dports/perl/p5-cgi-speedycgi/Portfile
===================================================================
--- trunk/dports/perl/p5-cgi-speedycgi/Portfile	                        (rev 0)
+++ trunk/dports/perl/p5-cgi-speedycgi/Portfile	2007-01-24 05:17:26 UTC (rev 21422)
@@ -0,0 +1,38 @@
+ # $Id: Portfile 20367 2006-11-02 18:31:04Z blair at macports.org $
+
+PortSystem                      1.0
+PortGroup                       perl5 1.0
+perl5.setup                     CGI-SpeedyCGI 2.22
+
+maintainers                     nomaintainer at macports.org
+description                     Speed up perl CGI scripts by running them persistently
+long_description                SpeedyCGI is a way to run perl scripts persistently, \
+				which can make them run much more quickly. A script \
+				can be made to to run persistently by changing the \
+				interpreter line at the top of a script from: \
+				  '#!/_prefix_/bin/perl' to '#!/_prefix_/bin/speedy'
+
+platforms                       darwin
+checksums                       md5 2f80df78874e3efa80f180923c4967a1
+
+patchfiles			patch-Makefile.PL \
+				patch-mod_speedycgi2.c \
+				patch-src--SpeedyMake.pl \
+				patch-src_speedy_main.c \
+				patch-src-speedy_perl.h
+
+variant apache2 {
+	depends_lib-append	port:apache2
+}
+
+post-patch {
+if { [variant_isset apache2]} {
+	reinplace "s|apxs -q|${prefix}/apache2/bin/apxs -q|g" \
+		${worksrcpath}/src/SpeedyMake.pl \
+		${worksrcpath}/Makefile.PL
+}
+}
+
+post-destroot {
+	xinstall -m 4755 ${worksrcpath}/speedy/speedy ${destroot}${prefix}/bin/speedy_suidperl
+}


Property changes on: trunk/dports/perl/p5-cgi-speedycgi/Portfile
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/dports/perl/p5-cgi-speedycgi/files/patch-Makefile.PL
===================================================================
--- trunk/dports/perl/p5-cgi-speedycgi/files/patch-Makefile.PL	                        (rev 0)
+++ trunk/dports/perl/p5-cgi-speedycgi/files/patch-Makefile.PL	2007-01-24 05:17:26 UTC (rev 21422)
@@ -0,0 +1,38 @@
+--- Makefile.PL.orig	Sat Oct 18 12:27:13 2003
++++ Makefile.PL	Sat Oct 18 12:28:18 2003
+@@ -6,22 +6,23 @@
+     import SpeedyMake qw(%write_makefile_common);
+ }
+ 
+-print <<END;
+-
+-Optional mod_speedycgi support.
+-
+-Mod_speedycgi increases performance under Apache by avoiding the fork/exec
+-overhead associated with each request under normal SpeedyCGI.  However, it
+-requires a working copy of "apxs" in your path, Apache with mod_so
+-support, and additional Apache configuration.
+-
+-END
+-print "Compile mod_speedycgi (default no)? ";
++#print <<END;
++#
++#Optional mod_speedycgi support.
++#
++#Mod_speedycgi increases performance under Apache by avoiding the fork/exec
++#overhead associated with each request under normal SpeedyCGI.  However, it
++#requires a working copy of "apxs" in your path, Apache with mod_so
++#support, and additional Apache configuration.
++#
++#END
++#print "Compile mod_speedycgi (default no)? ";
+ 
+ my @dirs = qw(src speedy_backend speedy);
+ my $macro = $write_makefile_common{macro};
+ my $apache_module = 0;
+-if (<STDIN> =~ /y/i) {
++#if (<STDIN> =~ /y/i) {
++unless ($ENV{WITHOUT_APACHE}) {
+     die "ERROR: Command 'apxs -q CC' failed.\n"
+ 	unless $macro->{APACHE_APXS_WORKS};
+     print "Compiling for Apache version $macro->{APACHE_VERSION}\n";

Added: trunk/dports/perl/p5-cgi-speedycgi/files/patch-mod_speedycgi2.c
===================================================================
--- trunk/dports/perl/p5-cgi-speedycgi/files/patch-mod_speedycgi2.c	                        (rev 0)
+++ trunk/dports/perl/p5-cgi-speedycgi/files/patch-mod_speedycgi2.c	2007-01-24 05:17:26 UTC (rev 21422)
@@ -0,0 +1,48 @@
+--- src/mod_speedycgi2.c.orig	Tue Oct  7 13:03:48 2003
++++ src/mod_speedycgi2.c	Sun Jan 23 20:42:43 2005
+@@ -92,9 +92,14 @@
+  */
+ 
+ #include "speedy.h"
++#include "apr_version.h"
+ 
+ extern char **environ;
+ 
++#if APR_MAJOR_VERSION >= 1
++#define	apr_filename_of_pathname	apr_filepath_name_get
++#endif
++
+ module AP_MODULE_DECLARE_DATA speedycgi_module;
+ static request_rec *global_r;
+ #if APR_HAS_THREADS
+@@ -340,7 +345,14 @@
+     const char *buf;
+     apr_size_t len;
+     apr_status_t rv;
++#if APR_MAJOR_VERSION < 1
+     APR_BRIGADE_FOREACH(e, bb) {
++#else
++    for (e = APR_BRIGADE_FIRST(bb);
++	 e != APR_BRIGADE_SENTINEL(bb);
++	 e = APR_BUCKET_NEXT(e))
++    {
++#endif
+         if (APR_BUCKET_IS_EOS(e)) {
+             break;
+         }
+@@ -465,7 +477,14 @@
+             return rv;
+         }
+ 
+-        APR_BRIGADE_FOREACH(bucket, bb) {
++#if APR_MAJOR_VERSION < 1
++	APR_BRIGADE_FOREACH(bucket, bb) {
++#else
++	for (bucket = APR_BRIGADE_FIRST(bb);
++	     bucket != APR_BRIGADE_SENTINEL(bb);
++	     bucket = APR_BUCKET_NEXT(bucket))
++	{
++#endif
+             const char *data;
+             apr_size_t len;
+ 


Property changes on: trunk/dports/perl/p5-cgi-speedycgi/files/patch-mod_speedycgi2.c
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/dports/perl/p5-cgi-speedycgi/files/patch-src--SpeedyMake.pl
===================================================================
--- trunk/dports/perl/p5-cgi-speedycgi/files/patch-src--SpeedyMake.pl	                        (rev 0)
+++ trunk/dports/perl/p5-cgi-speedycgi/files/patch-src--SpeedyMake.pl	2007-01-24 05:17:26 UTC (rev 21422)
@@ -0,0 +1,10 @@
+--- src/SpeedyMake.pl.orig	Sun Mar 30 08:17:01 2003
++++ src/SpeedyMake.pl	Sun Mar 30 08:18:59 2003
+@@ -214,6 +214,7 @@
+     join(' ',
+ 	"-DSPEEDY_PROGNAME=\\\"" . $class->my_name_full . "\\\"",
+ 	"-DSPEEDY_VERSION=\\\"\$(VERSION)\\\"",
++	"-DIAMSUID",
+ 	'-DSPEEDY_' . ($class->am_frontend ? 'FRONTEND' : 'BACKEND'),
+     );
+ }


Property changes on: trunk/dports/perl/p5-cgi-speedycgi/files/patch-src--SpeedyMake.pl
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/dports/perl/p5-cgi-speedycgi/files/patch-src-speedy_perl.h
===================================================================
--- trunk/dports/perl/p5-cgi-speedycgi/files/patch-src-speedy_perl.h	                        (rev 0)
+++ trunk/dports/perl/p5-cgi-speedycgi/files/patch-src-speedy_perl.h	2007-01-24 05:17:26 UTC (rev 21422)
@@ -0,0 +1,8 @@
+--- src/speedy_perl.h.org	2003-10-06 21:03:48.000000000 -0700
++++ src/speedy_perl.h	2007-01-23 11:07:02.000000000 -0800
+@@ -21,4 +21,4 @@
+ void speedy_perl_run(slotnum_t _gslotnum, slotnum_t _bslotnum);
+ int speedy_perl_fork(void);
+ 
+-PerlInterpreter  *my_perl;
++extern PerlInterpreter  *my_perl;

Added: trunk/dports/perl/p5-cgi-speedycgi/files/patch-src_speedy_main.c
===================================================================
--- trunk/dports/perl/p5-cgi-speedycgi/files/patch-src_speedy_main.c	                        (rev 0)
+++ trunk/dports/perl/p5-cgi-speedycgi/files/patch-src_speedy_main.c	2007-01-24 05:17:26 UTC (rev 21422)
@@ -0,0 +1,32 @@
+--- src/speedy_main.c	2005/08/31 19:56:57	1.1
++++ src/speedy_main.c	2005/08/31 19:57:42
+@@ -299,6 +299,7 @@
+     /* Copy streams */
+     while (1) {
+ 	/* Do reads/writes */
++        int close_stdout_delayed = 0;
+ 	for (i = 0; i < NUMFDS; ++i) {
+ 	    register CopyBuf *b = cb + i;
+ 	    int do_read  = my_canread(b) &&
+@@ -346,10 +347,17 @@
+ 		/* Try to close files now, so we can wake up the backend
+ 		 * and do more I/O before dropping into select
+ 		 */
+-		if (!do_read && !do_write)
+-		    try_close(b);
+-	    }
+-	}
++		if (!do_read && !do_write) {
++                    if (i == 1)
++                        /* delay closing STDOUT until all the other fds are closed */
++                        close_stdout_delayed = 1;
++                    else
++		        try_close(b);
++                }
++            }
++        }
++        if (close_stdout_delayed)
++            try_close(cb+1);
+ 
+ 	/* All done with reads/writes after backend exited */
+ 	if (backend_exited) {


Property changes on: trunk/dports/perl/p5-cgi-speedycgi/files/patch-src_speedy_main.c
___________________________________________________________________
Name: svn:executable
   + *

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070123/fda9ed10/attachment.html


More information about the macports-changes mailing list