split apache conf + fix Loadmodule for MPM event

This commit is contained in:
remi 2012-03-31 09:18:35 +02:00
parent 8c2d499693
commit 3208f1a52c
3 changed files with 37 additions and 17 deletions

View File

@ -1,14 +1,3 @@
#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
<IfModule prefork.c>
LoadModule php5_module modules/libphp5.so
</IfModule>
<IfModule worker.c>
LoadModule php5_module modules/libphp5-zts.so
</IfModule>
# #
# Cause the PHP interpreter to handle files with a .php extension. # Cause the PHP interpreter to handle files with a .php extension.
# #

12
php.modconf Normal file
View File

@ -0,0 +1,12 @@
#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
<IfModule prefork.c>
LoadModule php5_module modules/libphp5.so
</IfModule>
<IfModule !prefork.c>
LoadModule php5_module modules/libphp5-zts.so
</IfModule>

View File

@ -9,7 +9,6 @@
%global zipver 1.9.1 %global zipver 1.9.1
%global jsonver 1.2.1 %global jsonver 1.2.1
%{!?_httpd_mmn: %{expand: %%global _httpd_mmn %%(cat %{_includedir}/httpd/.mmn || echo missing-httpd-devel)}}
%global mysql_sock %(mysql_config --socket || echo /var/lib/mysql/mysql.sock) %global mysql_sock %(mysql_config --socket || echo /var/lib/mysql/mysql.sock)
# Regression tests take a long time, you can skip 'em with this # Regression tests take a long time, you can skip 'em with this
@ -31,7 +30,12 @@
%global isasuffix %nil %global isasuffix %nil
%endif %endif
# /usr/sbin/apsx with httpd < 2.4 and defined as /usr/bin/apxs with httpd >= 2.4
%{!?_httpd_apxs: %{expand: %%global _httpd_apxs %%{_sbindir}/apxs}} %{!?_httpd_apxs: %{expand: %%global _httpd_apxs %%{_sbindir}/apxs}}
%{!?_httpd_mmn: %{expand: %%global _httpd_mmn %%(cat %{_includedir}/httpd/.mmn || echo missing-httpd-devel)}}
%{!?_httpd_confdir: %{expand: %%global _httpd_confdir %%{_sysconfdir}/httpd/conf.d}}
# /etc/httpd/conf.d with httpd < 2.4 and defined as /etc/httpd/conf.modules.d with httpd >= 2.4
%{!?_httpd_modconfdir: %{expand: %%global _httpd_modconfdir %%{_sysconfdir}/httpd/conf.d}}
%if 0%{?fedora} >= 17 %if 0%{?fedora} >= 17
%global with_zip 1 %global with_zip 1
@ -46,7 +50,7 @@
Summary: PHP scripting language for creating dynamic web sites Summary: PHP scripting language for creating dynamic web sites
Name: php Name: php
Version: 5.4.0 Version: 5.4.0
Release: 4%{?dist} Release: 5%{?dist}
License: PHP License: PHP
Group: Development/Languages Group: Development/Languages
URL: http://www.php.net/ URL: http://www.php.net/
@ -60,6 +64,7 @@ Source5: php-fpm-www.conf
Source6: php-fpm.service Source6: php-fpm.service
Source7: php-fpm.logrotate Source7: php-fpm.logrotate
Source8: php-fpm.sysconfig Source8: php-fpm.sysconfig
Source9: php.modconf
# Build fixes # Build fixes
Patch1: php-5.4.0-httpd24.patch Patch1: php-5.4.0-httpd24.patch
@ -1003,8 +1008,15 @@ install -m 755 build-apache/libs/libphp5.so $RPM_BUILD_ROOT%{_libdir}/httpd/modu
install -m 755 build-zts/libs/libphp5.so $RPM_BUILD_ROOT%{_libdir}/httpd/modules/libphp5-zts.so install -m 755 build-zts/libs/libphp5.so $RPM_BUILD_ROOT%{_libdir}/httpd/modules/libphp5-zts.so
# Apache config fragment # Apache config fragment
install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d %if "%{_httpd_modconfdir}" == "%{_httpd_confdir}"
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d # Single config file with httpd < 2.4 (fedora <= 17)
install -D -m 644 %{SOURCE9} $RPM_BUILD_ROOT%{_httpd_confdir}/php.conf
cat %{SOURCE1} >>$RPM_BUILD_ROOT%{_httpd_confdir}/php.conf
%else
# Dual config file with httpd >= 2.4 (fedora >= 18)
install -D -m 644 %{SOURCE9} $RPM_BUILD_ROOT%{_httpd_modconfdir}/10-php.conf
install -D -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_httpd_confdir}/php.conf
%endif
install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}/php.d install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}/php.d
install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}/php-zts.d install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}/php-zts.d
@ -1162,7 +1174,10 @@ fi
%{_libdir}/httpd/modules/libphp5.so %{_libdir}/httpd/modules/libphp5.so
%{_libdir}/httpd/modules/libphp5-zts.so %{_libdir}/httpd/modules/libphp5-zts.so
%attr(0770,root,apache) %dir %{_localstatedir}/lib/php/session %attr(0770,root,apache) %dir %{_localstatedir}/lib/php/session
%config(noreplace) %{_sysconfdir}/httpd/conf.d/php.conf %config(noreplace) %{_httpd_confdir}/php.conf
%if "%{_httpd_modconfdir}" != "%{_httpd_confdir}"
%config(noreplace) %{_httpd_modconfdir}/10-php.conf
%endif
%{contentdir}/icons/php.gif %{contentdir}/icons/php.gif
%files common -f files.common %files common -f files.common
@ -1259,6 +1274,10 @@ fi
%changelog %changelog
* Sat Mar 31 2012 Remi Collet <remi@fedoraproject.org> 5.4.0-5
- fix Loadmodule with MPM event (use ZTS if not MPM worker)
- split conf.d/php.conf + conf.modules.d/10-php.conf with httpd 2.4
* Thu Mar 29 2012 Joe Orton <jorton@redhat.com> - 5.4.0-4 * Thu Mar 29 2012 Joe Orton <jorton@redhat.com> - 5.4.0-4
- rebuild for missing automatic provides (#807889) - rebuild for missing automatic provides (#807889)