[perl-CGI-SpeedyCGI] update for httpd 2.4 (with Jan Kaluza, #810133)
jorton
jorton at fedoraproject.org
Wed Apr 18 15:06:12 UTC 2012
commit 982c473e20abe61870c835d656a88535afe4802f
Author: Joe Orton <jorton at redhat.com>
Date: Wed Apr 18 16:06:02 2012 +0100
update for httpd 2.4 (with Jan Kaluza, #810133)
Resolves: rhbz#810133
perl-CGI-SpeedyCGI.spec | 30 ++++++++++++++++++++++++------
1 files changed, 24 insertions(+), 6 deletions(-)
---
diff --git a/perl-CGI-SpeedyCGI.spec b/perl-CGI-SpeedyCGI.spec
index 9e9ae3f..2bd552a 100644
--- a/perl-CGI-SpeedyCGI.spec
+++ b/perl-CGI-SpeedyCGI.spec
@@ -1,9 +1,15 @@
+%{!?_httpd_apxs: %{expand: %%global _httpd_apxs %%{_sbindir}/apxs}}
+%{!?_httpd_mmn: %{expand: %%global _httpd_mmn %%(cat %{_includedir}/httpd/.mmn || echo missing-httpd-devel)}}
+%{!?_httpd_confdir: %{expand: %%global _httpd_confdir %%{_sysconfdir}/httpd/conf.d}}
+# /etc/httpd/conf.d with httpd < 2.4 and defined as /etc/httpd/conf.modules.d with httpd >= 2.4
+%{!?_httpd_modconfdir: %{expand: %%global _httpd_modconfdir %%{_sysconfdir}/httpd/conf.d}}
+
%define pkgname CGI-SpeedyCGI
Summary: Speed up perl scripts by running them persistently
Name: perl-CGI-SpeedyCGI
Version: 2.22
-Release: 12%{?dist}
+Release: 13%{?dist}
License: GPLv3+
Group: Development/Libraries
URL: http://search.cpan.org/dist/%{pkgname}/
@@ -50,9 +56,9 @@ perl scripts for web application persistently to make them more quickly.
%patch6 -p1 -b .c99_inline
%build
-sed -i 's at apxs -@%{_sbindir}/apxs - at g' Makefile.PL src/SpeedyMake.pl \
+sed -i 's at apxs -@%{_httpd_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
+sed -i 's at APXS=apxs at APXS=%{_httpd_apxs}@g' mod_speedycgi/Makefile.tmpl
echo yes | perl Makefile.PL INSTALLDIRS=vendor
make OPTIMIZE="$RPM_OPT_FLAGS" # doesn't understand %{?_smp_mflags}
@@ -65,9 +71,18 @@ 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}
+mkdir -p $RPM_BUILD_ROOT{%{_libdir}/httpd/modules,%{_httpd_modconfdir},%{_httpd_confdir}}
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/
+
+%if "%{_httpd_modconfdir}" == "%{_httpd_confdir}"
+# httpd <= 2.2.x
+install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_httpd_confdir}
+%else
+# httpd >= 2.4.x
+sed -n /^LoadModule/p %{SOURCE1} > 10-speedycgi.conf
+sed /^LoadModule/d %{SOURCE1} > docs/example.conf
+install -m 644 10-speedycgi.conf $RPM_BUILD_ROOT%{_httpd_modconfdir}
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
@@ -81,9 +96,12 @@ rm -rf $RPM_BUILD_ROOT
%files -n mod_speedycgi
%defattr(-,root,root)
%{_libdir}/httpd/modules/mod_speedycgi.so
-%config(noreplace) %{_sysconfdir}/httpd/conf.d/speedycgi.conf
+%config(noreplace) %{_httpd_modconfdir}/*.conf
%changelog
+* Wed Apr 18 2012 Joe Orton <jorton at redhat.com> - 2.22-13
+- update for httpd 2.4 (with Jan Kaluza, #810133)
+
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.22-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
More information about the scm-commits
mailing list