%define perl_vendorarch %(eval "`%{_bindir}/perl -V:installvendorarch`"; echo $installvendorarch) Name: mod_perl Version: 2.0.4 Release: 1 Summary: An embedded Perl interpreter for the Apache HTTP Server Group: System Environment/Daemons License: ASL 2.0 URL: http://perl.apache.org/ Source0: http://perl.apache.org/dist/%{name}-%{version}.tar.gz Source1: %{name}.conf Patch0: %{name}-%{version}-multilib.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: perl >= 5.8.8 BuildRequires: httpd-devel >= 2.2.0, httpd >= 2.2.0, gdbm-devel BuildRequires: apr-devel >= 1.2.0, apr-util-devel Requires: perl >= 5.8.8 Requires: httpd >= 2.2.0 Requires: apr >= 1.2.0, apr-util %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 links the Perl runtime library into the Apache web server and provides an object-oriented Perl interface for Apache's C language API. The end result is a quicker CGI script turnaround process, since no external Perl interpreter has to be started. Install mod_perl if you're installing the Apache web server and you'd like for it to directly incorporate a Perl interpreter. The mod_perl package also contains the files needed for building XS modules that use mod_perl. %prep %setup -q %patch0 -p1 %build %{_bindir}/perl Makefile.PL \ PREFIX=${RPM_BUILD_ROOT}%{_prefix} \ INSTALLDIRS=vendor \ MP_APXS=%{_sbindir}/apxs \ MP_APR_CONFIG=%{_bindir}/apr-1-config make %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} make install \ MODPERL_AP_LIBEXECDIR=${RPM_BUILD_ROOT}%{_libdir}/httpd/modules \ MODPERL_AP_INCLUDEDIR=${RPM_BUILD_ROOT}%{_includedir}/httpd # Remove the temporary files find ${RPM_BUILD_ROOT} -type f -name .packlist -exec rm -f {} ';' find ${RPM_BUILD_ROOT} -type f -name perllocal.pod -exec rm -f {} ';' find ${RPM_BUILD_ROOT} -type d -depth -exec rmdir {} 2>/dev/null ';' # Fix permissions to avoid strip failures on non-root builds. chmod -R u+w ${RPM_BUILD_ROOT}/* # Install the config file mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/extra cp %{SOURCE1} ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/extra/httpd-%{name}.conf chmod 0644 ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/extra/*.conf %preun if [ "$1" = 0 ]; then cat %{_sysconfdir}/httpd/conf/httpd.conf | \ grep -v "# mod_perl settings" | \ grep -v "Include conf/extra/httpd-mod_perl.conf" \ > %{_sysconfdir}/httpd/conf/tmp_httpd.conf mv -f %{_sysconfdir}/httpd/conf/tmp_httpd.conf %{_sysconfdir}/httpd/conf/httpd.conf echo "Please restart your web server using: '/opt/freeware/sbin/apachectl restart'" fi %post cat %{_sysconfdir}/httpd/conf/httpd.conf | \ grep -v "# mod_perl settings" | \ grep -v "Include conf/extra/httpd-mod_perl.conf" \ > %{_sysconfdir}/httpd/conf/tmp_httpd.conf mv -f %{_sysconfdir}/httpd/conf/tmp_httpd.conf %{_sysconfdir}/httpd/conf/httpd.conf echo "# mod_perl settings" >> %{_sysconfdir}/httpd/conf/httpd.conf echo "Include conf/extra/httpd-mod_perl.conf" >> %{_sysconfdir}/httpd/conf/httpd.conf echo "Please restart your web server using: '/opt/freeware/sbin/apachectl restart'" %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc Changes LICENSE README* STATUS SVN-MOVE docs/ %config(noreplace) %{_sysconfdir}/httpd/conf/extra/*.conf %{_bindir}/* %{_includedir}/httpd/* %{_libdir}/httpd/modules/* %{perl_vendorarch}/* %{_mandir}/man3/* %changelog * Wed Dec 02 2009 Michael Perzl - 2.0.4-1 - first version for AIX V5.1 and higher