summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-perl/SpeedyCGI')
-rw-r--r--dev-perl/SpeedyCGI/Manifest2
-rw-r--r--dev-perl/SpeedyCGI/SpeedyCGI-2.22-r3.ebuild42
-rw-r--r--dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-apache-docs.patch18
-rw-r--r--dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-apache2.2.patch56
-rw-r--r--dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-big-socket-buffers.patch47
-rw-r--r--dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-empty-param.patch40
-rw-r--r--dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-ldflags.patch13
-rw-r--r--dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-makefile-manpage.patch16
-rw-r--r--dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-parallel-build.patch17
-rw-r--r--dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-perl5.10.patch26
-rw-r--r--dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-perl_sys_init.patch28
-rw-r--r--dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-speedy_unsafe_putenv.patch16
-rw-r--r--dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-strerror.patch47
-rw-r--r--dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-strip-backend-libs.patch31
-rw-r--r--dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-test-timeout.patch14
-rw-r--r--dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-uninit-crash.patch15
-rw-r--r--dev-perl/SpeedyCGI/metadata.xml7
17 files changed, 435 insertions, 0 deletions
diff --git a/dev-perl/SpeedyCGI/Manifest b/dev-perl/SpeedyCGI/Manifest
new file mode 100644
index 000000000000..5179c46541b1
--- /dev/null
+++ b/dev-perl/SpeedyCGI/Manifest
@@ -0,0 +1,2 @@
+DIST CGI-SpeedyCGI-2.22.tar.gz 151946 SHA256 9021a5c6d8ed205422f091209addf7d1be27222adbcbd17bc52fbc527bcc6f98 SHA512 e29112c2dcc2d7494bd06a92ec80ba8b424b66fba78148e2e8dfc7aa3c51379f9cbc5aabc146199ce9190815de6f0da5da1d0d68e1ff499a663384523235fb38 WHIRLPOOL d7ea153a5b1c7b0e341fbed7e19178e3eb3fb2e588c26aaeb2b58f6616e8996edfb0ec16874d90dc81080c428e9a6a0e0ffb39fa55872ee461b799470c10c2d7
+DIST speedy-error.patch 3087 SHA256 9da44c9c7c5068c214e52076e011d5485f077e26080ddabd1ab1eda854605c6d SHA512 d58b31732a285f518040440a8dfa26f590a68ccef0ad7f9083b8752643477a3bd2ef5ec6833e6d1f331d72096ffa25a1840d9e2aab4732cf818b5fcbcb96de52 WHIRLPOOL d87a5cc6ea301037e0a460a32222505660325c2a46e04fa1c4a413cae11c5ae2c78831d0de072c6cbdaf6bb95e282bf70cb1f781f71dd01291de0e7d9b5a5283
diff --git a/dev-perl/SpeedyCGI/SpeedyCGI-2.22-r3.ebuild b/dev-perl/SpeedyCGI/SpeedyCGI-2.22-r3.ebuild
new file mode 100644
index 000000000000..daafc8d3121f
--- /dev/null
+++ b/dev-perl/SpeedyCGI/SpeedyCGI-2.22-r3.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit perl-module
+
+DESCRIPTION="Speed up perl scripts by running them persistently"
+HOMEPAGE="http://daemoninc.com/SpeedyCGI/"
+SRC_URI="http://daemoninc.com/SpeedyCGI/CGI-${P}.tar.gz
+ http://oss.oetiker.ch/smokeping/pub/speedy-error.patch"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~hppa sparc x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}/CGI-${P}
+
+PATCHES=( "${DISTDIR}/speedy-error.patch"
+"${FILESDIR}/${P}-makefile-manpage.patch"
+"${FILESDIR}/${P}-empty-param.patch"
+"${FILESDIR}/${P}-strerror.patch"
+"${FILESDIR}/${P}-apache-docs.patch"
+"${FILESDIR}/${P}-apache2.2.patch"
+"${FILESDIR}/${P}-strip-backend-libs.patch"
+"${FILESDIR}/${P}-test-timeout.patch"
+"${FILESDIR}/${P}-speedy_unsafe_putenv.patch"
+"${FILESDIR}/${P}-perl5.10.patch"
+"${FILESDIR}/${P}-perl_sys_init.patch"
+"${FILESDIR}/${P}-uninit-crash.patch"
+"${FILESDIR}/${P}-big-socket-buffers.patch"
+"${FILESDIR}/${P}-ldflags.patch"
+"${FILESDIR}/${P}-parallel-build.patch"
+)
+
+# Actually fails 1 test
+SRC_TEST="do parallel"
+MAKEOPTS="${MAKEOPTS} -j1" #348065
diff --git a/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-apache-docs.patch b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-apache-docs.patch
new file mode 100644
index 000000000000..45d35176a0ec
--- /dev/null
+++ b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-apache-docs.patch
@@ -0,0 +1,18 @@
+Author: Niko Tyni <ntyni@iki.fi>
+Description: Documentation for bug #204461.
+--- a/src/SpeedyCGI.src
++++ b/src/SpeedyCGI.src
+@@ -250,6 +250,13 @@
+ be Speedy followed by the option name. For example to set the
+ Timeout option, use the apache directive SpeedyTimeout.
+
++Note that these variables are global. There is currently no way to run
++different scripts with different SpeedyCGI options when they are run
++from the Apache module. Any <Directory> or <Location> contexts
++have no effect on the scope of the SpeedyCGI options. When the
++same SpeedyCGI option is set several times, the last one overrides
++the others.
++
+ =back
+
+ =head2 Context
diff --git a/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-apache2.2.patch b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-apache2.2.patch
new file mode 100644
index 000000000000..3cd754674379
--- /dev/null
+++ b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-apache2.2.patch
@@ -0,0 +1,56 @@
+Author: Niko Tyni <ntyni@iki.fi>
+Description: Apache 2.2 compatibility fixes (#393017):
+* APR_BRIGADE_FOREACH macro removal
+* apr_filename_of_pathname() rename
+--- a/src/mod_speedycgi2.c
++++ b/src/mod_speedycgi2.c
+@@ -340,7 +340,10 @@
+ const char *buf;
+ apr_size_t len;
+ apr_status_t rv;
+- APR_BRIGADE_FOREACH(e, bb) {
++ for (e = APR_BRIGADE_FIRST(bb);
++ e != APR_BRIGADE_SENTINEL(bb);
++ e = APR_BUCKET_NEXT(e)) {
++
+ if (APR_BUCKET_IS_EOS(e)) {
+ break;
+ }
+@@ -380,7 +383,7 @@
+ return DECLINED;
+ }
+
+- argv0 = apr_filename_of_pathname(r->filename);
++ argv0 = apr_filepath_name_get(r->filename);
+ nph = !(strncmp(argv0, "nph-", 4));
+
+ if (!(ap_allow_options(r) & OPT_EXECCGI) && !is_scriptaliased(r))
+@@ -436,7 +439,7 @@
+ if ((rv = default_build_command(&command, &argv, r, p)) != APR_SUCCESS) {
+ ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_TOCLIENT, rv, r,
+ "don't know how to spawn child process: %s",
+- apr_filename_of_pathname(r->filename));
++ apr_filepath_name_get(r->filename));
+ return HTTP_INTERNAL_SERVER_ERROR;
+ }
+
+@@ -445,7 +448,7 @@
+ command, argv, r, p)) != APR_SUCCESS) {
+ ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_TOCLIENT, rv, r,
+ "couldn't spawn child process: %s",
+- apr_filename_of_pathname(r->filename));
++ apr_filepath_name_get(r->filename));
+ return HTTP_INTERNAL_SERVER_ERROR;
+ }
+
+@@ -465,7 +468,9 @@
+ return rv;
+ }
+
+- APR_BRIGADE_FOREACH(bucket, bb) {
++ for (bucket = APR_BRIGADE_FIRST(bb);
++ bucket != APR_BRIGADE_SENTINEL(bb);
++ bucket = APR_BUCKET_NEXT(bucket)) {
+ const char *data;
+ apr_size_t len;
+
diff --git a/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-big-socket-buffers.patch b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-big-socket-buffers.patch
new file mode 100644
index 000000000000..a67d9b6954b3
--- /dev/null
+++ b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-big-socket-buffers.patch
@@ -0,0 +1,47 @@
+Author: Niko Tyni <ntyni@debian.org>
+Description: fix the detach test on systems with a large socket buffer size (#584344)
+--- speedy-cgi-perl.orig/speedy/t/detach.t
++++ speedy-cgi-perl/speedy/t/detach.t
+@@ -6,9 +6,22 @@
+
+ use strict;
+ use IO::File;
++use Socket;
+
+ my $smbuf = 8 * 1024;
+-my $lgbuf = 512 * 1024;
++my $lgbuf;
++
++# find out the size of the socket write buffer
++# see http://bugs.debian.org/584344
++my $s;
++if (socket($s, AF_UNIX, SOCK_STREAM, 0) &&
++ (my $packed_size = getsockopt($s, SOL_SOCKET, SO_SNDBUF))) {
++ $lgbuf = $smbuf + 2 * unpack("I", $packed_size);
++} else {
++ warn("socket() or getsockopt() failed: $!");
++}
++
++$lgbuf = 512 * 1024 if $lgbuf < 512 * 1024;
+ my $scr = 't/scripts/detach';
+
+ use vars qw(@open_files @pids %children);
+@@ -23,7 +36,7 @@
+ $| = 1; print ""; $| = 0;
+ my $child;
+ if (($child = open($fh, "-|")) == 0) {
+- open(F, "$ENV{SPEEDY} -- -B$sz $scr |");
++ open(F, "$ENV{SPEEDY} -- -B$sz $scr $lgbuf |");
+ print scalar <F>;
+ close(STDOUT);
+ sleep 60; # Simulate slow drain of output
+--- speedy-cgi-perl.orig/speedy/t/scripts/detach
++++ speedy-cgi-perl/speedy/t/scripts/detach
+@@ -1,3 +1,6 @@
+ $| = 1;
++# the data should not fit in the socket write buffer
++# see http://bugs.debian.org/584344
++my $size = shift || (512 * 1024);
+ print "$$\n";
+-print 'x' x (500*1024);
++print 'x' x int(500 / 512 * $size);
diff --git a/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-empty-param.patch b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-empty-param.patch
new file mode 100644
index 000000000000..0b9b7fa3c56d
--- /dev/null
+++ b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-empty-param.patch
@@ -0,0 +1,40 @@
+Author: Niko Tyni <ntyni@iki.fi>
+Description: Allow empty strings as command-line parameters
+--- a/src/speedy_frontend.c
++++ b/src/speedy_frontend.c
+@@ -535,7 +535,26 @@
+ ADD_STRING(b, s, l);
+ }
+ }
++ /* Terminate with zero-length string */
++ ADDCHAR(b, 0);
++}
++
++/* Copy a block of strings into the buffer, including empty strings */
++static void add_strings_with_empty(register SpeedyBuf *b, register const char * const * p)
++{
++ int l;
++ register const char *s;
+
++ /* Add strings in p array */
++ for (; (s = *p); ++p) {
++ if ((l = strlen(s))) {
++ ADD_STRING(b, s, l);
++ } else {
++ /* add a 1-byte long string containing just '\0' */
++ l = 1;
++ ADD_STRING(b, s, l);
++ }
++ }
+ /* Terminate with zero-length string */
+ ADDCHAR(b, 0);
+ }
+@@ -560,7 +579,7 @@
+
+ /* Add env and argv */
+ add_strings(sb, envp);
+- add_strings(sb, scr_argv+1);
++ add_strings_with_empty(sb, scr_argv+1);
+
+ /* Put script filename into buffer */
+ add_string(sb, script_fname, strlen(script_fname));
diff --git a/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-ldflags.patch b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-ldflags.patch
new file mode 100644
index 000000000000..7eb8c9171fc1
--- /dev/null
+++ b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-ldflags.patch
@@ -0,0 +1,13 @@
+=== modified file 'src/SpeedyMake.pl'
+--- src/SpeedyMake.pl 2010-08-30 20:08:42 +0000
++++ src/SpeedyMake.pl 2010-08-30 20:09:18 +0000
+@@ -328,7 +328,7 @@
+ sub remove_libs { undef }
+
+ sub get_ldopts {
+- $_ = "$LD_OPTS " . &ExtUtils::Embed::ldopts('-std');
++ $_ = "$LD_OPTS " . &ExtUtils::Embed::ldopts('-std') . " " . $ENV{LDFLAGS};
+ $EFENCE && s/$/ $EFENCE/;
+ return $_;
+ }
+
diff --git a/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-makefile-manpage.patch b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-makefile-manpage.patch
new file mode 100644
index 000000000000..8e1d4b73acba
--- /dev/null
+++ b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-makefile-manpage.patch
@@ -0,0 +1,16 @@
+Author: Niko Tyni <ntyni@iki.fi>
+Description: Makefile.PL tries to be too smart, make it generate a manpage.
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -34,9 +34,9 @@
+ VERSION_FROM => 'src/SpeedyCGI.src',
+ EXE_FILES => [qw(speedy/speedy speedy_backend/speedy_backend)],
+ CONFIGURE => sub { return {DIR=>\@dirs} },
+- PM => {'src/SpeedyCGI.pm'=>'$(INST_LIBDIR)/SpeedyCGI.pm'},
++ # PM => {'src/SpeedyCGI.pm'=>'$(INST_LIBDIR)/SpeedyCGI.pm'},
+ MAN1PODS => {},
+- MAN3PODS => {},
++ # MAN3PODS => {},
+ dist => {DIST_DEFAULT => 'mydist'},
+ realclean => {FILES => 'README README.html lib'},
+ %write_makefile_common
diff --git a/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-parallel-build.patch b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-parallel-build.patch
new file mode 100644
index 000000000000..f85b0f57d43e
--- /dev/null
+++ b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-parallel-build.patch
@@ -0,0 +1,17 @@
+=== modified file 'Makefile.PL'
+--- Makefile.PL 2010-09-16 06:16:42 +0000
++++ Makefile.PL 2010-09-16 20:24:41 +0000
+@@ -64,6 +64,12 @@
+ $test_install_extra .
+ '
+
++speedy/speedy: subdirs
++ $(NOECHO) cd speedy && $(MAKE) $(USEMAKEFILE) $(FIRST_MAKEFILE) all $(PASTHRU)
++
++speedy_backend/speedy_backend: subdirs
++ $(NOECHO) cd speedy_backend && $(MAKE) $(USEMAKEFILE) $(FIRST_MAKEFILE) all $(PASTHRU)
++
+ mydist: README README.html lib/CGI/SpeedyCGI.pm readable tardist
+
+ readable:
+
diff --git a/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-perl5.10.patch b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-perl5.10.patch
new file mode 100644
index 000000000000..8445dad26683
--- /dev/null
+++ b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-perl5.10.patch
@@ -0,0 +1,26 @@
+Author: Niko Tyni <ntyni@debian.org>
+Description: Fix build failures with Perl 5.10.
+Pod::Text::pod2text() calling conventions changed
+use Newx() instead of New()
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -71,7 +71,7 @@
+ chmod -R u+w,go-w,go+r .
+
+ README: src/SpeedyCGI.pm
+- cd src && $(PERL) -e "use Pod::Text; pod2text(-80)" <SpeedyCGI.pm >../README
++ cd src && pod2text -80 <SpeedyCGI.pm >../README
+
+ README.html: src/SpeedyCGI.pm
+ cd src && pod2html SpeedyCGI.pm >../README.html && $(RM_F) pod2h*
+--- a/src/speedy_backend_main.h
++++ b/src/speedy_backend_main.h
+@@ -38,7 +38,7 @@
+
+ #else
+
+-#define speedy_new(s,n,t) New(123,s,n,t)
++#define speedy_new(s,n,t) Newx(s,n,t)
+ #define speedy_renew Renew
+ #define speedy_free Safefree
+
diff --git a/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-perl_sys_init.patch b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-perl_sys_init.patch
new file mode 100644
index 000000000000..e8da0b9d0f92
--- /dev/null
+++ b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-perl_sys_init.patch
@@ -0,0 +1,28 @@
+Author: Niko Tyni <ntyni@debian.org>
+Description: Properly call PERL_SYS_INIT3() to fix lockups on hppa with perl 5.10.0. (Closes: #486070)
+
+This was always buggy but didn't bite until now. From 'perldoc perlembed':
+
+The macros PERL_SYS_INIT3() and PERL_SYS_TERM() provide system-specific
+tune up of the C runtime environment necessary to run Perl interpreters
+--- a/src/speedy_backend_main.c
++++ b/src/speedy_backend_main.c
+@@ -170,6 +170,8 @@
+ int i;
+ SigList sl;
+
++ PERL_SYS_INIT3(&argc, &argv, &_junk);
++
+ speedy_util_unlimit_core();
+
+ if (!(my_perl = perl_alloc()))
+--- a/src/speedy_perl.c
++++ b/src/speedy_perl.c
+@@ -405,6 +405,7 @@
+
+ perl_destruct(my_perl);
+ }
++ PERL_SYS_TERM();
+ speedy_util_exit(0,0);
+ }
+
diff --git a/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-speedy_unsafe_putenv.patch b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-speedy_unsafe_putenv.patch
new file mode 100644
index 000000000000..c4adb7b8c6ec
--- /dev/null
+++ b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-speedy_unsafe_putenv.patch
@@ -0,0 +1,16 @@
+Author: banb@yahoo.co.jp
+Description: Debian #418447, CPAN #13521
+http://rt.cpan.org/Public/Bug/Display.html?id=13521
+--- a/src/speedy_backend_main.c
++++ b/src/speedy_backend_main.c
+@@ -176,6 +176,10 @@
+ DIE_QUIET("Cannot allocate perl");
+ perl_construct(my_perl);
+
++#if defined(PL_use_safe_putenv) || defined(PL_Guse_safe_putenv)
++ PL_use_safe_putenv = 0;
++#endif
++
+ #ifdef SPEEDY_DEBUG
+ dont_fork = getenv("SPEEDY_NOPARENT") != NULL;
+ #endif
diff --git a/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-strerror.patch b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-strerror.patch
new file mode 100644
index 000000000000..608ac39c566e
--- /dev/null
+++ b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-strerror.patch
@@ -0,0 +1,47 @@
+Author: Niko Tyni <ntyni@iki.fi>
+Description: Don't crash while printing a fatal error.
+--- a/src/speedy_util.c
++++ b/src/speedy_util.c
+@@ -96,13 +96,42 @@
+ }
+
+ static void just_die(const char *fmt, va_list ap) {
++ /*
++ * All this strerror_r() stuff is here because
++ * including perl.h in some cases (Perl 5.8?) replaces
++ * strerr() with a wrapper that needs an embedded perl
++ * interpreter running. Otherwise we get SIGSEGV when
++ * accessing interpreter-specific global variables for the
++ * strerror buffer
++ *
++ * Furthermore, there are two implementations of
++ * strerror_r() out there, with different prototypes.
++ */
++
+ char buf[2048];
++#ifdef HAS_STRERROR_R
++ char errbuf[256];
++ int errsv;
++#endif
+
+ sprintf(buf, "%s[%u]: ", SPEEDY_PROGNAME, (int)getpid());
+ vsprintf(buf + strlen(buf), fmt, ap);
+ if (errno) {
+ strcat(buf, ": ");
++#ifdef HAS_STRERROR_R
++#ifdef _GNU_SOURCE
++ strcat(buf, strerror_r(errno, errbuf, sizeof(errbuf)));
++#else /* ! _GNU_SOURCE */
++ errsv = errno;
++ if (strerror_r(errsv, errbuf, sizeof(errbuf))
++ sprintf(buf + strlen(buf), "(errno = %d)", errsv);
++ else
++ strcat(buf, errbuf);
++ }
++#endif
++#else /* ! HAS_STRERROR_R */
+ strcat(buf, strerror(errno));
++#endif /* HAS_STRERROR_R */
+ }
+ strcat(buf, "\n");
+ # ifdef SPEEDY_DEBUG
diff --git a/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-strip-backend-libs.patch b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-strip-backend-libs.patch
new file mode 100644
index 000000000000..537af4188be5
--- /dev/null
+++ b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-strip-backend-libs.patch
@@ -0,0 +1,31 @@
+Author: Niko Tyni <ntyni@iki.fi>
+Description: Use the automatic 'remove extra libs' feature with speedy_backend too.
+These unnecessary linking flags get removed: -lm -lcrypt -lpthread
+--- a/speedy_backend/Makefile.PL
++++ b/speedy_backend/Makefile.PL
+@@ -29,6 +29,10 @@
+ sub am_frontend {0}
+ sub my_name {'backend'}
+
++sub remove_libs { my $class = shift;
++ 'BIN=speedy_backend ../util/remove_libs';
++}
++
+ use ExtUtils::Embed;
+
+ my $tmp = "xsinit.tmp$$";
+--- a/util/remove_libs
++++ b/util/remove_libs
+@@ -3,7 +3,11 @@
+ # Remove extranaeous libs from the linking command. Reduces shared-library
+ # overhead at exec time.
+
+-BIN=speedy
++# allow testing other binaries too
++if [ "x$BIN" = "x" ]
++then
++ BIN=speedy
++fi
+ TMP1=/tmp/remove_libs$$
+ TMP2="${TMP1}2"
+
diff --git a/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-test-timeout.patch b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-test-timeout.patch
new file mode 100644
index 000000000000..62bbc4ea30d2
--- /dev/null
+++ b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-test-timeout.patch
@@ -0,0 +1,14 @@
+Author: Niko Tyni <ntyni@iki.fi>
+Description: Increase the time for the backend to start so slower buildds
+have a chance. (#418717)
+--- a/speedy/t/killfe.t
++++ b/speedy/t/killfe.t
+@@ -9,7 +9,7 @@
+ my $cmd = "exec $ENV{SPEEDY} -- -M1 $scr </dev/null |";
+
+ my $pid = open (RUN1, $cmd);
+-sleep(1);
++sleep(3);
+ kill(9, $pid);
+ wait;
+ open (RUN2, $cmd);
diff --git a/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-uninit-crash.patch b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-uninit-crash.patch
new file mode 100644
index 000000000000..767fb8de8fe6
--- /dev/null
+++ b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-uninit-crash.patch
@@ -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.
+--- a/src/speedy_perl.c
++++ b/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/dev-perl/SpeedyCGI/metadata.xml b/dev-perl/SpeedyCGI/metadata.xml
new file mode 100644
index 000000000000..91f4e72fb544
--- /dev/null
+++ b/dev-perl/SpeedyCGI/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>