2007-01-15 22:51:15 +00:00
#
2011-05-24 12:04:16 +00:00
# spec file for package apache2-mod_perl
2007-01-15 22:51:15 +00:00
#
2015-07-16 17:01:50 +00:00
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
2007-01-15 22:51:15 +00:00
#
2008-11-06 21:00:06 +00:00
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
2007-01-15 22:51:15 +00:00
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name : apache2-mod_perl
2014-11-11 11:59:33 +00:00
Version : 2.0.8
Release : 0
Summary : Embedded Perl for Apache
License : Apache-2.0
Group : Productivity/Networking/Web/Servers
Url : http://perl.apache.org/
Source0 : http://ftp.de.debian.org/debian/pool/main/liba/libapache2-mod-perl2/libapache2-mod-perl2_2.0.8+httpd24-r1449661.orig.tar.gz
Patch0 : %{name} -2.0.4-tests.diff
# PATCH-NEEDS-REBASE
Patch1 : lfs-perl-5.14.patch
Patch2 : avoid-broken-provides.diff
Patch3 : apache24-mod_authz_host.patch
BuildRequires : apache-rpm-macros
2012-02-15 22:41:54 +00:00
BuildRequires : apache2-devel
BuildRequires : db-devel
BuildRequires : ed
2012-10-11 14:47:07 +00:00
BuildRequires : netcfg
2012-02-15 22:41:54 +00:00
BuildRequires : pcre-devel
BuildRequires : perl
BuildRequires : perl-BSD-Resource
BuildRequires : perl-Compress-Zlib
BuildRequires : perl-Tie-IxHash
BuildRequires : perl-libwww-perl
BuildRequires : sudo
2012-06-01 09:57:01 +00:00
Requires : %{apache_mmn}
2015-07-16 17:01:50 +00:00
Requires : %{apache_suse_maintenance_mmn}
2012-06-01 09:57:01 +00:00
Requires : apache2
2007-01-15 22:51:15 +00:00
Requires : perl = %{perl_version}
2012-06-01 09:57:01 +00:00
Requires : perl-HTML-Parser
Requires : perl-Tie-IxHash
Requires : perl-URI
Requires : perl-libwww-perl
2014-08-01 11:08:35 +00:00
Requires : perl(Linux::Pid)
2007-01-15 22:51:15 +00:00
Obsoletes : mod_perl_2
2014-11-11 11:59:33 +00:00
BuildRoot : %{_tmppath} /%{name} -%{version} -build
2007-01-15 22:51:15 +00:00
Conflicts : mod_perl
Icon : mod_perl.xpm
2014-11-11 11:59:33 +00:00
%if 0%{?sles_version} == 9
BuildRequires : openldap2-devel
%endif
2007-01-15 22:51:15 +00:00
%description
The Apache/Perl integration project brings together the full power of
the Perl programming language and the Apache HTTP server.
With mod_perl, it is possible to write Apache modules entirely in Perl.
The persistent interpreter embedded in the server avoids the overhead
of starting an external interpreter and the penalty of Perl start-up
time.
Note that you do not need mod_perl to run perl scripts via the common
gateway interface (CGI). mod_perl enables you to run Perl scripts in an
embedded interpreter if the additional performance is needed, but may
require modifications to the scripts.
Usage:
2007-01-23 17:00:17 +00:00
To load the module into Apache, run the command " a 2 e n m o d p e r l " as root.
To learn about the configuration, the best reference unequivocally is
http://perl.apache.org/docs/
2007-01-15 22:51:15 +00:00
For porting 1.0 applications to 2.0, the page
http://perl.apache.org/docs/2.0/user/porting/compat.html should give
the required information.
Most mod_perl handlers use the perl-script handler. Scripts can run in
" m o d _ p e r l m o d e " (preconfigured for URLs starting with /perl/) or " p e r l
cgi mode" ( p r e c o n f i g u r e d f o r U R L s s t a r t i n g / c g i - p e r l ) . P l a i n C G I
scripts can be run via /cgi-bin/. In all these cases, the script would
be placed inside the /srv/www/cgi-bin/ directory. Refer to
2014-11-11 11:59:33 +00:00
%{_sysconfdir} /apache2/conf.d/mod_perl.conf about this configuration.
2007-01-15 22:51:15 +00:00
2007-06-14 14:27:04 +00:00
%package devel
Summary : Embedded Perl for Apache - Development package
Group : Productivity/Networking/Web/Servers
Requires : %{name} = %{version}
2014-11-11 11:59:33 +00:00
Provides : apache2-mod_perl:%{_includedir} /apache2/modules/perl/modperl_cgi.h
2007-06-14 14:27:04 +00:00
%description devel
The Apache/Perl integration project brings together the full power of
the Perl programming language and the Apache HTTP server.
This package contains the include files useful for developing new
software depending on apache2-mod_perl.
2007-01-15 22:51:15 +00:00
%prep
#%setup -q -n modperl-2.0 -a 1
Accepting request 180817 from openSUSE:Factory:Staging:perl518
- update to version 2.0.8 (http24 branch as used by debian):
Perl 5.16.3's fix for a rehash-based DoS makes it more difficult to invoke
the workaround for the old hash collision attack, which breaks mod_perl's
t/perl/hash_attack.t. Patch from rt.cpan.org #83916 improves the fix
previously applied as revision 1455340. [Zefram]
On Perl 5.17.6 and above, hash seeding has changed, and HvREHASH has
disappeared. Patch to update mod_perl accordingly from rt.cpan.org #83921.
[Zefram]
Restore build with Perl 5.8.1, 5.8.2 etc: take care to use
$Config{useithreads} rather than $Config{usethreads}, and supply definitions
of Newx and Newxz as necessary. [Steve Hay]
On Perl 5.17.9, t/apache/read2.t fails because an "uninitialized value"
warning is generated for the buffer being autovivified. This is because
the sv_setpvn() that's meant to vivify the buffer doesn't perform set
magic; the warning is generated by the immediately following SvPV_force().
Patch to fix this from rt.cpan.org #83922. [Zefram]
Fix t/perl/hash_attack.t to work with Perl 5.14.4, 5.16.3 etc, which
contain a fix for CVE-2013-1667 (memory exhaustion with arbitrary hash
keys). This resolves rt.perl.org #116863, from where the patch was taken.
[Hugo van der Sanden]
use APR::Finfo instead of Perl's stat() in ModPerl::RegistryCooker to
generate HTTP code 404 even if the requested filename contains newlines
[Torsten]
- disable patch lfs-perl-5.14.patch as it no longer applies, but
I can't find out if it's still need for ppc64 or if upstream's
OBS-URL: https://build.opensuse.org/request/show/180817
OBS-URL: https://build.opensuse.org/package/show/Apache:Modules/apache2-mod_perl?expand=0&rev=40
2013-06-25 09:08:37 +00:00
%setup -q -n httpd24
2013-08-07 19:15:30 +00:00
%patch2 -p1
2014-09-18 12:28:23 +00:00
%patch3 -p1
Accepting request 180817 from openSUSE:Factory:Staging:perl518
- update to version 2.0.8 (http24 branch as used by debian):
Perl 5.16.3's fix for a rehash-based DoS makes it more difficult to invoke
the workaround for the old hash collision attack, which breaks mod_perl's
t/perl/hash_attack.t. Patch from rt.cpan.org #83916 improves the fix
previously applied as revision 1455340. [Zefram]
On Perl 5.17.6 and above, hash seeding has changed, and HvREHASH has
disappeared. Patch to update mod_perl accordingly from rt.cpan.org #83921.
[Zefram]
Restore build with Perl 5.8.1, 5.8.2 etc: take care to use
$Config{useithreads} rather than $Config{usethreads}, and supply definitions
of Newx and Newxz as necessary. [Steve Hay]
On Perl 5.17.9, t/apache/read2.t fails because an "uninitialized value"
warning is generated for the buffer being autovivified. This is because
the sv_setpvn() that's meant to vivify the buffer doesn't perform set
magic; the warning is generated by the immediately following SvPV_force().
Patch to fix this from rt.cpan.org #83922. [Zefram]
Fix t/perl/hash_attack.t to work with Perl 5.14.4, 5.16.3 etc, which
contain a fix for CVE-2013-1667 (memory exhaustion with arbitrary hash
keys). This resolves rt.perl.org #116863, from where the patch was taken.
[Hugo van der Sanden]
use APR::Finfo instead of Perl's stat() in ModPerl::RegistryCooker to
generate HTTP code 404 even if the requested filename contains newlines
[Torsten]
- disable patch lfs-perl-5.14.patch as it no longer applies, but
I can't find out if it's still need for ppc64 or if upstream's
OBS-URL: https://build.opensuse.org/request/show/180817
OBS-URL: https://build.opensuse.org/package/show/Apache:Modules/apache2-mod_perl?expand=0&rev=40
2013-06-25 09:08:37 +00:00
#%patch1 -p1
2008-01-15 00:34:41 +00:00
find -name " . s v n " -type d | xargs rm -rfv
2007-01-15 22:51:15 +00:00
%build
2014-11-11 11:59:33 +00:00
perl Makefile.PL INSTALLDIRS=vendor MP_APXS=`which %{apache_apxs} ` MP_APR_CONFIG=%{_bindir} /apr-1-config MP_CCOPTS=" %{apache_cflags} "
2007-01-15 22:51:15 +00:00
ln -s Apache-mod_perl_guide-1.29/bin bin
2011-09-19 09:11:02 +00:00
make %{?_smp_mflags}
2007-01-15 22:51:15 +00:00
# XXX mod_include/SSI does not include files when they are not named .shtml
mv t/htdocs/includes-registry/test.pl t/htdocs/includes-registry/test.shtml
mv t/htdocs/includes-registry/cgipm.pl t/htdocs/includes-registry/cgipm.shtml
sed 's/\.pl/.shtml/' t/htdocs/includes/test.shtml > tmpfile && mv tmpfile t/htdocs/includes/test.shtml
2014-11-11 11:59:33 +00:00
%ifnarch %{arm}
2007-01-15 22:51:15 +00:00
#
# Run tests
#
2014-11-11 11:59:33 +00:00
# Don't use sendfile because most systems on which this package will be built don't run a
2007-01-15 22:51:15 +00:00
# kernel that has it implemented, actually
# (Files smaller than 256 bytes will be delivered via conventional read/write, so most of the tests would pass nevertheless.)
echo -e '\n\nEnableSendfile off' >> t/conf/extra.conf.in
#
# fix for bad_scripts.t in 1.99_12
# [Tue Mar 02 17:28:26 2004] [error] file permissions deny server execution/usr/src/packages/BUILD/modperl-2.0/ModPerl-Registry/t/cgi-bin/r_inherited.pl
if test -e ModPerl-Registry/t/cgi-bin/r_inherited.pl; then chmod +x ModPerl-Registry/t/cgi-bin/r_inherited.pl; fi
#
# 1.99_12_20040302 fix for t/hooks/cleanup.t and t/hooks/cleanup2.t
# [Tue Mar 02 18:38:41 2004] [error] [client 127.0.0.1] can't open /usr/src/packages/BUILD/modperl-2.0/t/htdocs/hooks/cleanup2: Permission denied at /usr/src/packages/BUILD/modperl-2.0/Apache-Test/lib/Apache/TestUtil.pm line 82.
#
# enable more apache modules
# we can't simply use a2enmod, since we are not root.
cat >> t/conf/extra.conf.in <<-EOF
2014-11-11 11:59:33 +00:00
#LoadModule access_compat_module %{_prefix}/%_lib/apache2-prefork/mod_access_compat.so
LoadModule authn_core_module %{_libdir} /apache2-prefork/mod_authn_core.so
LoadModule authz_core_module %{_libdir} /apache2-prefork/mod_authz_core.so
#LoadModule unixd_module %{_prefix}/%_lib/apache2-prefork/mod_unixd.so
LoadModule deflate_module %{_libdir} /apache2-prefork/mod_deflate.so
LoadModule proxy_module %{_libdir} /apache2-prefork/mod_proxy.so
LoadModule proxy_http_module %{_libdir} /apache2-prefork/mod_proxy_http.so
2007-01-15 22:51:15 +00:00
EOF
mkdir -p t/htdocs/hooks
chmod 2770 t/htdocs/hooks
#
# run test suite:
#
2014-11-11 11:59:33 +00:00
#make TEST_VERBOSE=1 APACHE_TEST_PORT=select APACHE_TEST_STARTUP_TIMEOUT=360 test || {
2007-01-15 22:51:15 +00:00
# ps aufx | grep "/usr/sbin/httpd2-prefork -d /usr/src/packages/BUILD/modperl-2.0" \
2010-03-05 15:31:13 +00:00
# | grep -v grep | awk '{print $2}' | xargs -r kill
2007-01-15 22:51:15 +00:00
# exit 1
#}
2013-04-07 12:24:28 +00:00
mkdir t/run
2007-01-15 22:51:15 +00:00
t/TEST -start-httpd -port select -startup_timeout 720
2008-01-15 00:34:41 +00:00
t/TEST -run-tests || true
2010-03-05 15:31:13 +00:00
#t/TEST -run-tests || {
# t/TEST -stop-httpd
# exit 1
#}
2007-01-15 22:51:15 +00:00
t/TEST -stop-httpd
# in case of failures, see http://perl.apache.org/docs/2.0/user/help/help.html#_C_make_test___Failures
# then, debug like this:
# t/TEST -start-httpd
# tail -F t/logs/*&
# t/TEST -run-tests -verbose $failed_test
# t/TEST -stop-httpd
%endif
%install
2010-11-30 23:13:42 +00:00
%perl_make_install
### since 11.4 perl_process_packlist
### removes .packlist, perllocal.pod files
%if 0%{?suse_version} > 1130
2007-01-15 22:51:15 +00:00
%perl_process_packlist
2010-11-30 23:13:42 +00:00
%else
# do not perl_process_packlist
# remove .packlist file
2014-11-11 11:59:33 +00:00
find %{buildroot} %{perl_vendorarch} /auto -name .packlist -print0 | xargs -0 -r rm ;
2010-11-30 23:13:42 +00:00
# remove perllocal.pod file
2014-11-11 11:59:33 +00:00
rm -f %{buildroot} %{perl_archlib} /perllocal.pod
2010-11-30 23:13:42 +00:00
%endif
#mkdir -p $RPM_BUILD_ROOT/%{apache_libexecdir}
#cp -p src/modules/perl/mod_perl.so $RPM_BUILD_ROOT/%{apache_libexecdir}
2014-11-11 11:59:33 +00:00
install -D src/modules/perl/mod_perl.so \
%{buildroot} /%{apache_libexecdir} /mod_perl.so
2010-11-30 23:13:42 +00:00
#mkdir -p $RPM_BUILD_ROOT/%{apache_includedir}/modules/perl
2014-11-11 11:59:33 +00:00
install -d %{buildroot} /%{apache_includedir} /modules/perl
cp src/modules/perl/*.h %{buildroot} /%{apache_includedir} /modules/perl/
2010-11-30 23:13:42 +00:00
#mkdir -p $RPM_BUILD_ROOT/%{apache_sysconfdir}/conf.d
2014-11-11 11:59:33 +00:00
install -d %{buildroot} /%{apache_sysconfdir} /conf.d
2010-11-30 23:13:42 +00:00
2014-11-11 11:59:33 +00:00
cat > %{buildroot} /%{apache_sysconfdir} /mod_perl-startup.pl <<-EOF
2007-01-15 22:51:15 +00:00
# Taken from http://perl.apache.org/docs/2.0/user/handlers/server.html#Startup_File
if ( ! \$ENV{MOD_PERL}) { die " G A T E W A Y _ I N T E R F A C E n o t P e r l ! " ; }
use lib qw(/srv/www/perl-lib);
# enable if the mod_perl 1.0 compatibility is needed
# use Apache2::compat ();
# preload all mp2 modules
# use ModPerl::MethodLookup;
# ModPerl::MethodLookup::preload_all_modules();
use ModPerl::Util (); #for CORE::GLOBAL::exit
use Apache2::RequestRec ();
use Apache2::RequestIO ();
use Apache2::RequestUtil ();
use Apache2::ServerRec ();
use Apache2::ServerUtil ();
use Apache2::Connection ();
use Apache2::Log ();
use APR::Table ();
use ModPerl::Registry ();
use Apache2::Const -compile => ':common' ;
use APR::Const -compile => ':common' ;
1;
EOF
2010-11-30 23:13:42 +00:00
#mkdir -p $RPM_BUILD_ROOT/%{apache_serverroot}/perl-lib
2014-11-11 11:59:33 +00:00
install -d %{buildroot} /%{apache_serverroot} /perl-lib
2010-11-30 23:13:42 +00:00
2014-11-11 11:59:33 +00:00
cat > %{buildroot} /%{apache_sysconfdir} /conf.d/mod_perl.conf <<EOF
2007-01-15 22:51:15 +00:00
<Directory " %{apache_serverroot} / p e r l - l i b " >
AllowOverride None
Options None
2014-09-18 10:38:52 +00:00
<IfModule !mod_authz_host.c>
Order allow,deny
Deny from all
</IfModule>
<IfModule mod_authz_host.c>
Require all granted
</IfModule>
2007-01-15 22:51:15 +00:00
</Directory>
<IfModule mod_perl.c>
2014-11-11 11:59:33 +00:00
PerlRequire " %{_sysconfdir} / a p a c h e 2 / m o d _ p e r l - s t a r t u p . p l "
2007-01-15 22:51:15 +00:00
ScriptAlias /perl/ " %{apache_serverroot} / c g i - b i n / "
<Location /perl/>
# mod_perl mode
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI
</Location>
ScriptAlias /cgi-perl/ " %{apache_serverroot} / c g i - b i n / "
<Location /cgi-perl>
# perl cgi mode
SetHandler perl-script
PerlResponseHandler ModPerl::PerlRun
PerlOptions +ParseHeaders
Options +ExecCGI
</Location>
# The /cgi-bin/ ScriptAlias is already set up in httpd.conf
</IfModule>
EOF
# install documentation files alongside perl modules, where applicable
2014-11-11 11:59:33 +00:00
cp -av docs/api/*.pod %{buildroot} /%{perl_vendorarch} /
cp -av docs/api/APR/*.pod %{buildroot} /%{perl_vendorarch} /APR/
cp -av docs/api/Apache2/*.pod %{buildroot} /%{perl_vendorarch} /Apache2/
cp -av docs/api/ModPerl/*.pod %{buildroot} /%{perl_vendorarch} /ModPerl/
find %{buildroot} -type f -name '*.orig' -delete -print
2007-01-15 22:51:15 +00:00
%files
%defattr (-,root,root)
%doc Changes INSTALL LICENSE README RELEASE STATUS
%doc docs
%dir %{apache_libexecdir}
%{apache_libexecdir} /mod_perl.so
%config (noreplace) %{apache_sysconfdir} /mod_perl-startup.pl
%config (noreplace) %{apache_sysconfdir} /conf.d/mod_perl.conf
%dir %{apache_serverroot} /perl-lib
%{_mandir} /man3/*
%{perl_vendorarch} /Apache
%{perl_vendorarch} /Apache2
%{perl_vendorarch} /APR
%{perl_vendorarch} /APR.pm
%{perl_vendorarch} /Bundle
%{perl_vendorarch} /ModPerl
2008-06-30 13:29:48 +00:00
#%{perl_vendorarch}/MyTest
2007-01-15 22:51:15 +00:00
#%dir %{perl_sitearch}/auto
%{perl_vendorarch} /auto/*
%{perl_vendorarch} /mod_perl2.pm
%{perl_vendorarch} /*.pod
2014-11-11 11:59:33 +00:00
%{_bindir} /mp2bug
2007-01-15 22:51:15 +00:00
2007-06-14 14:27:04 +00:00
%files devel
%defattr (-,root,root)
2011-05-23 13:32:03 +00:00
%{apache_includedir} /*
2013-04-07 12:24:28 +00:00
%{perl_vendorarch} /MyTest/
2007-01-15 22:51:15 +00:00
2007-06-14 14:27:04 +00:00
%changelog