%define perl_vendorarch %(eval "`%{_bindir}/perl -V:installvendorarch`"; echo $installvendorarch) %define real_name mod_perl Name: mod_perl-ap24 Version: 2.0.7 Release: 1 Summary: An embedded Perl interpreter for the Apache HTTP Server 2.4.X Group: System Environment/Daemons License: ASL 2.0 URL: http://perl.apache.org/ Source0: http://perl.apache.org/dist/%{real_name}-%{version}.tar.gz Source1: http://perl.apache.org/dist/%{real_name}-%{version}.tar.gz.asc Source2: %{real_name}.conf Patch0: %{real_name}-%{version}-multilib.patch Patch1: %{real_name}-%{version}-httpd24.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: apr-devel >= 1.4.6, apr-util-devel >= 1.3.10-3 BuildRequires: gdbm-devel BuildRequires: httpd-devel >= 2.4.2, httpd-devel < 2.6 BuildRequires: patch BuildRequires: perl >= 5.8.8 Requires: apr >= 1.4.6, apr-util >= 1.3.10-3 Requires: httpd >= 2.4.2, httpd < 2.6 Requires: perl >= 5.8.8 %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 -n %{real_name}-%{version} export PATH=/opt/freeware/bin:$PATH %patch0 -p1 %patch1 -p1 %build export MP_USE_MY_EXTUTILS_EMBED=1 %{_bindir}/perl Makefile.PL \ PREFIX=${RPM_BUILD_ROOT}%{_prefix} \ INSTALLDIRS=vendor \ MP_APXS=%{_bindir}/apxs \ MP_APR_CONFIG=%{_bindir}/apr-1-config make %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} export MP_USE_MY_EXTUTILS_EMBED=1 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 %{SOURCE2} ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/extra/httpd-%{real_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 * Tue Jun 19 2012 Michael Perzl - 2.0.7-1 - updated to version 2.0.7 * Tue Jun 19 2012 Michael Perzl - 2.0.6-1 - first version for AIX V5.1 and higher