8
0

Accepting request 319123 from home:pgajdos:apache2

- updated to 2.0.9: see Changes for details
  * dropped patches:
    - lfs-perl-5.14.patch
    - apache2-mod_perl-2.0.4-tests.diff
    - apache24-mod_authz_host.patch

- turn off inlining for functions which need to be real symbols because they
  are called in a DSO

OBS-URL: https://build.opensuse.org/request/show/319123
OBS-URL: https://build.opensuse.org/package/show/Apache:Modules/apache2-mod_perl?expand=0&rev=55
This commit is contained in:
Vítězslav Čížek
2015-07-28 14:53:31 +00:00
committed by Git OBS Bridge
parent dcec83beb3
commit 3c1f02459e
8 changed files with 84 additions and 405 deletions

View File

@@ -16,19 +16,18 @@
#
%define srcname mod_perl
Name: apache2-mod_perl
Version: 2.0.8
Version: 2.0.9
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
Source0: http://apache.miloslavbrada.cz/perl/%{srcname}-%{version}.tar.gz
Patch0: inline.patch
Patch1: avoid-broken-provides.diff
BuildRequires: apache-rpm-macros
BuildRequires: apache2-devel
BuildRequires: db-devel
@@ -53,10 +52,7 @@ Requires: perl(Linux::Pid)
Obsoletes: mod_perl_2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Conflicts: mod_perl
Icon: mod_perl.xpm
%if 0%{?sles_version} == 9
BuildRequires: openldap2-devel
%endif
Icon: mod_perl.xpm
%description
The Apache/Perl integration project brings together the full power of
@@ -104,127 +100,39 @@ This package contains the include files useful for developing new
software depending on apache2-mod_perl.
%prep
#%setup -q -n modperl-2.0 -a 1
%setup -q -n httpd24
%patch2 -p1
%patch3 -p1
#%patch1 -p1
find -name ".svn" -type d | xargs rm -rfv
%setup -q -n %{srcname}-%{version}
%patch0
%patch1 -p1
%build
perl Makefile.PL INSTALLDIRS=vendor MP_APXS=`which %{apache_apxs}` MP_APR_CONFIG=%{_bindir}/apr-1-config MP_CCOPTS="%{apache_cflags}"
ln -s Apache-mod_perl_guide-1.29/bin bin
perl Makefile.PL INSTALLDIRS=vendor MP_APXS=%{apache_apxs} MP_APR_CONFIG=%{_bindir}/apr-1-config MP_CCOPTS="%{apache_cflags}"
make %{?_smp_mflags}
# 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
%ifnarch %{arm}
#
# Run tests
#
# Don't use sendfile because most systems on which this package will be built don't run a
# 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.
%ifnarch %{arm}
mkdir t/run
# workaround for 32-bit where /usr/lib64/apache2-prefork is hardcoded?
cat >> t/conf/extra.conf.in <<-EOF
#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 authz_user_module %{_libdir}/apache2-prefork/mod_authz_user.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
EOF
mkdir -p t/htdocs/hooks
chmod 2770 t/htdocs/hooks
#
# run test suite:
#
#make TEST_VERBOSE=1 APACHE_TEST_PORT=select APACHE_TEST_STARTUP_TIMEOUT=360 test || {
# ps aufx | grep "/usr/sbin/httpd2-prefork -d /usr/src/packages/BUILD/modperl-2.0" \
# | grep -v grep | awk '{print $2}' | xargs -r kill
# exit 1
#}
mkdir t/run
t/TEST -start-httpd -port select -startup_timeout 720
t/TEST -run-tests || true
#t/TEST -run-tests || {
# t/TEST -stop-httpd
# exit 1
#}
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
exit 0
%install
%perl_make_install
### since 11.4 perl_process_packlist
### removes .packlist, perllocal.pod files
%if 0%{?suse_version} > 1130
%perl_process_packlist
%else
# do not perl_process_packlist
# remove .packlist file
find %{buildroot}%{perl_vendorarch}/auto -name .packlist -print0 | xargs -0 -r rm ;
# remove perllocal.pod file
rm -f %{buildroot}%{perl_archlib}/perllocal.pod
%endif
#mkdir -p $RPM_BUILD_ROOT/%{apache_libexecdir}
#cp -p src/modules/perl/mod_perl.so $RPM_BUILD_ROOT/%{apache_libexecdir}
install -D src/modules/perl/mod_perl.so \
%{buildroot}/%{apache_libexecdir}/mod_perl.so
#mkdir -p $RPM_BUILD_ROOT/%{apache_includedir}/modules/perl
install -d %{buildroot}/%{apache_includedir}/modules/perl
cp src/modules/perl/*.h %{buildroot}/%{apache_includedir}/modules/perl/
#mkdir -p $RPM_BUILD_ROOT/%{apache_sysconfdir}/conf.d
install -d %{buildroot}/%{apache_sysconfdir}/conf.d
cat > %{buildroot}/%{apache_sysconfdir}/mod_perl-startup.pl <<-EOF
# Taken from http://perl.apache.org/docs/2.0/user/handlers/server.html#Startup_File
if ( ! \$ENV{MOD_PERL}) { die "GATEWAY_INTERFACE not Perl!"; }
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
#mkdir -p $RPM_BUILD_ROOT/%{apache_serverroot}/perl-lib
# install /srv/www/perl-lib
install -d %{buildroot}/%{apache_serverroot}/perl-lib
# install /etc/apache2/conf.d/mod_perl.conf
install -d %{buildroot}/%{apache_sysconfdir}/conf.d
cat > %{buildroot}/%{apache_sysconfdir}/conf.d/mod_perl.conf <<EOF
<Directory "%{apache_serverroot}/perl-lib">
AllowOverride None
@@ -258,16 +166,50 @@ cat > %{buildroot}/%{apache_sysconfdir}/conf.d/mod_perl.conf <<EOF
# The /cgi-bin/ ScriptAlias is already set up in httpd.conf
</IfModule>
EOF
# install /etc/apache2/mod_perl-startup.pl
cat > %{buildroot}/%{apache_sysconfdir}/mod_perl-startup.pl <<-EOF
# Taken from http://perl.apache.org/docs/2.0/user/handlers/server.html#Startup_File
if ( ! \$ENV{MOD_PERL}) { die "GATEWAY_INTERFACE not Perl!"; }
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
# install documentation files alongside perl modules, where applicable
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
### since 11.4 perl_process_packlist
### removes .packlist, perllocal.pod files
%if 0%{?suse_version} > 1130
%perl_process_packlist
%else
# do not perl_process_packlist
# remove .packlist file
find %{buildroot}%{perl_vendorarch}/auto -name .packlist -print0 | xargs -0 -r rm ;
# remove perllocal.pod file
rm -f %{buildroot}%{perl_archlib}/perllocal.pod
%endif
%files
%defattr(-,root,root)
%doc Changes INSTALL LICENSE README RELEASE STATUS
%doc Changes LICENSE README RELEASE STATUS
%doc docs
%dir %{apache_libexecdir}
%{apache_libexecdir}/mod_perl.so
@@ -281,8 +223,6 @@ find %{buildroot} -type f -name '*.orig' -delete -print
%{perl_vendorarch}/APR.pm
%{perl_vendorarch}/Bundle
%{perl_vendorarch}/ModPerl
#%{perl_vendorarch}/MyTest
#%dir %{perl_sitearch}/auto
%{perl_vendorarch}/auto/*
%{perl_vendorarch}/mod_perl2.pm
%{perl_vendorarch}/*.pod
@@ -291,6 +231,5 @@ find %{buildroot} -type f -name '*.orig' -delete -print
%files devel
%defattr(-,root,root)
%{apache_includedir}/*
%{perl_vendorarch}/MyTest/
%changelog