%bcond_with tests # default off; test process very often hangs on builders, approx run time 45m; perform "make test"
%bcond_with zts # Zend Thread Safety
# - SAPI
-%bcond_with apache1 # disable building Apache 1.3.x SAPI
%bcond_without apache2 # disable building Apache 2.x SAPI
%bcond_without cgi # disable CGI/FCGI SAPI
%bcond_without fpm # disable FPM SAPI
# disable all sapis
%if %{with gcov}
-%undefine with_apache1
%undefine with_apache2
%undefine with_cgi
%undefine with_litespeed
%undefine with_fpm
%endif
-%if 0
-%if %{without apache1} && %{without apache2}
-ERROR: You need to select at least one Apache SAPI to build shared modules.
-%endif
-%endif
-
# filter depends on pcre
%if %{without pcre}
%undefine with_filter
%{?with_odbc:BuildRequires: unixODBC-devel}
%{?with_xmlrpc:BuildRequires: xmlrpc-epi-devel >= 0.54.1}
BuildRequires: zlib-devel >= 1.0.9
-%if %{with apache1}
-BuildRequires: apache1-devel
-%endif
%if %{with apache2}
BuildRequires: apache-devel >= 2.0.52-2
BuildRequires: apr-devel >= 1:1.0.0
роботи з базами даних є доволі простим. Найбільш популярне
використання PHP - заміна для CGI скриптів.
-%package -n apache1-mod_%{name}
-Summary: PHP DSO module for Apache 1.3.x
-Summary(pl.UTF-8): Moduł DSO (Dynamic Shared Object) PHP dla Apache 1.3.x
-Group: Development/Languages/PHP
-Requires: %{name}-common = %{epoch}:%{version}-%{release}
-Requires: apache1(EAPI) >= 1.3.33-2
-Requires: apache1-mod_mime
-Provides: webserver(php) = %{version}
-Obsoletes: apache-mod_php < 1:4.1.1
-Obsoletes: apache1-mod_php < 4:5.3.28-7
-Obsoletes: phpfi
-
-%description -n apache1-mod_%{name}
-PHP as DSO module for Apache 1.3.x.
-
-%description -n apache1-mod_%{name} -l pl.UTF-8
-PHP jako moduł DSO (Dynamic Shared Object) dla Apache 1.3.x.
-
%package -n apache-mod_%{name}
Summary: PHP DSO module for Apache 2.x
Summary(pl.UTF-8): Moduł DSO (Dynamic Shared Object) PHP dla Apache 2.x
%if %{with embed}
embed
%endif
-%if %{with apache1}
-apxs1
-%endif
%if %{with apache2}
apxs2
%endif
embed)
sapi_args='--disable-cli --disable-cgi --enable-embed'
;;
- apxs1)
- ver=$(rpm -q --qf '%{V}' apache1-devel)
- sapi_args="--disable-cli --disable-cgi --with-apxs=%{apxs1} --with-apache-version=$ver"
- ;;
apxs2)
ver=$(rpm -q --qf '%{V}' apache-devel)
sapi_args="--disable-cli --disable-cgi --with-apxs2=%{apxs2} --with-apache-version=$ver"
%{__make} build-modules \
MYSQLND_SHARED_LIBADD="-lssl -lcrypto"
-%if %{with apache1}
-%{__make} libtool-sapi LIBTOOL_SAPI=sapi/apache/libphp5.la -f Makefile.apxs1
-%endif
-
%if %{with apache2}
%{__make} libtool-sapi LIBTOOL_SAPI=sapi/apache2handler/libphp5.la -f Makefile.apxs2
%endif
# version suffix
v=$(echo %{version} | cut -d. -f1-2)
-# install Apache1 DSO module
-%if %{with apache1}
-libtool --mode=install install -p sapi/apache/libphp5.la $RPM_BUILD_ROOT%{_libdir}/apache1
-%{__mv} $RPM_BUILD_ROOT%{_libdir}/apache1/libphp5{,-$v}.so
-ln -s libphp5-$v.so $RPM_BUILD_ROOT%{_libdir}/apache1/mod_php.so
-%endif
-
# install Apache2 DSO module
%if %{with apache2}
libtool --mode=install install -p sapi/apache2handler/libphp5.la $RPM_BUILD_ROOT%{_libdir}/apache
cp -p sapi/embed/php_embed.h $RPM_BUILD_ROOT%{_includedir}/php/php%{php_suffix}/sapi/embed
%endif
-# install CLI
-# versioned suffix is always installed
-#libtool --mode=install install -p sapi/cli/php $RPM_BUILD_ROOT%{_bindir}/php%{php_suffix}
-#cp -p sapi/cli/php.1 $RPM_BUILD_ROOT%{_mandir}/man1/php%{php_suffix}.1
+# CLI
# touch for ghost
touch $RPM_BUILD_ROOT%{_bindir}/php
touch $RPM_BUILD_ROOT%{_mandir}/man1/php.1
cp -p php.ini $RPM_BUILD_ROOT%{_sysconfdir}/php.ini
cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/php-cli.ini
-%if %{with apache1}
-cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/apache/conf.d/70_mod_php.conf
-cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/php-apache.ini
-%{__rm} -f $RPM_BUILD_ROOT%{_libdir}/apache1/libphp5.la
-%endif
-
%if %{with apache2}
cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/httpd/conf.d/70_mod_php.conf
cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/php-apache2handler.ini
# better solution?
sed -i -e 's|libphp_common.la|$(libdir)/libphp_common.la|' $RPM_BUILD_ROOT%{_libdir}/%{name}/build/acinclude.m4
-# somewhy there are installed static versions we don't use
-%if %{with apache1} || %{with apache2}
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/apache*/libphp*.a
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/libphp*.a
-%{__rm} $RPM_BUILD_ROOT%{php_extensiondir}/*.a
-%endif
-
%clean
rm -rf $RPM_BUILD_ROOT
-%post -n apache1-mod_%{name}
-if [ "$1" = "1" ]; then
- %service -q apache restart
-fi
-
-%postun -n apache1-mod_%{name}
-if [ "$1" = "0" ]; then
- %service -q apache restart
-fi
-
%post -n apache-mod_%{name}
if [ "$1" = "1" ]; then
%service -q httpd restart
%{__sed} -i -e 's#^browscap = /usr/share/browscap/php_browscap.ini#;&#' %{_sysconfdir}/php.ini
fi
-%triggerpostun -n apache1-mod_%{name} -- apache1-mod_%{name} < 4:5.6.14-2
-sed -i -e 's#modules/libphp5.so#modules/mod_php.so#g' /etc/apache/conf.d/*_mod_php.conf
-
%triggerpostun -n apache-mod_%{name} -- apache-mod_%{name} < 4:5.6.14-2
sed -i -e 's#modules/libphp[57].so#modules/mod_php.so#g' /etc/httpd/conf.d/*_mod_php.conf
update-alternatives --remove phar %{_bindir}/phar || :
fi
-%if %{with apache1}
-%files -n apache1-mod_%{name}
-%defattr(644,root,root,755)
-%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/apache/conf.d/*_mod_php.conf
-%dir %{_sysconfdir}/apache.d
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php-apache.ini
-%attr(755,root,root) %{_libdir}/apache1/mod_php.so
-%attr(755,root,root) %{_libdir}/apache1/libphp5-*.*.so
-%endif
-
%if %{with apache2}
%files -n apache-mod_%{name}
%defattr(644,root,root,755)
%dir %{_sysconfdir}
%dir %{_sysconfdir}/conf.d
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php.ini
-%if %{with apache1} || %{with apache2}
+%if %{with apache2}
%attr(755,root,root) %{_libdir}/libphp_common-*.so
%endif
%dir %{php_extensiondir}
%attr(755,root,root) %{_bindir}/php-config%{php_suffix}
%ghost %{_bindir}/phpize
%ghost %{_bindir}/php-config
-%if %{with apache1} || %{with apache2}
+%if %{with apache2}
%attr(755,root,root) %{_libdir}/libphp_common.so
%else
%attr(755,root,root) %{_libdir}/libphp_common.a