Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Apr 2014 13:28:06 +0000 (UTC)
From:      Olli Hauer <ohauer@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r351331 - in head/www/p5-CGI-SpeedyCGI: . files
Message-ID:  <201404151328.s3FDS6qb043367@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ohauer
Date: Tue Apr 15 13:28:06 2014
New Revision: 351331
URL: http://svnweb.freebsd.org/changeset/ports/351331
QAT: https://qat.redports.org/buildarchive/r351331/

Log:
  - add stage support
  - use modern OPTION syntax
  - remove useless PERL_LEVEL check (meanwhile always >= 501000)
  - regenerate patch files so they match the `make makepatch' naming schema
  - add LICENSE (GPLv2)
  - remove BROKEN ...
  
  with hat apache@

Added:
  head/www/p5-CGI-SpeedyCGI/files/patch-mod_speedycgi__Makefile.tmpl   (contents, props changed)
  head/www/p5-CGI-SpeedyCGI/files/patch-src__SpeedyMake.pl
     - copied unchanged from r351324, head/www/p5-CGI-SpeedyCGI/files/patch-src::SpeedyMake.pl
  head/www/p5-CGI-SpeedyCGI/files/patch-src__mod_speedycgi2.c
     - copied unchanged from r351324, head/www/p5-CGI-SpeedyCGI/files/patch-mod_speedycgi2.c
  head/www/p5-CGI-SpeedyCGI/files/patch-src__speedy_main.c
     - copied unchanged from r351324, head/www/p5-CGI-SpeedyCGI/files/patch-src_speedy_main.c
  head/www/p5-CGI-SpeedyCGI/files/patch-src__speedy_perl.c
     - copied unchanged from r351324, head/www/p5-CGI-SpeedyCGI/files/patch-src_speedy_perl.c
Deleted:
  head/www/p5-CGI-SpeedyCGI/files/patch-mod_speedycgi2.c
  head/www/p5-CGI-SpeedyCGI/files/patch-src::SpeedyMake.pl
  head/www/p5-CGI-SpeedyCGI/files/patch-src_speedy_main.c
  head/www/p5-CGI-SpeedyCGI/files/patch-src_speedy_perl.c
Modified:
  head/www/p5-CGI-SpeedyCGI/Makefile
  head/www/p5-CGI-SpeedyCGI/pkg-plist

Modified: head/www/p5-CGI-SpeedyCGI/Makefile
==============================================================================
--- head/www/p5-CGI-SpeedyCGI/Makefile	Tue Apr 15 13:21:22 2014	(r351330)
+++ head/www/p5-CGI-SpeedyCGI/Makefile	Tue Apr 15 13:28:06 2014	(r351331)
@@ -11,7 +11,8 @@ PKGNAMEPREFIX=	p5-
 MAINTAINER=	lth@FreeBSD.org
 COMMENT=	Speed up perl CGI scripts by running them persistently
 
-BROKEN=	not staged
+LICENSE=	GPLv2
+
 MAKE_JOBS_UNSAFE=	yes
 USES=		perl5
 USE_PERL5=	configure patch
@@ -20,18 +21,11 @@ OPTIONS_DEFINE=	APACHE
 OPTIONS_DEFAULT=APACHE
 APACHE_DESC=	Build mod_speedycgi
 
-NO_STAGE=	yes
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MAPACHE}
-USE_APACHE=	22
-PLIST_SUB+=	APACHE=""
-.else
-PLIST_SUB+=	APACHE="@comment "
-CONFIGURE_ENV+=	WITHOUT_APACHE=yes
-.endif
+OPTIONS_SUB=	yes
+APACHE_USE=	APACHE=22
+APACHE_CONFIGURE_ENV_OFF=	WITHOUT_APACHE=yes
 
-.include <bsd.port.pre.mk>
+.include <bsd.port.options.mk>
 
 post-patch:
 	@${REINPLACE_CMD} -e 's/__inline__//g' \
@@ -41,23 +35,26 @@ post-patch:
 	@${PERL} -pi -e 's,APXS=apxs,APXS=${APXS},;' \
 		${WRKSRC}/mod_speedycgi/Makefile.tmpl
 	${CP} ${FILESDIR}/speedy_dump.c ${WRKSRC}/speedy_dump/
-.if ${PERL_LEVEL} >= 501000
 	@${REINPLACE_CMD} -i '' -e 's=New(123,=Newx(=g' \
 		${WRKSRC}/src/speedy_backend_main.h
-.endif
+	${REINPLACE_CMD} -e 's|@APXS_STAGE@|-S LIBEXECDIR=${STAGEDIR}${PREFIX}/${APACHEMODDIR}|' \
+		${WRKSRC}/mod_speedycgi/Makefile.tmpl
+
+pre-install:
+	@${MKDIR} ${STAGEDIR}${PREFIX}/${APACHEMODDIR}
 
 post-configure:
 	@${PERL} -pi -e 's,^PREFIX = /usr$$,PREFIX = ${PREFIX},g;' \
 		${WRKSRC}/Makefile ${WRKSRC}/*/Makefile
 
 post-build:
-	@cd ${WRKSRC}/speedy_dump && ${CC} ${CFLAGS} -o speedy_dump \
-		-I../src speedy_dump.c
+	@(cd ${WRKSRC}/speedy_dump && ${CC} ${CFLAGS} -o speedy_dump \
+		-I../src speedy_dump.c)
 
 post-install:
-	@${INSTALL_PROGRAM} ${WRKSRC}/speedy/speedy ${PREFIX}/bin/speedy_suidperl
-	@${CHMOD} 4755 ${PREFIX}/bin/speedy_suidperl
+	@${INSTALL_PROGRAM} ${WRKSRC}/speedy/speedy ${STAGEDIR}${PREFIX}/bin/speedy_suidperl
+	@${CHMOD} 4755 ${STAGEDIR}${PREFIX}/bin/speedy_suidperl
 	@${INSTALL_PROGRAM} ${WRKSRC}/speedy_dump/speedy_dump \
-		${PREFIX}/bin/speedy_dump
+		${STAGEDIR}${PREFIX}/bin/speedy_dump
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>

Added: head/www/p5-CGI-SpeedyCGI/files/patch-mod_speedycgi__Makefile.tmpl
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/p5-CGI-SpeedyCGI/files/patch-mod_speedycgi__Makefile.tmpl	Tue Apr 15 13:28:06 2014	(r351331)
@@ -0,0 +1,19 @@
+--- ./mod_speedycgi/Makefile.tmpl.orig	2014-04-15 15:09:03.000000000 +0200
++++ ./mod_speedycgi/Makefile.tmpl	2014-04-15 15:10:36.000000000 +0200
+@@ -26,6 +26,7 @@
+ #   the used tools
+ APXS=apxs
+ APACHECTL=apachectl
++APXS_STAGE=@APXS_STAGE@
+ 
+ #   additional defines, includes and libraries
+ INC=-I../src -I.
+@@ -37,7 +38,7 @@
+ 
+ #   install the shared object file into Apache 
+ install: all
+-	$(APXS) -i -a -n 'speedycgi' $(SHARED_OBJ_TARGET)
++	$(APXS) $(APXS_STAGE) -i -n 'speedycgi' $(SHARED_OBJ_TARGET)
+ 
+ #   cleanup
+ clean:

Copied: head/www/p5-CGI-SpeedyCGI/files/patch-src__SpeedyMake.pl (from r351324, head/www/p5-CGI-SpeedyCGI/files/patch-src::SpeedyMake.pl)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/p5-CGI-SpeedyCGI/files/patch-src__SpeedyMake.pl	Tue Apr 15 13:28:06 2014	(r351331, copy of r351324, head/www/p5-CGI-SpeedyCGI/files/patch-src::SpeedyMake.pl)
@@ -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'),
+     );
+ }

Copied: head/www/p5-CGI-SpeedyCGI/files/patch-src__mod_speedycgi2.c (from r351324, head/www/p5-CGI-SpeedyCGI/files/patch-mod_speedycgi2.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/p5-CGI-SpeedyCGI/files/patch-src__mod_speedycgi2.c	Tue Apr 15 13:28:06 2014	(r351331, copy of r351324, head/www/p5-CGI-SpeedyCGI/files/patch-mod_speedycgi2.c)
@@ -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;
+ 

Copied: head/www/p5-CGI-SpeedyCGI/files/patch-src__speedy_main.c (from r351324, head/www/p5-CGI-SpeedyCGI/files/patch-src_speedy_main.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/p5-CGI-SpeedyCGI/files/patch-src__speedy_main.c	Tue Apr 15 13:28:06 2014	(r351331, copy of r351324, head/www/p5-CGI-SpeedyCGI/files/patch-src_speedy_main.c)
@@ -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) {

Copied: head/www/p5-CGI-SpeedyCGI/files/patch-src__speedy_perl.c (from r351324, head/www/p5-CGI-SpeedyCGI/files/patch-src_speedy_perl.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/p5-CGI-SpeedyCGI/files/patch-src__speedy_perl.c	Tue Apr 15 13:28:06 2014	(r351331, copy of r351324, head/www/p5-CGI-SpeedyCGI/files/patch-src_speedy_perl.c)
@@ -0,0 +1,15 @@
+Author: Niko Tyni <ntyni@debian.org>
+Description: Closes: #537996
+The SvIV call crashes in on Perl 5.10.0 when warnings are
+enabled and the value is undef.
+--- src/speedy_perl.c
++++ src/speedy_perl.c
+@@ -818,7 +818,7 @@
+     my_call_sv(get_perlvar(&PERLVAR_RESET_GLOBALS));
+ 
+     /* Copy option values in from the perl vars */
+-    if (SvIV(PERLVAL_OPTS_CHANGED)) {
++    if (SvTRUE(PERLVAL_OPTS_CHANGED)) {
+ 	int i;
+ 	for (i = 0; i < SPEEDY_NUMOPTS; ++i) {
+ 	    OptRec *o = speedy_optdefs + i;

Modified: head/www/p5-CGI-SpeedyCGI/pkg-plist
==============================================================================
--- head/www/p5-CGI-SpeedyCGI/pkg-plist	Tue Apr 15 13:21:22 2014	(r351330)
+++ head/www/p5-CGI-SpeedyCGI/pkg-plist	Tue Apr 15 13:28:06 2014	(r351331)
@@ -1,12 +1,12 @@
-%%APACHE%%%%APACHEMODDIR%%/mod_speedycgi.so
-%%APACHE%%@exec %D/sbin/apxs -e -a -n speedycgi %D/%F
-%%APACHE%%@unexec %D/sbin/apxs -e -A -n speedycgi %D/%F
-%%SITE_PERL%%/%%PERL_ARCH%%/auto/CGI/SpeedyCGI/.packlist
-%%SITE_PERL%%/CGI/SpeedyCGI.pm
 bin/speedy
 bin/speedy_backend
-bin/speedy_suidperl
 bin/speedy_dump
+bin/speedy_suidperl
+%%SITE_PERL%%/CGI/SpeedyCGI.pm
+%%SITE_PERL%%/%%PERL_ARCH%%/auto/CGI/SpeedyCGI/.packlist
+%%APACHE%%%%APACHEMODDIR%%/mod_speedycgi.so
+%%APACHE%%@exec %D/sbin/apxs -e -a -n speedycgi %D/%F
+%%APACHE%%@unexec %D/sbin/apxs -e -A -n speedycgi %D/%F
 @dirrm %%SITE_PERL%%/%%PERL_ARCH%%/auto/CGI/SpeedyCGI
 @dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/CGI
 @dirrmtry %%SITE_PERL%%/CGI



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