# TODO:
# - make additional headers added by mail patch configurable
# - too many unneccessary libs:
-# - php4-common-4.4.0-14 marks heimdal-libs-0.7.1-1 (cap heimdal-libs)
-# heimdal-libs-0.7.1-1 marks openldap-libs-2.2.29-1 (cap liblber-2.2.so.7()(64bit))
-# openldap-libs-2.2.29-1 marks cyrus-sasl-2.1.21-3 (cap cyrus-sasl)
-# - php4-common-4.4.6-4 marks rpm-lib-4.4.2-43 (cap librpm-4.4.so()(64bit))
+# - libkrb5.so.3 is needed by (installed) php4-common-4.4.8-15.i686
+# - php4-common-4.4.8-15.i686 marks net-snmp-libs-5.4.1.2-1.i686 (cap libnetsnmp.so.15)
# php5-common doesn't have such deps
# - php4-cli pulls: libltdl
# - above is caused by openssl linked in statically as openssl links with kerberos
%bcond_without cpdf # without cpdf extension module
%bcond_without curl # without CURL extension module
%bcond_without domxslt # without DOM XSLT/EXSLT support in DOM XML extension module
-%bcond_without fribidi # without FriBiDi extension module
+%bcond_with fribidi # without FriBiDi extension module (use pecl-fribidi)
%bcond_without imap # without IMAP extension module
%bcond_without interbase # without InterBase extension module
%bcond_without ldap # without LDAP extension module
%bcond_without mhash # without mhash extension module
-%bcond_without ming # without ming extension module
+%bcond_with ming # with ming extension module
%bcond_without mm # without mm support for session storage
%bcond_without mnogosearch # without mnogosearch extension module
%bcond_without msession # without msession extension module
%bcond_without wddx # without WDDX extension module
%bcond_without xml # without XML and DOMXML extension modules
%bcond_without xmlrpc # without XML-RPC extension module
+%bcond_with system_xmlrpc_epi # use system xmlrpc-epi library (broken on 64bit arches, see http://bugs.php.net/41611)
%bcond_without xslt # without XSLT extension module
-%bcond_without yaz # without YAZ extension module
+%bcond_with yaz # without YAZ extension module
+%bcond_with yp
%bcond_without apache1 # disable building apache 1.3.x module
%bcond_without apache2 # disable building apache 2.x module
%bcond_without fcgi # disable building FCGI SAPI
-%bcond_without zts # disable experimental-zts
+%bcond_with zts # disable experimental-zts
%bcond_with versioning # build with experimental versioning (to load php4/php5 into same apache)
%define apxs1 /usr/sbin/apxs1
%undefine with_msession
%endif
-%define rel 5
+%define rel 51
Summary: PHP: Hypertext Preprocessor
Summary(fr.UTF-8): Le langage de script embarque-HTML PHP
Summary(pl.UTF-8): Język skryptowy PHP
Summary(ru.UTF-8): PHP Версии 4 - язык препроцессирования HTML-файлов, выполняемый на сервере
Summary(uk.UTF-8): PHP Версії 4 - мова препроцесування HTML-файлів, виконувана на сервері
Name: php4
-Version: 4.4.8
+Version: 4.4.9
Release: %{rel}%{?with_hardening:hardened}
Epoch: 3
License: PHP
Group: Libraries
Source0: http://www.php.net/distributions/php-%{version}.tar.bz2
-# Source0-md5: ed31e77414e0331e787487b53732dbca
+# Source0-md5: 2e3b2a0e27f10cb84fd00e5ecd7a1880
#Source0: http://cvs.php.net/viewvc.cgi/phpweb/distributions/php-%{version}.tar.bz2?revision=1.1
-Source2: zend.gif
Source3: %{name}-mod_php.conf
Source4: %{name}-cgi-fcgi.ini
Source5: %{name}-cgi.ini
Patch20: %{name}-libtool.patch
Patch21: %{name}-allow-db31.patch
Patch22: %{name}-threads-acfix.patch
-Patch23: %{name}-gmp.patch
+
Patch24: %{name}-qt.patch
Patch25: %{name}-no_pear_install.patch
Patch26: %{name}-zlib.patch
Patch27: %{name}-db-shared.patch
Patch28: %{name}-sybase-fix.patch
-Patch29: %{name}-lib64.patch
+Patch29: %{name}-openssl.patch
Patch30: %{name}-mnogosearch-fix.patch
Patch31: %{name}-stupidapache_version.patch
Patch33: %{name}-uint32_t.patch
Patch46: %{name}-phpinfo_no_configure.patch
Patch47: %{name}-ming.patch
Patch48: %{name}-fcgi-graceful.patch
+Patch49: %{name}-ac.patch
+Patch50: %{name}-mime_magic.patch
+Patch51: %{name}-tds.patch
+Patch52: %{name}-lib64.patch
+Patch53: %{name}-silent-session-cleanup.patch
+Patch54: %{name}-m4-divert.patch
+Patch55: %{name}-libpng.patch
+Patch56: %{name}-gmp.patch
+Patch57: %{name}-pcre.patch
+Patch58: %{name}-apache24.patch
+Patch59: php-bug-68486.patch
URL: http://www.php.net/
%{?with_interbase:%{!?with_interbase_inst:BuildRequires: Firebird-devel >= 1.0.2.908-2}}
%{?with_pspell:BuildRequires: aspell-devel >= 2:0.50.0}
%{?with_fdf:BuildRequires: fdftk-devel}
BuildRequires: flex
%if %{with mssql} || %{with sybase}
-BuildRequires: freetds-devel
+BuildRequires: freetds-devel >= 0.82
%endif
BuildRequires: freetype-devel >= 2.0
%{?with_fribidi:BuildRequires: fribidi-devel >= 0.10.4}
BuildRequires: gdbm-devel
BuildRequires: gmp-devel
-%{?with_imap:BuildRequires: krb5-devel}
+%{?with_imap:BuildRequires: heimdal-devel >= 0.7}
%{?with_imap:BuildRequires: imap-devel >= 1:2001-0.BETA.200107022325.2}
%{?with_java:BuildRequires: jdk >= 1.1}
%{?with_cpdf:BuildRequires: libcpdf-devel >= 2.02r1-2}
BuildRequires: libmcrypt-devel >= 2.4.4
BuildRequires: libpng-devel >= 1.0.8
BuildRequires: libtiff-devel
+%if "%{pld_release}" != "ac"
+BuildRequires: libtool >= 2:2.2
+%else
BuildRequires: libtool >= 1.4.3
+%endif
%{?with_xml:BuildRequires: libxml2-devel >= 2.2.7}
%{?with_domxslt:BuildRequires: libxslt-devel >= 1.0.3}
%{?with_mhash:BuildRequires: mhash-devel}
-%{?with_ming:BuildRequires: ming-devel >= 0.1.0}
+%{?with_ming:BuildRequires: ming-devel >= 0.3.0}
%{?with_mm:BuildRequires: mm-devel >= 1.3.0}
%{?with_mnogosearch:BuildRequires: mnogosearch-devel >= 3.2.29}
BuildRequires: mysql-devel >= 3.23.32
BuildRequires: pcre-devel
%{?with_pdf:BuildRequires: pdflib-devel >= 4.0.0}
%{?with_msession:BuildRequires: phoenix-devel}
+BuildRequires: pkgconfig
%{?with_pgsql:BuildRequires: postgresql-backend-devel >= 7.2}
%{?with_pgsql:BuildRequires: postgresql-devel}
%{?with_qtdom:BuildRequires: qt-devel >= 2.2.0}
BuildRequires: readline-devel
%{?with_recode:BuildRequires: recode-devel >= 3.5d-3}
+BuildRequires: rpm >= 4.4.9-56
BuildRequires: rpm-build >= 4.4.0
BuildRequires: rpmbuild(macros) >= 1.236
%{?with_xslt:BuildRequires: sablotron-devel >= 0.96}
BuildRequires: sed >= 4.0
BuildRequires: t1lib-devel
%{?with_odbc:BuildRequires: unixODBC-devel}
-%{?with_xmlrpc:BuildRequires: xmlrpc-epi-devel}
+%{?with_system_xmlrpc_epi:BuildRequires: xmlrpc-epi-devel}
%{?with_yaz:BuildRequires: yaz-devel >= 1.9}
BuildRequires: zip
BuildRequires: zlib-devel >= 1.0.9
Group: Development/Languages/PHP
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php-cgi = %{epoch}:%{version}-%{release}
+Provides: php(cgi)
%description cgi
php4 as CGI program.
Summary(pl.UTF-8): php4 jako interpreter działający z linii poleceń
Group: Development/Languages/PHP
Requires: %{name}-common = %{epoch}:%{version}-%{release}
-Provides: php-cli = %{epoch}:%{version}-%{release}
%description cli
php4 as CLI interpreter.
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: autoconf
Requires: automake
+%if "%{pld_release}" != "ac"
+Requires: libtool >= 2:2.2
+%else
+Requires: libtool
+%endif
Obsoletes: php-devel
%description devel
Summary: iconv extension module for PHP
Summary(pl.UTF-8): Moduł iconv dla PHP
Group: Libraries
+Requires: %{_libdir}/gconv
Requires: %{name}-common = %{epoch}:%{version}-%{release}
+Requires: iconv
Provides: php(iconv)
%description iconv
Summary(pl.UTF-8): Moduł mime_magic dla PHP
Group: Libraries
Requires: %{name}-common = %{epoch}:%{version}-%{release}
-Requires: /usr/share/file/magic.mime
+Requires: /usr/share/misc/magic.mime
Provides: php(mime_magic)
%description mime_magic
%patch20 -p1
%patch21 -p1
%patch22 -p1
-# %patch23 -p1
+
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
-%if "%{_lib}" == "lib64"
%patch29 -p1
-%endif
%patch30 -p1
%patch31 -p1
%patch33 -p1
%patch46 -p1
%patch47 -p1
%patch48 -p1
+%patch49 -p1
+%patch50 -p1
+%patch51 -p1
+%if "%{_lib}" == "lib64"
+%patch52 -p1
+%endif
+%patch53 -p1
+%patch54 -p1
+%patch55 -p1
+%patch56 -p1
+%patch57 -p1
+%patch58 -p1
+%patch59 -p1
%if %{with hardening}
zcat %{SOURCE8} | patch -p1
rm -f Makefile.{fcgi,cgi,cli,apxs{1,2}} # now remove Makefile copies
%{__libtoolize}
%{__aclocal}
+ cp -f /usr/share/automake/config.{sub,guess} .
./buildconf --force
touch _built-conf
fi
%{?with_wddx:--enable-wddx=shared} \
%{!?with_xml:--disable-xml}%{?with_xml:--enable-xml=shared} \
%{?with_xslt:--enable-xslt=shared} \
- --enable-yp=shared \
+ %{?with_yp:--enable-yp=shared} \
--with-bz2=shared \
%{?with_cpdf:--with-cpdflib=shared} \
--with-crack=shared \
--with-mcal=shared,/usr \
--with-mcrypt=shared \
%{?with_mhash:--with-mhash=shared} \
- --with-mime-magic=shared,/usr/share/file/magic.mime \
+ --with-mime-magic=shared,/usr/share/misc/magic.mime \
%{?with_ming:--with-ming=shared} \
%{!?with_mnogosearch:--without-mnogosearch}%{?with_mnogosearch:--with-mnogosearch=shared,/usr} \
%{?with_msession:--with-msession=shared}%{!?with_msession:--without-msession} \
--with-t1lib=shared \
--with-tiff-dir=/usr \
%{?with_xml:--with-dom=shared} \
- %{!?with_xmlrpc:--without-xmlrpc}%{?with_xmlrpc:--with-xmlrpc=shared,/usr} \
+ %{!?with_xmlrpc:--without-xmlrpc}%{?with_xmlrpc:--with-xmlrpc=shared%{?with_system_xmlrpc_epi:,/usr}} \
%{?with_xslt:--with-xslt-sablot=shared} --without-sablot-js \
%{?with_yaz:--with-yaz=shared} \
--with-zip=shared \
%{__make} libphp_common.la
%{__make} build-modules
+# version suffix
+v=$(echo %{version} | cut -d. -f1-2)
+
%if %{with apache1}
%{__make} libtool-sapi LIBTOOL_SAPI=sapi/apache/libphp4.la -f Makefile.apxs1
%endif
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_libdir}/{php,apache{,1}},%{_sysconfdir}} \
- $RPM_BUILD_ROOT/home/services/{httpd,apache}/icons \
$RPM_BUILD_ROOT{%{_sbindir},%{_bindir}} \
$RPM_BUILD_ROOT{/etc/apache/conf.d,/etc/httpd/conf.d} \
$RPM_BUILD_ROOT%{_mandir}/man1
%if %{with apache1}
libtool --silent --mode=install install sapi/apache/libphp4.la $RPM_BUILD_ROOT%{_libdir}/apache1
rm $RPM_BUILD_ROOT%{_libdir}/apache1/libphp4.la
+
+mv $RPM_BUILD_ROOT%{_libdir}/apache1/libphp4{,-$v}.so
+ln -s libphp4-$v.so $RPM_BUILD_ROOT%{_libdir}/apache1/mod_php.so
%endif
# install apache2 DSO module
%if %{with apache2}
libtool --silent --mode=install install sapi/apache2handler/libphp4.la $RPM_BUILD_ROOT%{_libdir}/apache
rm $RPM_BUILD_ROOT%{_libdir}/apache/libphp4.la
+
+mv $RPM_BUILD_ROOT%{_libdir}/apache/libphp4{,-$v}.so
+ln -s libphp4-$v.so $RPM_BUILD_ROOT%{_libdir}/apache/mod_php.so
%endif
# better solution?
install %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/php-cli.ini
%if %{with apache1}
-install %{SOURCE2} php.gif $RPM_BUILD_ROOT/home/services/apache/icons
install %{SOURCE3} $RPM_BUILD_ROOT/etc/apache/conf.d/70_mod_php4.conf
install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/php-apache.ini
%endif
%if %{with apache2}
-install %{SOURCE2} php.gif $RPM_BUILD_ROOT/home/services/httpd/icons
install %{SOURCE3} $RPM_BUILD_ROOT/etc/httpd/conf.d/70_mod_php4.conf
install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/php-apache2handler.ini
%endif
# for CLI SAPI only
mv $RPM_BUILD_ROOT%{_sysconfdir}/{conf.d/{ncurses,pcntl,readline}.ini,cli.d}
+# use system automake and {lib,sh}tool
+%if "%{pld_release}" != "ac"
+ ln -snf /usr/share/automake/config.{guess,sub} $RPM_BUILD_ROOT%{_libdir}/php/build
+ for i in libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4; do
+ ln -snf %{_aclocaldir}/${i} $RPM_BUILD_ROOT%{_libdir}/php/build
+ done
+ ln -snf %{_datadir}/libtool/config/ltmain.sh $RPM_BUILD_ROOT%{_libdir}/php/build
+%else
+ ln -snf %{_aclocaldir}/libtool.m4 $RPM_BUILD_ROOT%{_libdir}/php/build
+ ln -snf %{_datadir}/libtool/ltmain.sh $RPM_BUILD_ROOT%{_libdir}/php/build
+%endif
+ln -snf %{_bindir}/shtool $RPM_BUILD_ROOT%{_libdir}/php/build
+
# as a result of ext/pcre/pcrelib removal in %%prep, ext/pcre/php_pcre.h
# isn't installed by install-headers make target, we do it manually here.
# this header file is required by e.g. filter PECL extension
fi
%endif
+%triggerpostun -n apache1-mod_%{name} -- apache1-mod_%{name} < 3:4.4.9-51
+sed -i -e 's#modules/libphp4.so#modules/mod_php.so#g' /etc/apache/conf.d/*_mod_php4.conf
+
+%triggerpostun -n apache-mod_%{name} -- apache-mod_%{name} < 3:4.4.9-51
+sed -i -e 's#modules/libphp4.so#modules/mod_php.so#g' /etc/httpd/conf.d/*_mod_php4.conf
+
%post bcmath
%extension_post
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/apache/conf.d/*_mod_php4.conf
%dir %{_sysconfdir}/apache.d
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php-apache.ini
-%attr(755,root,root) %{_libdir}/apache1/libphp4.so
-/home/services/apache/icons/*
+%attr(755,root,root) %{_libdir}/apache1/mod_php.so
+%attr(755,root,root) %{_libdir}/apache1/libphp4-*.so
%endif
%if %{with apache2}
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/httpd/conf.d/*_mod_php4.conf
%dir %{_sysconfdir}/apache2handler.d
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php-apache2handler.ini
-%attr(755,root,root) %{_libdir}/apache/libphp4.so
-/home/services/httpd/icons/*
+%attr(755,root,root) %{_libdir}/apache/mod_php.so
+%attr(755,root,root) %{_libdir}/apache/libphp4-*.so
%endif
%if %{with fcgi}
# FIXME: how exactly this is needed? as it contains libdir for apache1 or apache2
%{_libdir}/libphp_common.la
%{_includedir}/php
+%dir %{_libdir}/php
%{_libdir}/php/build
%{_mandir}/man1/php-config.1*
%{_mandir}/man1/phpize.1*
%attr(755,root,root) %{extensionsdir}/yaz.so
%endif
+%if %{with yp}
%files yp
%defattr(644,root,root,755)
%doc ext/yp/CREDITS
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/yp.ini
%attr(755,root,root) %{extensionsdir}/yp.so
+%endif
%files zip
%defattr(644,root,root,755)