From 5f3f363ad218cbf5f3ab10bd810636e6d9f23e31 Mon Sep 17 00:00:00 2001 From: ohauer Date: Tue, 15 Apr 2014 13:28:06 +0000 Subject: - 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@ --- www/p5-CGI-SpeedyCGI/Makefile | 37 ++++++++--------- www/p5-CGI-SpeedyCGI/files/patch-mod_speedycgi2.c | 48 ---------------------- .../files/patch-mod_speedycgi__Makefile.tmpl | 19 +++++++++ .../files/patch-src::SpeedyMake.pl | 10 ----- .../files/patch-src__SpeedyMake.pl | 10 +++++ .../files/patch-src__mod_speedycgi2.c | 48 ++++++++++++++++++++++ .../files/patch-src__speedy_main.c | 32 +++++++++++++++ .../files/patch-src__speedy_perl.c | 15 +++++++ www/p5-CGI-SpeedyCGI/files/patch-src_speedy_main.c | 32 --------------- www/p5-CGI-SpeedyCGI/files/patch-src_speedy_perl.c | 15 ------- www/p5-CGI-SpeedyCGI/pkg-plist | 12 +++--- 11 files changed, 147 insertions(+), 131 deletions(-) delete mode 100644 www/p5-CGI-SpeedyCGI/files/patch-mod_speedycgi2.c create mode 100644 www/p5-CGI-SpeedyCGI/files/patch-mod_speedycgi__Makefile.tmpl delete mode 100644 www/p5-CGI-SpeedyCGI/files/patch-src::SpeedyMake.pl create mode 100644 www/p5-CGI-SpeedyCGI/files/patch-src__SpeedyMake.pl create mode 100644 www/p5-CGI-SpeedyCGI/files/patch-src__mod_speedycgi2.c create mode 100644 www/p5-CGI-SpeedyCGI/files/patch-src__speedy_main.c create mode 100644 www/p5-CGI-SpeedyCGI/files/patch-src__speedy_perl.c delete mode 100644 www/p5-CGI-SpeedyCGI/files/patch-src_speedy_main.c delete mode 100644 www/p5-CGI-SpeedyCGI/files/patch-src_speedy_perl.c diff --git a/www/p5-CGI-SpeedyCGI/Makefile b/www/p5-CGI-SpeedyCGI/Makefile index 045fa004b9e..88588f6f9ed 100644 --- a/www/p5-CGI-SpeedyCGI/Makefile +++ b/www/p5-CGI-SpeedyCGI/Makefile @@ -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 - -.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 +.include 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 +.include diff --git a/www/p5-CGI-SpeedyCGI/files/patch-mod_speedycgi2.c b/www/p5-CGI-SpeedyCGI/files/patch-mod_speedycgi2.c deleted file mode 100644 index 5712f6c7429..00000000000 --- a/www/p5-CGI-SpeedyCGI/files/patch-mod_speedycgi2.c +++ /dev/null @@ -1,48 +0,0 @@ ---- 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; - diff --git a/www/p5-CGI-SpeedyCGI/files/patch-mod_speedycgi__Makefile.tmpl b/www/p5-CGI-SpeedyCGI/files/patch-mod_speedycgi__Makefile.tmpl new file mode 100644 index 00000000000..7de9922fe97 --- /dev/null +++ b/www/p5-CGI-SpeedyCGI/files/patch-mod_speedycgi__Makefile.tmpl @@ -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: diff --git a/www/p5-CGI-SpeedyCGI/files/patch-src::SpeedyMake.pl b/www/p5-CGI-SpeedyCGI/files/patch-src::SpeedyMake.pl deleted file mode 100644 index 41f7688a19e..00000000000 --- a/www/p5-CGI-SpeedyCGI/files/patch-src::SpeedyMake.pl +++ /dev/null @@ -1,10 +0,0 @@ ---- 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'), - ); - } diff --git a/www/p5-CGI-SpeedyCGI/files/patch-src__SpeedyMake.pl b/www/p5-CGI-SpeedyCGI/files/patch-src__SpeedyMake.pl new file mode 100644 index 00000000000..41f7688a19e --- /dev/null +++ b/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'), + ); + } diff --git a/www/p5-CGI-SpeedyCGI/files/patch-src__mod_speedycgi2.c b/www/p5-CGI-SpeedyCGI/files/patch-src__mod_speedycgi2.c new file mode 100644 index 00000000000..5712f6c7429 --- /dev/null +++ b/www/p5-CGI-SpeedyCGI/files/patch-src__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; + diff --git a/www/p5-CGI-SpeedyCGI/files/patch-src__speedy_main.c b/www/p5-CGI-SpeedyCGI/files/patch-src__speedy_main.c new file mode 100644 index 00000000000..750fbc0b4a6 --- /dev/null +++ b/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) { diff --git a/www/p5-CGI-SpeedyCGI/files/patch-src__speedy_perl.c b/www/p5-CGI-SpeedyCGI/files/patch-src__speedy_perl.c new file mode 100644 index 00000000000..8b2ffeedb09 --- /dev/null +++ b/www/p5-CGI-SpeedyCGI/files/patch-src__speedy_perl.c @@ -0,0 +1,15 @@ +Author: Niko Tyni +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; diff --git a/www/p5-CGI-SpeedyCGI/files/patch-src_speedy_main.c b/www/p5-CGI-SpeedyCGI/files/patch-src_speedy_main.c deleted file mode 100644 index 750fbc0b4a6..00000000000 --- a/www/p5-CGI-SpeedyCGI/files/patch-src_speedy_main.c +++ /dev/null @@ -1,32 +0,0 @@ ---- 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) { diff --git a/www/p5-CGI-SpeedyCGI/files/patch-src_speedy_perl.c b/www/p5-CGI-SpeedyCGI/files/patch-src_speedy_perl.c deleted file mode 100644 index 8b2ffeedb09..00000000000 --- a/www/p5-CGI-SpeedyCGI/files/patch-src_speedy_perl.c +++ /dev/null @@ -1,15 +0,0 @@ -Author: Niko Tyni -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; diff --git a/www/p5-CGI-SpeedyCGI/pkg-plist b/www/p5-CGI-SpeedyCGI/pkg-plist index 3ae6d1a4256..4b1fee9a007 100644 --- a/www/p5-CGI-SpeedyCGI/pkg-plist +++ b/www/p5-CGI-SpeedyCGI/pkg-plist @@ -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 -- cgit