]> git.pld-linux.org Git - packages/php.git/blobdiff - php.spec
rel 3
[packages/php.git] / php.spec
index e0be8405850252b03ba4689d8d2a2d3af625b1b8..0c5135cbd5f608d8b9d88f097981a04a2d38f480 100644 (file)
--- a/php.spec
+++ b/php.spec
@@ -32,6 +32,7 @@
 %bcond_with    instantclient   # build Oracle oci8 extension module against oracle-instantclient package
 %bcond_with    system_gd       # with system gd (we prefer internal since it enables few more features)
 %bcond_with    system_libzip   # with system libzip (reported broken currently)
+%bcond_without default_php     # use this PHP as default PHP in distro
 %bcond_without curl            # without CURL extension module
 %bcond_without filter          # without filter extension module
 %bcond_without enchant         # without Enchant extension module
@@ -110,14 +111,18 @@ ERROR: You need to select at least one Apache SAPI to build shared modules.
 %undefine      with_filter
 %endif
 
-%define                orgname php
-%if "%{pld_release}" == "ac_"
-%define                php_suffix 53
-%else
-%define                php_suffix %{nil}
+%if "%{pld_release}" == "ac"
+%define                _noautoreqdep libphp_common.*
+# if commandline --with was given. respect that
+%if 0%{!?_with_default_php:1}
+%undefine      with_default_php
+%endif
 %endif
 
-%define                rel     2
+%define                rel     3
+%define                orgname php
+%define                ver_suffix 53
+%define                php_suffix %{!?with_default_php:%{ver_suffix}}
 Summary:       PHP: Hypertext Preprocessor
 Summary(fr.UTF-8):     Le langage de script embarque-HTML PHP
 Summary(pl.UTF-8):     Język skryptowy PHP
@@ -125,13 +130,13 @@ Summary(pt_BR.UTF-8):     A linguagem de script PHP
 Summary(ru.UTF-8):     PHP Версии 5 - язык препроцессирования HTML-файлов, выполняемый на сервере
 Summary(uk.UTF-8):     PHP Версії 5 - мова препроцесування HTML-файлів, виконувана на сервері
 Name:          %{orgname}%{php_suffix}
-Version:       5.3.20
+Version:       5.3.27
 Release:       %{rel}%{?with_type_hints:.th}%{?with_oci8:.oci}
 Epoch:         4
 License:       PHP
 Group:         Libraries
 Source0:       http://www.php.net/distributions/%{orgname}-%{version}.tar.bz2
-# Source0-md5: 00241b9e89e93adf3baac32c56211e4e
+# Source0-md5: 25ae23a5b9615fe8d33de5b63e1bb788
 Source2:       %{orgname}-mod_%{orgname}.conf
 Source3:       %{orgname}-cgi-fcgi.ini
 Source4:       %{orgname}-apache.ini
@@ -188,6 +193,7 @@ Patch44:    %{orgname}-include_path.patch
 Patch45:       %{orgname}-imap-annotations.patch
 Patch46:       %{orgname}-imap-myrights.patch
 Patch47:       suhosin.patch
+Patch48:       php-bug-60598.patch
 Patch49:       %{orgname}-m4-divert.patch
 Patch50:       extension-shared-optional-dep.patch
 Patch51:       spl-shared.patch
@@ -202,7 +208,6 @@ Patch64:    %{orgname}-m4.patch
 Patch65:       system-libzip.patch
 Patch66:       %{orgname}-db.patch
 Patch67:       php-litespeed.patch
-Patch68:       file-magic.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}
@@ -306,6 +311,7 @@ BuildRoot:  %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %define                jsonver         1.2.1
 %define                pharver         2.0.1
 %define                sqlitever       2.0-dev
+%define                sqlite3ver      0.7-dev
 %define                zipver          1.11.0
 
 %define                zend_zts                %{!?with_zts:0}%{?with_zts:1}
@@ -430,6 +436,9 @@ Provides:   php(cgi)
 Provides:      php(fcgi)
 Provides:      webserver(php) = %{version}
 Obsoletes:     php-fcgi < 4:5.3.0
+%if "%{pld_release}" != "ac"
+Conflicts:     logrotate < 3.8.0
+%endif
 
 %description cgi
 PHP as CGI or FastCGI program.
@@ -505,7 +514,7 @@ Group:              Libraries
 Requires(post):        sed >= 4.0
 # because of dlclose() bugs in glibc <= 2.3.4 causing SEGVs on exit
 Requires:      glibc >= 6:2.3.5
-Requires:      php-dirs >= 1.3
+Requires:      php-dirs >= 1.4
 Requires:      rpm-whiteout >= 1.28
 Requires:      tzdata
 %if "%{pld_release}" == "ac"
@@ -565,7 +574,7 @@ Requires:   libtool >= 2:2.2
 %else
 Requires:      libtool
 %endif
-%{?with_embed:Requires:        %{orgname}-embedded = %{epoch}:%{version}-%{release}}
+%{?with_embed:Requires:        %{name}-embedded = %{epoch}:%{version}-%{release}}
 %{?with_pcre:Requires: pcre-devel >= 8.10}
 Requires:      shtool
 Obsoletes:     php-pear-devel
@@ -1616,7 +1625,7 @@ Summary(pl.UTF-8):        Moduł SQLite3 dla PHP
 Group:         Libraries
 URL:           http://php.net/manual/en/book.sqlite3.php
 Requires:      %{name}-common = %{epoch}:%{version}-%{release}
-Provides:      php(sqlite3)
+Provides:      php(sqlite3) = %{sqlite3ver}
 
 %description sqlite3
 SQLite is a C library that implements an embeddable SQL database
@@ -1890,8 +1899,6 @@ Moduł PHP umożliwiający używanie kompresji zlib.
 
 %prep
 %setup -q -n %{orgname}-%{version}
-# prep for suhosin patch
-%{__sed} -i -e 's,\r$,,' Zend/Zend.dsp Zend/ZendTS.dsp
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
@@ -1944,6 +1951,7 @@ cp -p php.ini-production php.ini
 %if %{with suhosin}
 %patch47 -p1
 %endif
+%patch48 -p1
 %patch49 -p1
 %patch50 -p1
 %patch51 -p1
@@ -1960,14 +1968,9 @@ cp -p php.ini-production php.ini
 %{__rm} -r sapi/litespeed
 gzip -dc %{SOURCE15} | tar xf - -C sapi/
 %patch67 -p1
-%patch68 -p1
 
 sed -i -e '/PHP_ADD_LIBRARY_WITH_PATH/s#xmlrpc,#xmlrpc-epi,#' ext/xmlrpc/config.m4
 
-# somewhy php devs have embedded magic database into php extension. yuck!
-# rebuild data file for now
-mv ext/fileinfo/data_file.c{,.php-src}
-
 # cleanup backups after patching
 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
 
@@ -2043,6 +2046,12 @@ if test "$ver" != "%{pharver}"; then
        : Update the pharver macro and rebuild.
        exit 1
 fi
+ver=$(sed -n '/#define PHP_SQLITE3_VERSION/{s/.* "//;s/".*$//;p}' ext/sqlite3/php_sqlite3.h)
+if test "$ver" != "%{sqlite3ver}"; then
+       : Error: Upstream Sqlite3 version is now ${ver}, expecting %{sqlite3ver}.
+       : Update the sqlite3ver macro and rebuild.
+       exit 1
+fi
 ver=$(sed -n '/#define PHP_ZIP_VERSION_STRING /{s/.* "//;s/".*$//;p}' ext/zip/php_zip.h)
 if test "$ver" != "%{zipver}"; then
        : Error: Upstream ZIP version is now ${ver}, expecting %{zipver}.
@@ -2404,14 +2413,21 @@ cp -pf Makefile.cli Makefile
 # make link relative
 ln -sfn phar.phar $RPM_BUILD_ROOT%{_bindir}/phar
 
+# 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/libphp5.so
 %endif
 
 # install Apache2 DSO module
 %if %{with apache2}
 libtool --mode=install install -p sapi/apache2handler/libphp5.la $RPM_BUILD_ROOT%{_libdir}/apache
+mv $RPM_BUILD_ROOT%{_libdir}/apache/libphp5{,-$v}.so
+ln -s libphp5-$v.so $RPM_BUILD_ROOT%{_libdir}/apache/libphp5.so
 %endif
 
 # install litespeed sapi
@@ -2440,6 +2456,9 @@ install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
 install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-fpm
 install -d $RPM_BUILD_ROOT/etc/logrotate.d
 cp -p %{SOURCE11} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-fpm
+%if "%{pld_release}" == "ac"
+%{__sed} -i -e '/su/d' $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-fpm
+%endif
 
 %{__sed} -i -e '
        s#/usr/lib/php#%{php_extensiondir}#
@@ -2457,10 +2476,16 @@ cp -p sapi/embed/php_embed.h $RPM_BUILD_ROOT%{_includedir}/php/sapi/embed
 %endif
 
 # install CLI
-libtool --mode=install install -p sapi/cli/php $RPM_BUILD_ROOT%{_bindir}/php.cli
-cp -p sapi/cli/php.1 $RPM_BUILD_ROOT%{_mandir}/man1/php.1
-echo ".so php.1" >$RPM_BUILD_ROOT%{_mandir}/man1/php.cli.1
-ln -sf php.cli $RPM_BUILD_ROOT%{_bindir}/php
+# versioned suffix is always installed
+libtool --mode=install install -p sapi/cli/php $RPM_BUILD_ROOT%{_bindir}/php%{ver_suffix}
+cp -p sapi/cli/php.1 $RPM_BUILD_ROOT%{_mandir}/man1/php%{ver_suffix}.1
+echo ".so php%{ver_suffix}.1" >$RPM_BUILD_ROOT%{_mandir}/man1/php.1
+ln -sf php%{ver_suffix} $RPM_BUILD_ROOT%{_bindir}/php
+
+# .cli extension is installed only if default php.spec in distro for legacy purposes
+%if "%{?php_suffix}" == "" && "%{pld_release}" != "ac"
+ln -s php%{ver_suffix} $RPM_BUILD_ROOT%{_bindir}/php.cli
+%endif
 
 cp -p php.ini $RPM_BUILD_ROOT%{_sysconfdir}/php.ini
 
@@ -2685,6 +2710,7 @@ fi
 %dir %{_sysconfdir}/apache.d
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php-apache.ini
 %attr(755,root,root) %{_libdir}/apache1/libphp5.so
+%attr(755,root,root) %{_libdir}/apache1/libphp5-*.*.so
 %endif
 
 %if %{with apache2}
@@ -2694,6 +2720,7 @@ fi
 %dir %{_sysconfdir}/apache2handler.d
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php-apache2handler.ini
 %attr(755,root,root) %{_libdir}/apache/libphp5.so
+%attr(755,root,root) %{_libdir}/apache/libphp5-*.*.so
 %endif
 
 %if %{with litespeed}
@@ -2721,8 +2748,13 @@ fi
 %defattr(644,root,root,755)
 %dir %{_sysconfdir}/cli.d
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php-cli.ini
+%attr(755,root,root) %{_bindir}/php%{ver_suffix}
+%{_mandir}/man1/php%{ver_suffix}.1*
+
+# legacy. do we really need it?
+%if "%{?php_suffix}" == "" && "%{pld_release}" != "ac"
 %attr(755,root,root) %{_bindir}/php.cli
-%{_mandir}/man1/php.cli.1*
+%endif
 
 %files program
 %defattr(644,root,root,755)
@@ -2805,6 +2837,7 @@ fi
 
 %files dba
 %defattr(644,root,root,755)
+%doc ext/dba/{CREDITS,README}
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/dba.ini
 %attr(755,root,root) %{php_extensiondir}/dba.so
 
This page took 0.049254 seconds and 4 git commands to generate.