# TODO:
-# - add devel subpackage
+# - orphaned dirs for %{_manualdocdir}/mod/*html
+#
+%bcond_without ipv6 # disable IPv6 support. must match same bcond from apache1-devel
+#
%include /usr/lib/rpm/macros.perl
-%define apxs /usr/sbin/apxs
+%define mod_name perl
+%define apxs /usr/sbin/apxs1
Summary: A Perl interpreter for the Apache Web server
Summary(cs): Vestavìný interpret Perlu pro WWW server Apache
Summary(da): En indbygget Perl-fortolker for webtjeneren Apache
Summary(is): Perl túlkur fyrir Apache vefþjóninn
Summary(it): Interprete Perl integrato per il server Web Apache
Summary(ja): Apache Web ¥µ¡¼¥Ð¡¼ÍѤÎÁȹþ¤ß Perl ¥¤¥ó¥¿¡¼¥×¥ê¥¿
-Summary(no): En Perl-fortolker for webtjeneren Apache
-Summary(pl): Interpreter perla dla serwera WWW Apache
+Summary(nb): En Perl-fortolker for webtjeneren Apache
+Summary(pl): Interpreter Perla dla serwera WWW Apache
Summary(pt): Um interpretador de Perl embebido para o servidor Web Apache
Summary(ru): ÷ÓÔÒÏÅÎÎÙÊ ÉÎÔÅÒÐÒÅÔÁÔÏÒ Perl ÄÌÑ WWW-ÓÅÒ×ÅÒÁ Apache
Summary(sk): Interpreter jazyka Perl pre webový server Apache
Summary(uk): íÏÄÕÌØ ×ÂÕÄÏ×Õ×ÁÎÎÑ ¦ÎÔÅÒÐÒÅÔÁÔÏÒÁ Perl × ÓÅÒ×ÅÒ Apache
Summary(zh_CN): ÓÃÓÚ Apache web ·þÎñ³ÌÐòµÄ Perl ½âÊͳÌÐò¡£
Name: apache1-mod_perl
-Version: 1.27
-Release: 3
+Version: 1.29
+Release: 14
License: GPL
Group: Networking/Daemons
Source0: http://perl.apache.org/dist/mod_perl-%{version}.tar.gz
-# Source0-md5: bd07f4f1065eb0d0a8d8004219357d8c
+# Source0-md5: 1491931790509b9af06fc037d02b0e7a
Patch0: apache-perl-rh.patch
# from ftp://ftp.kddlabs.co.jp/Linux/packages/Kondara/pub/Jirai/
Patch1: mod_perl-v6.patch
+Patch2: %{name}-optimize.patch
URL: http://perl.apache.org/
-BuildRequires: apache(EAPI)-devel
-BuildRequires: perl >= 5.8.0
+BuildRequires: %{apxs}
+%{?with_ipv6:BuildRequires: apache1(ipv6)-devel}
+BuildRequires: apache1-devel >= 1.3.33-2
BuildRequires: perl-B-Graph
BuildRequires: perl-BSD-Resource
BuildRequires: perl-Devel-Symdump
BuildRequires: perl-HTML-Parser
BuildRequires: perl-MIME-Base64
BuildRequires: perl-URI
+BuildRequires: perl-devel >= 1:5.8.0
BuildRequires: perl-libwww
BuildRequires: rpm-perlprov >= 4.1-13
-BuildRequires: %{apxs}
-PreReq: apache(EAPI)
-Requires(post,preun): %{apxs}
-Provides: perl(mod_perl_hooks)
-Provides: mod_perl
+BuildRequires: rpmbuild(macros) >= 1.268
+Requires(triggerpostun): sed >= 4.0
+Requires: apache1(EAPI)
+Requires: perl(DynaLoader) = %(%{__perl} -MDynaLoader -e 'print DynaLoader->VERSION')
+Provides: apache(mod_perl)
Obsoletes: mod_perl
Obsoletes: mod_perl-common
+# older apache1-mod_perl could make bad autodeps to perl-mod_perl1
+BuildConflicts: apache1-mod_perl < 1.29-12.1
+%{!?with_ipv6:Conflicts: apache1(ipv6)}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+%define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
+%define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)
+%define _noautoreqdep 'perl(Apache::.*)' 'perl(mod_perl)'
+%define _manualdocdir %{_datadir}/apache1-manual
+
%description
Mod_perl incorporates a Perl interpreter into the Apache web server,
so that the Apache web server can directly execute Perl code. Mod_perl
%description -l pl
Mod_perl jest modu³em, który wyposa¿a serwer Apache w interpreter
-perla, umo¿liwiaj±c w ten sposób bezpo¶rednie wykonywanie kodu perla
+Perla, umo¿liwiaj±c w ten sposób bezpo¶rednie wykonywanie kodu Perla
przez serwer bez potrzeby anga¿owania zewnêtrznego interpretera, co
przyspiesza procesy zwi±zane z uruchamianiem skryptów CGI.
½Ó¿Ú¡£ ÓÉÓÚ²»±ØÆô¶¯ÈκÎÍⲿ Perl ½âÊͳÌÐò£¬Òò´Ë»áʹ CGI
½Å±¾»Øת¹ý³Ì¸üΪ¿ìËÙ¡£
+%package devel
+Summary: Files needed for building XS modules that use mod_perl
+Summary(pl): Pliki potrzebne do budowania modu³ów XS korzystaj±cych z mod_perla
+Group: Development/Libraries
+Requires: apache1-devel
+Requires: perl-mod_%{mod_name}1 = %{version}-%{release}
+
+%description devel
+The apache1-mod_perl-devel package contains the files needed for
+building XS modules that use mod_perl.
+
+%description devel -l pl
+Ten pakiet zawiera pliki potrzebne do budowania modu³ów XS
+korzystaj±cych z mod_perla.
+
+%package -n perl-mod_%{mod_name}1
+Summary: Perl APIs for mod_perl
+Summary(pl): Perlowe API dla mod_perla
+Group: Development/Languages/Perl
+
+%description -n perl-mod_%{mod_name}1
+Perl APIs for mod_perl.
+
+%description -n perl-mod_%{mod_name}1 -l pl
+Perlowe API dla mod_perl.
+
%prep
%setup -q -n mod_perl-%{version}
%patch0 -p1
-%patch1 -p1
+%{?with_ipv6:%patch1 -p1}
+%patch2 -p1
%build
-perl Makefile.PL \
+%{__perl} Makefile.PL \
USE_APXS=1 \
WITH_APXS=%{apxs} \
EVERYTHING=1 \
PERL_STACKED_HANDLERS=1 \
+ OPTIMIZE="%{rpmcflags}" \
INSTALLDIRS=vendor
-(cd apaci; ln -s ../src/modules .; chmod +x find_source)
-%{__make}
+ln -s ../src/modules apaci/modules
+chmod +x apaci/find_source
-cd faq
-%{__make}
+%{__make} \
+ OPTIMIZE="%{rpmcflags}"
+%{__make} -C faq
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_libdir}/apache,/home/httpd/manual/mod}
+install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/conf.d,%{_manualdocdir}/mod}
-%{__make} pure_install DESTDIR=$RPM_BUILD_ROOT
+%{__make} pure_install \
+ DESTDIR=$RPM_BUILD_ROOT
-install apaci/libperl.so $RPM_BUILD_ROOT%{_libdir}/apache
+install apaci/libperl.so $RPM_BUILD_ROOT%{_pkglibdir}
install htdocs/manual/mod/mod_perl.html \
- $RPM_BUILD_ROOT/home/httpd/manual/mod
+ $RPM_BUILD_ROOT%{_manualdocdir}/mod
+
+echo 'LoadModule %{mod_name}_module modules/lib%{mod_name}.so' > \
+ $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod_%{mod_name}.conf
+
+# clean known unpackaged files
+rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/*.pod
+rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/Bundle/Apache.pm
+rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/mod_%{mod_name}/.packlist
+rm -f $RPM_BUILD_ROOT%{_mandir}/man3/Bundle::Apache.3pm*
%clean
rm -rf $RPM_BUILD_ROOT
%post
-%{apxs} -e -a -n perl %{_libexecdir}/libperl.so 1>&2
-if [ -f /var/lock/subsys/httpd ]; then
- /etc/rc.d/init.d/httpd restart 1>&2
-else
- echo "Run \"/etc/rc.d/init.d/httpd start\" to start apache http daemon."
-fi
+%service -q apache restart
-%preun
+%postun
if [ "$1" = "0" ]; then
- %{apxs} -e -A -n perl %{_libexecdir}/libperl.so 1>&2
- if [ -f /var/lock/subsys/httpd ]; then
- /etc/rc.d/init.d/httpd restart 1>&2
- fi
+ %service -q apache restart
fi
+%triggerpostun -- apache1-mod_%{mod_name} < 1.29-7.1
+# check that they're not using old apache.conf
+if grep -q '^Include conf\.d' /etc/apache/apache.conf; then
+ %{__sed} -i -e '/^\(Add\|Load\)Module.*libperl\.\(so\|c\)/d' /etc/apache/apache.conf
+fi
%files
%defattr(644,root,root,755)
%doc README INSTALL CREDITS faq/*.html faq/*.txt apache-modlist.html eg
-%doc /home/httpd/manual/mod/*html
+# FIXME: parent dirs not owned as the manualdocdir (via apache1-doc) is not in deps
+%doc %{_manualdocdir}/mod/*html
-%attr(755,root,root) %{_libdir}/apache/*.so
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf
+%attr(755,root,root) %{_pkglibdir}/*
+%files -n perl-mod_%{mod_name}1
+%defattr(644,root,root,755)
%{perl_vendorarch}/*.pm
%{perl_vendorarch}/*.PL
%{_mandir}/man3/[Acm]*
-# to -devel ?
+%files devel
+%defattr(644,root,root,755)
%{perl_vendorarch}/auto/Apache/typemap
%{perl_vendorarch}/auto/Apache/mod_perl.exp
%{perl_vendorarch}/auto/Apache/include