Summary(uk): PHP ÷ÅÒÓ¦§ 5 - ÍÏ×Á ÐÒÅÐÒÏÃÅÓÕ×ÁÎÎÑ HTML-ÆÁÊ̦×, ×ÉËÏÎÕ×ÁÎÁ ÎÁ ÓÅÒ×ÅÒ¦
Name: php
Version: 5.0.5
-Release: 1%{?with_hardening:hardened}
+Release: 2%{?with_hardening:hardened}
Epoch: 4
Group: Libraries
License: PHP
Patch29: %{name}-gcc4.patch
Patch30: %{name}-hardening-fix.patch
Patch31: %{name}-both-apxs.patch
+Patch32: %{name}-builddir.patch
Icon: php.gif
URL: http://www.php.net/
%{?with_interbase:%{!?with_interbase_inst:BuildRequires: Firebird-devel >= 1.0.2.908-2}}
patch -p1 < %{PATCH30}
%endif
%patch31 -p1
+%patch32 -p1
# conflict seems to be resolved by recode patches
rm -f ext/recode/config9.m4
-# fix lib path in phpize
-cd scripts/
-sed -i -e 's,lib/php,%{_lib}/php,' phpize.in
-cd ..
-
# new apr
sed -i -e 's#apr-config#apr-1-config#g' sapi/apache*/*.m4
`
case $sapi in
cgi)
- echo --enable-discard-path
+ echo --enable-discard-path --enable-force-cgi-redirect
;;
cli)
echo --disable-cgi
;;
fcgi)
- echo --enable-fastcgi --with-fastcgi=/usr
+ echo --enable-fastcgi --with-fastcgi=/usr --enable-force-cgi-redirect
;;
apxs1)
ver=%(rpm -q --qf '%%{version}' apache1-apxs)
;;
apxs2)
ver=%(rpm -q --qf '%%{version}' apache-apxs)
- echo --with-apxs2=%{apxs2} --with-apache-version=$ver --enable-maintainer-zts
+ echo --with-apxs2=%{apxs2} --with-apache-version=$ver
;;
esac
` \
--with-config-file-scan-dir=%{_sysconfdir}/conf.d \
--with-exec-dir=%{_bindir} \
--%{!?debug:dis}%{?debug:en}able-debug \
+ --enable-maintainer-zts \
--enable-memory-limit \
--enable-bcmath=shared \
--enable-calendar=shared \
# fix install paths, avoid evil rpaths
sed -i -e "s|^libdir=.*|libdir='%{_libdir}'|" libphp_common.la
-# for fcgi: -DDISCARD_PATH=0 -DENABLE_PATHINFO_CHECK=1 -DFORCE_CGI_REDIRECT=0
-# -DHAVE_FILENO_PROTO=1 -DHAVE_FPOS=1 -DHAVE_LIBNSL=1(die) -DHAVE_SYS_PARAM_H=1
-# -DPHP_FASTCGI=1 -DPHP_FCGI_STATIC=1 -DPHP_WRITE_STDOUT=1
%if %{with apache1}
%{__make} libtool-sapi LIBTOOL_SAPI=sapi/apache/libphp5.la -f Makefile.apxs1
sed -i -e "
s|^(relink_command=.* -rpath )[^ ]*/libs |$1%{_libdir}/apache |" sapi/apache2handler/libphp5.la
%endif
-%{__make} sapi/cgi/php -f Makefile.fcgi \
- CFLAGS_CLEAN="%{rpmcflags} -DDISCARD_PATH=0 -DENABLE_PATHINFO_CHECK=1 -DFORCE_CGI_REDIRECT=0 -DHAVE_FILENO_PROTO=1 -DHAVE_FPOS=1 -DHAVE_LIBNSL=1 -DHAVE_SYS_PARAM_H=1 -DPHP_FASTCGI=1 -DPHP_FCGI_STATIC=1 -DPHP_WRITE_STDOUT=1"
+# FCGI
+cp -af php_config.h.fcgi main/php_config.h
+%{__make} sapi/cgi/php -f Makefile.fcgi
cp -r sapi/cgi sapi/fcgi
rm -rf sapi/cgi/.libs sapi/cgi/*.lo
-# notes:
-# -DENABLE_CHROOT_FUNC=1 (cgi,fcgi) is used in ext/standard/dir.c (libphp_common)
-# -DPHP_WRITE_STDOUT is used also for cli, but not set by its config.m4
-
-%{__make} sapi/cgi/php -f Makefile.cgi \
- CFLAGS_CLEAN="%{rpmcflags} -DDISCARD_PATH=1 -DENABLE_PATHINFO_CHECK=1 -DFORCE_CGI_REDIRECT=0 -DPHP_WRITE_STDOUT=1"
+# CGI
+cp -af php_config.h.cgi main/php_config.h
+%{__make} sapi/cgi/php -f Makefile.cgi
# CLI
+cp -af php_config.h.cli main/php_config.h
%{__make} sapi/cli/php -f Makefile.cli
%install
# install apache1 DSO module
%if %{with apache1}
# TODO: use libtool here
-install sapi/apache/.libs/libphp5.so $RPM_BUILD_ROOT%{_libdir}/apache1/libphp5.so
+libtool --silent --mode=install install sapi/apache/libphp5.la $RPM_BUILD_ROOT%{_libdir}/apache1/
%endif
# install apache2 DSO module
%if %{with apache2}
-# TODO: use libtool here
-install sapi/apache2handler/.libs/libphp5.so $RPM_BUILD_ROOT%{_libdir}/apache/libphp5.so
+libtool --silent --mode=install install sapi/apache2handler/libphp5.la $RPM_BUILD_ROOT%{_libdir}/apache/
%endif
libtool --silent --mode=install install libphp_common.la $RPM_BUILD_ROOT%{_libdir}
# install the apache modules' files
make install-headers install-build install-modules install-programs \
- INSTALL_ROOT=$RPM_BUILD_ROOT \
- phpbuilddir=%{_libdir}/php/build
+ INSTALL_ROOT=$RPM_BUILD_ROOT
# as of 5.0.5, phpextdist isn't installed by default
install scripts/dev/phpextdist $RPM_BUILD_ROOT%{_bindir}