rpms/perl-CGI-SpeedyCGI/F-7 perl-CGI-SpeedyCGI-2.22-brigade_foreach.patch, NONE, 1.1 perl-CGI-SpeedyCGI-2.22-documentation.patch, NONE, 1.1 perl-CGI-SpeedyCGI-2.22-empty_param.patch, NONE, 1.1 perl-CGI-SpeedyCGI-2.22-exit_messages.patch, NONE, 1.1 perl-CGI-SpeedyCGI-2.22-perl_510.patch, NONE, 1.1 perl-CGI-SpeedyCGI-2.22-strerror.patch, NONE, 1.1 perl-CGI-SpeedyCGI.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Robert Scheck (robert) fedora-extras-commits at redhat.com
Sun May 4 19:29:38 UTC 2008


Author: robert

Update of /cvs/pkgs/rpms/perl-CGI-SpeedyCGI/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4726/F-7

Modified Files:
	.cvsignore sources 
Added Files:
	perl-CGI-SpeedyCGI-2.22-brigade_foreach.patch 
	perl-CGI-SpeedyCGI-2.22-documentation.patch 
	perl-CGI-SpeedyCGI-2.22-empty_param.patch 
	perl-CGI-SpeedyCGI-2.22-exit_messages.patch 
	perl-CGI-SpeedyCGI-2.22-perl_510.patch 
	perl-CGI-SpeedyCGI-2.22-strerror.patch perl-CGI-SpeedyCGI.spec 
Log Message:
Initial import of perl-CGI-SpeedyCGI


perl-CGI-SpeedyCGI-2.22-brigade_foreach.patch:

--- NEW FILE perl-CGI-SpeedyCGI-2.22-brigade_foreach.patch ---
Patch by Niko Tyni <ntyni at iki.fi> for perl-CGI-SpeedyCGI >= 2.22, which fixes the broken Apache 2.2
compatibility by APR_BRIGADE_FOREACH macro removal and renaming apr_filename_of_pathname(). Further
information: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=393017

--- CGI-SpeedyCGI-2.22/src/mod_speedycgi2.c			2003-10-07 06:03:48.000000000 +0200
+++ CGI-SpeedyCGI-2.22/src/mod_speedycgi2.c.brigade_foreach	2008-05-04 20:40:30.000000000 +0200
@@ -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;
 

perl-CGI-SpeedyCGI-2.22-documentation.patch:

--- NEW FILE perl-CGI-SpeedyCGI-2.22-documentation.patch ---
Patch by Niko Tyni <ntyni at iki.fi> for perl-CGI-SpeedyCGI >= 2.22, which adds documentation
regarding the variables behaviour - as it is easily misunderstood. For further information,
see: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=204461

--- CGI-SpeedyCGI-2.22/src/SpeedyCGI.src		2003-10-12 05:37:30.000000000 +0200
+++ CGI-SpeedyCGI-2.22/src/SpeedyCGI.src.documentation	2008-05-04 20:05:33.000000000 +0200
@@ -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

perl-CGI-SpeedyCGI-2.22-empty_param.patch:

--- NEW FILE perl-CGI-SpeedyCGI-2.22-empty_param.patch ---
Patch by Niko Tyni <ntyni at iki.fi> for perl-CGI-SpeedyCGI >= 2.22, which allows empty strings as
command-line parameters.

--- CGI-SpeedyCGI-2.22/src/speedy_frontend.c			2003-10-07 06:03:48.000000000 +0200
+++ CGI-SpeedyCGI-2.22/src/speedy_frontend.c.empty_param	2008-05-04 20:19:05.000000000 +0200
@@ -540,6 +540,27 @@
     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);
+}
+
 void speedy_frontend_mkenv(
     const char * const * envp, const char * const * scr_argv, int min_alloc,
     SpeedyBuf *sb, int script_has_cwd
@@ -560,7 +581,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));

perl-CGI-SpeedyCGI-2.22-exit_messages.patch:

--- NEW FILE perl-CGI-SpeedyCGI-2.22-exit_messages.patch ---
Patch by Jose Carlos Garcia Sogo <jsogo at debian.org> for perl-CGI-SpeedyCGI >= 2.22, which tries to
log exit messages on die(). See also: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=326442

--- CGI-SpeedyCGI-2.22/src/speedy_main.c			2003-10-07 06:03:48.000000000 +0200
+++ CGI-SpeedyCGI-2.22/src/speedy_main.c.exit_messages		2008-05-04 20:50:56.000000000 +0200
@@ -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,11 +347,19 @@
 		/* 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) {
 	    if (am_child) {

perl-CGI-SpeedyCGI-2.22-perl_510.patch:

--- NEW FILE perl-CGI-SpeedyCGI-2.22-perl_510.patch ---
Patch by Niko Tyni <ntyni at debian.org> for perl-CGI-SpeedyCGI >= 2.22, which fixes a build failure
with perl >= 5.10 by using Newx() instead of New().

--- CGI-SpeedyCGI-2.22/src/speedy_backend_main.h		2003-10-07 06:03:48.000000000 +0200
+++ CGI-SpeedyCGI-2.22/src/speedy_backend_main.h.perl_510	2008-05-04 21:13:19.000000000 +0200
@@ -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
 

perl-CGI-SpeedyCGI-2.22-strerror.patch:

--- NEW FILE perl-CGI-SpeedyCGI-2.22-strerror.patch ---
Patch by Niko Tyni <ntyni at iki.fi> for perl-CGI-SpeedyCGI >= 2.22, which tries to avoid the
crashing while printing a fatal error.

--- CGI-SpeedyCGI-2.22/src/speedy_util.c		2003-10-07 06:03:48.000000000 +0200
+++ CGI-SpeedyCGI-2.22/src/speedy_util.c.strerror	2008-05-04 20:25:53.000000000 +0200
@@ -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


--- NEW FILE perl-CGI-SpeedyCGI.spec ---
%define pkgname CGI-SpeedyCGI

Summary:        Speed up perl scripts by running them persistently
Name:           perl-CGI-SpeedyCGI
Version:        2.22
Release:        2%{?dist}
License:        GPLv3+
Group:          Development/Libraries
URL:            http://search.cpan.org/dist/%{pkgname}/
Source0:	http://www.cpan.org/modules/by-authors/id/H/HO/HORROCKS/%{pkgname}-%{version}.tar.gz
Source1:	speedycgi.conf
Patch0:		perl-CGI-SpeedyCGI-2.22-documentation.patch
Patch1:		perl-CGI-SpeedyCGI-2.22-empty_param.patch
Patch2:		perl-CGI-SpeedyCGI-2.22-strerror.patch
Patch3:		perl-CGI-SpeedyCGI-2.22-brigade_foreach.patch
Patch4:		perl-CGI-SpeedyCGI-2.22-exit_messages.patch
Patch5:		perl-CGI-SpeedyCGI-2.22-perl_510.patch
Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
BuildRequires:  perl >= 5.8.0, perl(ExtUtils::MakeMaker)
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

%description
SpeedyCGI is a way to run perl scripts persistently, which can make
them run much more quickly. After the script is initially run, instead
of exiting, the perl interpreter is kept running. During subsequent
runs, this interpreter is used to handle new executions instead of
starting a new perl interpreter each time. It is a very fast frontend
program, written in C, is executed for each request. 

%package -n mod_speedycgi
Summary:	SpeedyCGI module for the Apache HTTP Server
Group:		System Environment/Daemons
BuildRequires:	httpd-devel
Requires:	%{name} = %{version}-%{release}, httpd >= 2.0.40
Requires:	httpd-mmn = %(cat %{_includedir}/httpd/.mmn || echo missing)

%description -n mod_speedycgi
The SpeedyCGI module for the Apache HTTP Server. It can be used to run
perl scripts for web application persistently to make them more quickly.

%prep
%setup -q -n %{pkgname}-%{version}
%patch0 -p1 -b .documentation
%patch1 -p1 -b .empty_param
%patch2 -p1 -b .strerror
%patch3 -p1 -b .brigade_foreach
%patch4 -p1 -b .exit_messages
%patch5 -p1 -b .perl_510

%build
sed -i 's at apxs -@%{_sbindir}/apxs - at g' Makefile.PL src/SpeedyMake.pl \
  mod_speedycgi/t/ModTest.pm mod_speedycgi/t/mod_perl.t
sed -i 's at APXS=apxs at APXS=%{_sbindir}/apxs at g' mod_speedycgi/Makefile.tmpl

echo yes | perl Makefile.PL INSTALLDIRS=vendor
make OPTIMIZE="$RPM_OPT_FLAGS" # doesn't understand %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT

find $RPM_BUILD_ROOT \( -name perllocal.pod -o -name .packlist \) -exec rm -f {} \;
find $RPM_BUILD_ROOT -type f -name '*.bs' -empty -exec rm -f {} ';'
chmod -R u+w $RPM_BUILD_ROOT/*

mkdir -p $RPM_BUILD_ROOT{%{_libdir}/httpd/modules,%{_sysconfdir}/httpd/conf.d}
install -m 755 mod_speedycgi2/mod_speedycgi.so $RPM_BUILD_ROOT%{_libdir}/httpd/modules/
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc Changes COPYING README docs/*
%{_bindir}/speedy*
%{perl_vendorlib}/CGI

%files -n mod_speedycgi
%defattr(-,root,root)
%{_libdir}/httpd/modules/mod_speedycgi.so
%config(noreplace) %{_sysconfdir}/httpd/conf.d/speedycgi.conf

%changelog
* Sun May 04 2008 Robert Scheck <robert at fedoraproject.org> 2.22-2
- Changes to match with Fedora Packaging Guidelines (#429609)

* Mon Jan 21 2008 Robert Scheck <robert at fedoraproject.org> 2.22-1
- Upgrade to 2.22
- Initial spec file for Fedora and Red Hat Enterprise Linux


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/perl-CGI-SpeedyCGI/F-7/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	4 May 2008 17:17:03 -0000	1.1
+++ .cvsignore	4 May 2008 19:29:01 -0000	1.2
@@ -0,0 +1,2 @@
+CGI-SpeedyCGI-2.22.tar.gz
+speedycgi.conf


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/perl-CGI-SpeedyCGI/F-7/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	4 May 2008 17:17:03 -0000	1.1
+++ sources	4 May 2008 19:29:01 -0000	1.2
@@ -0,0 +1,2 @@
+2f80df78874e3efa80f180923c4967a1  CGI-SpeedyCGI-2.22.tar.gz
+b631316a6938360862577f636202b6f1  speedycgi.conf




More information about the fedora-extras-commits mailing list