]> TLD Linux GIT Repositories - packages/php.git/blobdiff - php.spec
- release 2
[packages/php.git] / php.spec
index fe72ba4e220a30a56a553507057b30d1c9165068..477c246df713b2a162c7ddca5840f0cc281a44b2 100644 (file)
--- a/php.spec
+++ b/php.spec
@@ -1,11 +1,13 @@
+# NOTES 
+# - mysqlnd driver doesn't support reconnect: https://bugs.php.net/bug.php?id=52561
+# TODO 7.2:
+# - https://github.com/php/php-src/blob/php-7.2.0/UPGRADING
 # TODO 5.6:
 # - enable --with-fpm-systemd, but ensure it checks for sd_booted()
-# - build with system libgd 2.1, see 73c5128
 # TODO 5.4:
 # - update imap annotations patch (needs api porting)
 # - update imap myrights patch (needs api porting)
 # --with-libmbfl=DIR      MBSTRING: Use external libmbfl.  DIR is the libmbfl base install directory BUNDLED
-# --with-onig=DIR         MBSTRING: Use external oniguruma. DIR is the oniguruma install prefix.
 # TODO:
 # - fileinfo extension bundles magic db in library: data_file.c (dump of magic.mgc) is 14M
 #   - 2.3M fileinfo.so php54-fileinfo-5.4.6-0.15.x86_64
@@ -63,7 +65,6 @@
 %bcond_without json            # without json extension module
 %bcond_without ldap            # without LDAP extension module
 %bcond_without mbstring        # without mbstring extension module
-%bcond_without mcrypt          # without mbcrypt extension module
 %bcond_without mhash           # without mhash extension (supported by hash extension)
 %bcond_without mysqli          # without mysqli support (Requires mysql >= 4.1)
 %bcond_without mysqlnd         # without mysqlnd support in mysql related extensions
 %bcond_without recode          # without recode extension module
 %bcond_without session         # without session extension module
 %bcond_without snmp            # without SNMP extension module
+%bcond_without sodium          # without sodium extension module
 %bcond_without sqlite2         # without SQLite extension module
 %bcond_without sqlite3         # without SQLite3 extension module
 %bcond_without tidy            # without Tidy extension module
 %bcond_without wddx            # without WDDX extension module
 %bcond_without xmlrpc          # without XML-RPC extension module
+%bcond_without xsl             # without xsl extension module
 # extensions options
+%bcond_without argon2          # argon2 password hashing
 %bcond_without instantclient   # build Oracle oci8 extension module against oracle-instantclient package
 %bcond_with    interbase_inst  # use InterBase install., not Firebird  (BR: proprietary libs)
 %bcond_with    mm              # without mm support for session storage
-%bcond_with    system_gd       # with system gd (imageantialias function is missing then)
-%bcond_with    system_libzip   # with system libzip (reported broken currently)
+%bcond_without system_gd       # system gd
+%bcond_without system_libzip   # system libzip
 %bcond_without webp            # Without WebP support in GD extension (imagecreatefromwebp)
 
 %define apxs1          /usr/sbin/apxs1
 %endif
 
 %define                orgname php
-%define                php_suffix 71
+%define                php_suffix 73
 Summary:       PHP: Hypertext Preprocessor
 Summary(fr.UTF-8):     Le langage de script embarque-HTML PHP
 Summary(pl.UTF-8):     Język skryptowy PHP
@@ -142,8 +146,8 @@ Summary(pt_BR.UTF-8):       A linguagem de script PHP
 Summary(ru.UTF-8):     PHP Версии 7 - язык препроцессирования HTML-файлов, выполняемый на сервере
 Summary(uk.UTF-8):     PHP Версії 7 - мова препроцесування HTML-файлів, виконувана на сервері
 Name:          %{orgname}%{php_suffix}
-Version:       7.1.11
-Release:       1
+Version:       7.3.10
+Release:       2
 Epoch:         4
 # All files licensed under PHP version 3.01, except
 # Zend is licensed under Zend
@@ -151,7 +155,8 @@ Epoch:              4
 License:       PHP 3.01 and Zend and BSD
 Group:         Libraries
 Source0:       http://php.net/distributions/%{orgname}-%{version}.tar.xz
-# Source0-md5: bbf4dfe4f501143a1763eb86b6a0a454
+# Source0-md5: cce77c52ba74507807cf9d66be9ee7cd
+Source1:       opcache.ini
 Source2:       %{orgname}-mod_php.conf
 Source3:       %{orgname}-cgi-fcgi.ini
 Source4:       %{orgname}-apache.ini
@@ -166,7 +171,6 @@ Patch1:             %{orgname}-tld.patch
 Patch3:                %{orgname}-link-libs.patch
 Patch4:                intl-stdc++.patch
 Patch5:                %{orgname}-filter-shared.patch
-Patch6:                %{orgname}-build_modules.patch
 Patch7:                %{orgname}-sapi-ini-file.patch
 Patch8:                milter.patch
 Patch9:                libtool-tag.patch
@@ -199,8 +203,6 @@ Patch52:    pcre-shared.patch
 Patch53:       fix-test-run.patch
 Patch55:       bug-52078-fileinode.patch
 Patch59:       %{orgname}-systzdata.patch
-Patch62:       mcrypt-libs.patch
-Patch65:       system-libzip.patch
 Patch66:       php-db.patch
 Patch67:       mysql-lib-ver-mismatch.patch
 Patch69:       fpm-conf-split.patch
@@ -220,6 +222,8 @@ BuildRequires:      db-devel >= 4.0
 BuildRequires: elfutils-devel
 %{?with_enchant:BuildRequires: enchant-devel >= 1.1.3}
 %{?with_kerberos5:BuildRequires:       heimdal-devel}
+%{?with_argon2:BuildRequires:  libargon2-devel >= 20161029}
+%{?with_sodium:BuildRequires:  libsodium-devel >= 1.0.8}
 %if %{with pdo_dblib}
 BuildRequires: freetds-devel >= 0.82
 %endif
@@ -235,19 +239,19 @@ BuildRequires:    gmp-devel >= 4.2
 %{?with_intl:BuildRequires:    libicu-devel >= 4.4}
 BuildRequires: libjpeg-devel
 BuildRequires: libltdl-devel >= 1.4
-BuildRequires: libmcrypt-devel >= 2.5.6
 BuildRequires: libpng-devel >= 1.0.8
 %{?with_intl:BuildRequires:    libstdc++-devel}
 %{?with_webp:BuildRequires:    libwebp-devel}
 BuildRequires: libtool >= 2:2.4.6
 BuildRequires: libxml2-devel >= 1:2.7.6-4
-BuildRequires: libxslt-devel >= 1.1.0
-%{?with_system_libzip:BuildRequires:   libzip-devel >= 0.10.1-2}
+%{?with_xsl:BuildRequires:     libxslt-devel >= 1.1.0}
+%{?with_system_libzip:BuildRequires:   libzip-devel >= 1.2.0}
 %{?with_snmp:%{?with_tests:BuildRequires:      mibs-net-snmp}}
 %{?with_mm:BuildRequires:      mm-devel >= 1.3.0}
 %{!?with_pdo_mysql:BuildRequires:      mysql-devel}
 %{!?with_mysqli:BuildRequires: mysql-devel >= 4.1.13}
 %{?with_snmp:BuildRequires:    net-snmp-devel >= 5.3}
+BuildRequires: oniguruma-devel
 %{?with_ldap:BuildRequires:    openldap-devel >= 2.3.0}
 %if %{with openssl} || %{with ldap}
 BuildRequires: openssl-devel >= 1.0.1
@@ -287,22 +291,23 @@ BuildRoot:        %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %define                _sysconfdir             %{php_sysconfdir}
 
 # must be in sync with source. extra check ensuring that it is so is done in %%build
-%define                php_api_version         20160303
-%define                zend_module_api         20160303
-%define                zend_extension_api      320160303
-%define                php_pdo_api_version     20150127
+%define                php_api_version         20180731
+%define                zend_module_api         20180731
+%define                zend_extension_api      320180731
+%define                php_pdo_api_version     20170320
 
 # Extension versions
-%define                bz2ver          1.0
-%define                enchantver      1.1.0
-%define                fileinfover     1.0.5
-%define                hashver         1.0
-%define                intlver         1.1.0
-%define                jsonver         1.5.0
-%define                pharver         2.0.2
-%define                sqlite3ver      0.7-dev
-%define                zipver          1.13.5
+%define                bz2ver          %{version}
+%define                enchantver      %{version}
+%define                fileinfover     %{version}
+%define                hashver         %{version}
+%define                intlver         %{version}
+%define                jsonver         1.7.0
+%define                pharver         %{version}
+%define                sqlite3ver      %{version}
+%define                zipver          1.15.4
 %define                phpdbgver       0.5.0
+%define                sodiumver       %{version}
 
 %define                _zend_zts               %{!?with_zts:0}%{?with_zts:1}
 %define                php_debug               %{!?debug:0}%{?debug:1}
@@ -1065,23 +1070,6 @@ string support.
 %description mbstring -l pl.UTF-8
 Moduł PHP dodający obsługę ciągów znaków wielobajtowych.
 
-%package mcrypt
-Summary:       mcrypt extension module for PHP
-Summary(pl.UTF-8):     Moduł mcrypt dla PHP
-Group:         Libraries
-URL:           http://php.net/manual/en/book.mcrypt.php
-Requires:      %{name}-common = %{epoch}:%{version}-%{release}
-Requires:      libmcrypt >= 2.5.6
-Provides:      php(mcrypt)
-Obsoletes:     php-mcrypt < 4:5.3.28-7
-
-%description mcrypt
-This is a dynamic shared object (DSO) for PHP that will add mcrypt
-support.
-
-%description mcrypt -l pl.UTF-8
-Moduł PHP dodający możliwość szyfrowania poprzez bibliotekę mcrypt.
-
 %package mysqli
 Summary:       MySQLi module for PHP
 Summary(pl.UTF-8):     Moduł MySQLi dla PHP
@@ -1627,6 +1615,16 @@ support.
 %description sockets -l pl.UTF-8
 Moduł PHP dodający obsługę gniazdek.
 
+%package sodium
+Summary:       Wrapper for the Sodium cryptographic library
+Group:         Libraries
+URL:           https://paragonie.com/book/pecl-libsodium
+Requires:      %{name}-common = %{epoch}:%{version}-%{release}
+Provides:      php(sodium) = %{sodiumver}
+
+%description sodium
+A simple, low-level PHP extension for libsodium.
+
 %package spl
 Summary:       Standard PHP Library module for PHP
 Summary(pl.UTF-8):     Moduł biblioteki standardowej (Standard PHP Library) dla PHP
@@ -1892,7 +1890,7 @@ Summary(pl.UTF-8):        Zarządzanie archiwami zip
 Group:         Libraries
 URL:           http://php.net/manual/en/book.zip.php
 Requires:      %{name}-common = %{epoch}:%{version}-%{release}
-%{?with_system_libzip:Requires:        libzip >= 0.10.1-2}
+%{?with_system_libzip:Requires:        libzip >= 1.2.0}
 Provides:      php(zip) = %{zipver}
 Obsoletes:     php-pecl-zip < %{zipver}
 Obsoletes:     php-zip < 4:5.3.28-7
@@ -1927,7 +1925,6 @@ cp -p php.ini-production php.ini
 %patch1 -p1
 %patch3 -p1
 %patch5 -p1
-%patch6 -p1
 %patch7 -p1
 %{?with_milter:%patch8 -p1}
 %patch9 -p1
@@ -1958,19 +1955,17 @@ cp -p php.ini-production php.ini
 %patch47 -p1
 %endif
 %patch50 -p1
-%patch51 -p1
-%patch52 -p1
+%patch51 -p1 -b .spl-shared
+%patch52 -p1 -b .pcre-shared
 %patch53 -p1
 %undos ext/spl/tests/SplFileInfo_getInode_basic.phpt
 %patch55 -p1
-%patch59 -p1
-%patch62 -p1
-%{?with_system_libzip:%patch65 -p1}
+%patch59 -p1 -b .systzdata
 %patch66 -p1
 %patch67 -p1
 %patch70 -p1
 %patch71 -p1
-%patch72 -p1
+%patch72 -p1 -b .phar-shared
 
 %{__sed} -i -e '/PHP_ADD_LIBRARY_WITH_PATH/s#xmlrpc,#xmlrpc-epi,#' ext/xmlrpc/config.m4
 
@@ -1993,8 +1988,8 @@ find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
 #%{__rm} -r ext/dba/libinifile
 #%{__rm} -r ext/gd/libgd
 #%{__rm} -r ext/mbstring/libmbfl
-#%{__rm} -r ext/mbstring/oniguruma
-%{__rm} -r ext/pcre/pcrelib
+%{__rm} -r ext/mbstring/oniguruma
+%{__rm} -r ext/pcre/pcre2lib
 #%{__rm} -r ext/soap/interop
 %{__rm} -r ext/xmlrpc/libxmlrpc
 #%{__rm} -r ext/zip/lib
@@ -2099,14 +2094,14 @@ if [ $API != %{php_pdo_api_version} ]; then
 fi
 
 # Check for some extension version
-ver=$(sed -n '/#define PHP_FILEINFO_VERSION /{s/.* "//;s/".*$//;p}' ext/fileinfo/php_fileinfo.h)
-if test "$ver" != "%{fileinfover}"; then
+ver=$(awk '/#define PHP_FILEINFO_VERSION/ {print $3}' ext/fileinfo/php_fileinfo.h | xargs)
+if test "$ver" != "PHP_VERSION"; then
        : Error: Upstream FILEINFO version is now ${ver}, expecting %{fileinfover}.
        : Update the fileinfover macro and rebuild.
        exit 1
 fi
-ver=$(sed -n '/#define PHP_PHAR_VERSION /{s/.* "//;s/".*$//;p}' ext/phar/php_phar.h)
-if test "$ver" != "%{pharver}"; then
+ver=$(awk '/#define PHP_PHAR_VERSION/ {print $3}' ext/phar/php_phar.h | xargs)
+if test "$ver" != "PHP_VERSION"; then
        : Error: Upstream PHAR version is now ${ver}, expecting %{pharver}.
        : Update the pharver macro and rebuild.
        exit 1
@@ -2117,6 +2112,10 @@ if test "$ver" != "PHP_VERSION"; then
        : Update the sqlite3ver macro and rebuild.
        exit 1
 fi
+ver=$(awk '/#define PHP_SODIUM_VERSION/ {print $3}' ext/sodium/php_libsodium.h | xargs)
+if test "$ver" != "PHP_VERSION"; then
+       exit 1
+fi
 ver=$(sed -n '/#define PHP_ZIP_VERSION /{s/.* "//;s/".*$//;p}' ext/zip/php_zip.h)
 if test "$ver" != "%{zipver}"; then
        : Error: Upstream ZIP version is now ${ver}, expecting %{zipver}.
@@ -2135,26 +2134,24 @@ if test "$ver" != "%{phpdbgver}"; then
        : Update the phpdbgver macro and rebuild.
        exit 1
 fi
-ver=$(sed -rne 's,.*<version>(.+)</version>,\1,p' ext/bz2/package.xml)
-if test "$ver" != "%{bz2ver}"; then
+ver=$(awk '/#define PHP_BZ2_VERSION/ {print $3}' ext/bz2/php_bz2.h | xargs)
+if test "$ver" != "PHP_VERSION"; then
        : Error: Upstream BZIP2 version is now ${ver}, expecting %{bz2ver}.
        : Update the bz2ver macro and rebuild.
        exit 1
 fi
-ver=$(sed -n '/#define PHP_ENCHANT_VERSION /{s/.* "//;s/".*$//;p}' ext/enchant/php_enchant.h)
-if test "$ver" != "%{enchantver}"; then
-       : Error: Upstream Enchant version is now ${ver}, expecting %{enchantver}.
-       : Update the enchantver macro and rebuild.
+ver=$(awk '/#define PHP_ENCHANT_VERSION/ {print $3}' ext/enchant/php_enchant.h | xargs)
+if test "$ver" != "PHP_VERSION"; then
        exit 1
 fi
 ver=$(awk '/#define PHP_HASH_VERSION/ {print $3}' ext/hash/php_hash.h | xargs)
-if test "$ver" != "%{hashver}"; then
+if test "$ver" != "PHP_VERSION"; then
        : Error: Upstream HASH version is now ${ver}, expecting %{hashver}.
        : Update the hashver macro and rebuild.
        exit 1
 fi
-ver=$(sed -n '/#define PHP_INTL_VERSION /{s/.* "//;s/".*$//;p}' ext/intl/php_intl.h)
-if test "$ver" != "%{intlver}"; then
+ver=$(awk '/#define PHP_INTL_VERSION/ {print $3}' ext/intl/php_intl.h | xargs)
+if test "$ver" != "PHP_VERSION"; then
        : Error: Upstream Intl version is now ${ver}, expecting %{intlver}.
        : Update the intlver macro and rebuild.
        exit 1
@@ -2175,6 +2172,11 @@ export PROG_SENDMAIL="/usr/lib/sendmail"
 export CPPFLAGS="-DDEBUG_FASTCGI -DHAVE_STRNDUP %{rpmcppflags} \
        -I%{_includedir}/xmlrpc-epi"
 
+# This should be detected by configure and set there,
+# but looks like the build system is hosed on 7.3
+export CXXFLAGS="%{rpmcxxflags} -fPIC -DPIC"
+export CFLAGS="%{rpmcflags} -fPIC -DPIC"
+
 sapis="
 cli
 %if %{with cgi}
@@ -2245,6 +2247,7 @@ for sapi in $sapis; do
        --with-config-file-path=%{_sysconfdir} \
        --with-config-file-scan-dir=%{_sysconfdir}/conf.d \
        --with-system-tzdata \
+       %{?with_argon2:--with-password-argon2} \
        --%{!?debug:dis}%{?debug:en}able-debug \
        %{?with_zts:--enable-maintainer-zts} \
        --enable-inline-optimization \
@@ -2257,10 +2260,10 @@ for sapi in $sapis; do
        %{__enable_disable exif exif shared} \
        %{__enable_disable fileinfo fileinfo shared} \
        %{__enable_disable ftp ftp shared} \
-       --enable-gd-native-ttf \
        %{?with_intl:--enable-intl=shared} \
        --enable-libxml \
        %{__enable_disable mbstring mbstring shared,all} \
+       --with-onig=/usr \
        --enable-mbregex \
        %{__enable_disable pcntl pcntl shared} \
        %{__enable_disable pdo pdo shared} \
@@ -2296,6 +2299,7 @@ for sapi in $sapis; do
        --enable-sysvshm=shared \
        --enable-soap=shared \
        --enable-sockets=shared \
+       %{__with_without sodium sodium shared} \
        --enable-tokenizer=shared \
        %{?with_wddx:--enable-wddx=shared} \
        --enable-xml=shared \
@@ -2314,7 +2318,6 @@ for sapi in $sapis; do
        %{?with_interbase:--with-interbase=shared%{!?with_interbase_inst:,/usr}} \
        --with-jpeg-dir=/usr \
        %{?with_ldap:--with-ldap=shared --with-ldap-sasl} \
-       %{__with_without mcrypt mcrypt shared} \
        %{?with_mm:--with-mm} \
        %{?with_mysqlnd:--enable-mysqlnd=shared} \
        %{?with_mysqli:--with-mysqli=shared,%{!?with_mysqlnd:/usr/bin/mysql_config}%{?with_mysqlnd:mysqlnd}} \
@@ -2338,7 +2341,7 @@ for sapi in $sapis; do
        %{?with_tidy:--with-tidy=shared} \
        %{?with_odbc:--with-unixODBC=shared,/usr} \
        %{__with_without xmlrpc xmlrpc shared,/usr} \
-       --with-xsl=shared \
+       %{?with_xsl:--with-xsl=shared} \
        --with-zlib=shared \
        --with-zlib-dir=shared,/usr \
        %{?with_system_libzip:--with-libzip} \
@@ -2434,6 +2437,7 @@ generate_inifiles() {
        done
 }
 generate_inifiles
+cp -p %{_sourcedir}/opcache.ini conf.d
 
 # Check that the module inner-dependencies are intact
 PHP=./sapi/cli/php EXTENSION_DIR=modules CONFIG_DIR=conf.d ./dep-tests.sh > dep-tests.log
@@ -2510,9 +2514,12 @@ v=$(echo %{version} | cut -d. -f1-2)
 
 # install Apache2 DSO module
 %if %{with apache2}
+# versioned libphp
 libtool --mode=install install -p sapi/apache2handler/libphp7.la $RPM_BUILD_ROOT%{_libdir}/apache
-%{__mv} $RPM_BUILD_ROOT%{_libdir}/apache/libphp7{,-$v}.so
-ln -s libphp7-$v.so $RPM_BUILD_ROOT%{_libdir}/apache/mod_php.so
+%{__mv} $RPM_BUILD_ROOT%{_libdir}/apache/libphp7.la $RPM_BUILD_ROOT%{_libdir}/apache/libphp%{php_suffix}.la
+%{__mv} $RPM_BUILD_ROOT%{_libdir}/apache/libphp7.so $RPM_BUILD_ROOT%{_libdir}/apache/libphp%{php_suffix}.so
+sed -i -e "s|libphp7|libphp%{php_suffix}|g" $RPM_BUILD_ROOT%{_libdir}/apache/libphp%{php_suffix}.la
+ln -s libphp%{php_suffix}.so $RPM_BUILD_ROOT%{_libdir}/apache/mod_php.so
 %endif
 
 # install litespeed sapi
@@ -2537,7 +2544,13 @@ touch $RPM_BUILD_ROOT%{_mandir}/man1/php-config.1
        INSTALL_ROOT=$RPM_BUILD_ROOT
 %endif
 
+# versioned libphp_common
 libtool --mode=install install -p libphp_common.la $RPM_BUILD_ROOT%{_libdir}
+%{__mv} $RPM_BUILD_ROOT%{_libdir}/libphp_common.la $RPM_BUILD_ROOT%{_libdir}/libphp_common%{php_suffix}.la
+%{__mv} $RPM_BUILD_ROOT%{_libdir}/libphp_common-%{version}.so $RPM_BUILD_ROOT%{_libdir}/libphp_common%{php_suffix}-%{version}.so
+%{__rm} -f $RPM_BUILD_ROOT%{_libdir}/libphp_common.so
+ln -s libphp_common%{php_suffix}-%{version}.so $RPM_BUILD_ROOT%{_libdir}/libphp_common%{php_suffix}.so
+sed -i -e "s|libphp_common|libphp_common%{php_suffix}|g" $RPM_BUILD_ROOT%{_libdir}/libphp_common%{php_suffix}.la
 
 # install CGI/FCGI
 %if %{with cgi}
@@ -2574,11 +2587,12 @@ touch $RPM_BUILD_ROOT%{_sbindir}/php-fpm
 # we could use install-headers from Makefile.embed, but that would reinstall all headers
 # install-sapi installs to wrong dir, so just do it all manually
 install -d $RPM_BUILD_ROOT%{_includedir}/php/php%{php_suffix}/sapi/embed
-install -p libs/libphp7.so $RPM_BUILD_ROOT%{_libdir}
+install -p libs/libphp7.so $RPM_BUILD_ROOT%{_libdir}/libphp%{php_suffix}.so
 cp -p sapi/embed/php_embed.h $RPM_BUILD_ROOT%{_includedir}/php/php%{php_suffix}/sapi/embed
 %endif
 
 # CLI
+libtool --mode=install install -p sapi/cli/php $RPM_BUILD_ROOT%{_bindir}/php%{php_suffix}
 # touch for ghost
 touch $RPM_BUILD_ROOT%{_bindir}/php
 touch $RPM_BUILD_ROOT%{_mandir}/man1/php.1
@@ -2589,7 +2603,7 @@ cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/php-cli.ini
 %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
-%{__rm} -f $RPM_BUILD_ROOT%{_libdir}/apache/libphp7.la
+%{__rm} -f $RPM_BUILD_ROOT%{_libdir}/apache/libphp%{php_suffix}.la
 %endif
 
 # ensure that paths are correct for current php version and arch
@@ -2634,9 +2648,9 @@ install -p run-tests.php $RPM_BUILD_ROOT%{php_datadir}/tests/php/run-tests.php
 cp -a tests/* $RPM_BUILD_ROOT%{php_datadir}/tests/php
 
 # fix install paths, avoid evil rpaths
-sed -i -e "s|^libdir=.*|libdir='%{_libdir}'|" $RPM_BUILD_ROOT%{_libdir}/libphp_common.la
+sed -i -e "s|^libdir=.*|libdir='%{_libdir}'|" $RPM_BUILD_ROOT%{_libdir}/libphp_common%{php_suffix}.la
 # better solution?
-sed -i -e 's|libphp_common.la|$(libdir)/libphp_common.la|' $RPM_BUILD_ROOT%{_libdir}/%{name}/build/acinclude.m4
+sed -i -e 's|libphp_common.la|$(libdir)/libphp_common%{php_suffix}.la|' $RPM_BUILD_ROOT%{_libdir}/%{name}/build/acinclude.m4
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -2658,9 +2672,12 @@ update-alternatives \
 
 %postun cli
 if [ $1 -eq 0 ]; then
-       update-alternatives --remove php %{_bindir}/php || :
+       update-alternatives --remove php %{_bindir}/php%{php_suffix} || :
 fi
 
+%post  common -p /sbin/ldconfig
+%postun        common -p /sbin/ldconfig
+
 %post devel
 update-alternatives \
        --install %{_bindir}/phpize phpize %{_bindir}/phpize%{php_suffix} %{php_suffix} \
@@ -2671,8 +2688,8 @@ update-alternatives \
 
 %postun devel
 if [ $1 -eq 0 ]; then
-       update-alternatives --remove phpize %{_bindir}/phpize || :
-       update-alternatives --remove php-config %{_bindir}/php-config || :
+       update-alternatives --remove phpize %{_bindir}/phpize%{php_suffix} || :
+       update-alternatives --remove php-config %{_bindir}/php-config%{php_suffix} || :
 fi
 
 %pre fpm
@@ -2687,7 +2704,7 @@ update-alternatives --install %{_sbindir}/php-fpm php-fpm %{_sbindir}/php%{php_s
 if [ "$1" = "0" ]; then
        %service %{name}-fpm stop
        /sbin/chkconfig --del %{name}-fpm
-       update-alternatives --remove php-fpm %{_sbindir}/php-fpm || :
+       update-alternatives --remove php-fpm %{_sbindir}/php%{php_suffix}-fpm || :
 fi
 
 %postun fpm
@@ -2798,7 +2815,6 @@ fi \
 %extension_scripts json
 %extension_scripts ldap
 %extension_scripts mbstring
-%extension_scripts mcrypt
 %extension_scripts mysqli
 %extension_scripts mysqlnd
 %extension_scripts oci8
@@ -2825,6 +2841,7 @@ fi \
 %extension_scripts snmp
 %extension_scripts soap
 %extension_scripts sockets
+%extension_scripts sodium
 %extension_scripts spl
 %extension_scripts sqlite3
 %extension_scripts sysvmsg
@@ -2850,7 +2867,7 @@ update-alternatives \
 %postun phar
 %ext_postun
 if [ $1 -eq 0 ]; then
-       update-alternatives --remove phar %{_bindir}/phar || :
+       update-alternatives --remove phar %{_bindir}/phar%{php_suffix}.phar || :
 fi
 
 %if %{with apache2}
@@ -2860,7 +2877,7 @@ fi
 %dir %{_sysconfdir}/apache2handler.d
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php-apache2handler.ini
 %attr(755,root,root) %{_libdir}/apache/mod_php.so
-%attr(755,root,root) %{_libdir}/apache/libphp7-*.*.so
+%attr(755,root,root) %{_libdir}/apache/libphp%{php_suffix}.so
 %endif
 
 %if %{with litespeed}
@@ -2881,7 +2898,7 @@ fi
 %if %{with embed}
 %files embedded
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/libphp7.so
+%attr(755,root,root) %{_libdir}/libphp%{php_suffix}.so
 %endif
 
 %files cli
@@ -2922,11 +2939,11 @@ fi
 
 %files common
 %defattr(644,root,root,755)
-%doc CREDITS EXTENSIONS LICENSE NEWS README.namespaces UPGRADING* Zend/{LICENSE.Zend,ZEND_CHANGES} php.ini-*
+%doc CREDITS EXTENSIONS LICENSE NEWS UPGRADING* Zend/{LICENSE.Zend,README*} php.ini-*
 %dir %{_sysconfdir}
 %dir %{_sysconfdir}/conf.d
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php.ini
-%attr(755,root,root) %{_libdir}/libphp_common-*.so
+%attr(755,root,root) %{_libdir}/libphp_common%{php_suffix}-*.so
 %dir %{php_datadir}
 %dir %{php_extensiondir}
 
@@ -2934,13 +2951,13 @@ fi
 
 %files devel
 %defattr(644,root,root,755)
-%doc CODING_STANDARDS README.{EXT_SKEL,PARAMETER_PARSING_API,SELF-CONTAINED-EXTENSIONS,STREAMS,SUBMITTING_PATCH,TESTING,TESTING2,UNIX-BUILD-SYSTEM,input_filter}
+%doc CODING_STANDARDS README.{EXT_SKEL,PARAMETER_PARSING_API,SELF-CONTAINED-EXTENSIONS,STREAMS,SUBMITTING_PATCH,TESTING,UNIX-BUILD-SYSTEM,input_filter}
 %attr(755,root,root) %{_bindir}/phpize%{php_suffix}
 %attr(755,root,root) %{_bindir}/php-config%{php_suffix}
 %ghost %{_bindir}/phpize
 %ghost %{_bindir}/php-config
-%attr(755,root,root) %{_libdir}/libphp_common.so
-%{_libdir}/libphp_common.la
+%attr(755,root,root) %{_libdir}/libphp_common%{php_suffix}.so
+%{_libdir}/libphp_common%{php_suffix}.la
 %{_includedir}/php/php%{php_suffix}
 %{_libdir}/%{name}/build
 %{_mandir}/man1/php-config%{php_suffix}.1*
@@ -2998,8 +3015,7 @@ fi
 %if %{with dom}
 %files dom
 %defattr(644,root,root,755)
-%doc ext/dom/{CREDITS,TODO}
-%doc ext/dom/examples
+%doc ext/dom/CREDITS
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/dom.ini
 %attr(755,root,root) %{php_extensiondir}/dom.so
 %endif
@@ -3007,7 +3023,7 @@ fi
 %if %{with enchant}
 %files enchant
 %defattr(644,root,root,755)
-%doc ext/enchant/{CREDITS,docs/examples}
+%doc ext/enchant/CREDITS
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/enchant.ini
 %attr(755,root,root) %{php_extensiondir}/enchant.so
 %endif
@@ -3031,7 +3047,7 @@ fi
 %if %{with filter}
 %files filter
 %defattr(644,root,root,755)
-%doc ext/filter/{CREDITS,docs/*}
+%doc ext/filter/CREDITS
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/filter.ini
 %attr(755,root,root) %{php_extensiondir}/filter.so
 %endif
@@ -3063,7 +3079,7 @@ fi
 %if %{with gmp}
 %files gmp
 %defattr(644,root,root,755)
-%doc ext/gmp/{CREDITS,README,TODO}
+%doc ext/gmp/CREDITS
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/gmp.ini
 %attr(755,root,root) %{php_extensiondir}/gmp.so
 %endif
@@ -3103,7 +3119,7 @@ fi
 %if %{with intl}
 %files intl
 %defattr(644,root,root,755)
-%doc ext/intl/{CREDITS,TODO}
+%doc ext/intl/CREDITS
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/intl.ini
 %attr(755,root,root) %{php_extensiondir}/intl.so
 %endif
@@ -3127,23 +3143,15 @@ fi
 %if %{with mbstring}
 %files mbstring
 %defattr(644,root,root,755)
-%doc ext/mbstring/{CREDITS,README*}
+%doc ext/mbstring/CREDITS
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/mbstring.ini
 %attr(755,root,root) %{php_extensiondir}/mbstring.so
 %endif
 
-%if %{with mcrypt}
-%files mcrypt
-%defattr(644,root,root,755)
-%doc ext/mcrypt/{CREDITS,TODO}
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/mcrypt.ini
-%attr(755,root,root) %{php_extensiondir}/mcrypt.so
-%endif
-
 %if %{with mysqli}
 %files mysqli
 %defattr(644,root,root,755)
-%doc ext/mysqli/{CREDITS,TODO}
+%doc ext/mysqli/CREDITS
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/mysqli.ini
 %attr(755,root,root) %{php_extensiondir}/mysqli.so
 %endif
@@ -3207,7 +3215,7 @@ fi
 %if %{with pdo}
 %files pdo
 %defattr(644,root,root,755)
-%doc ext/pdo/{CREDITS,README,TODO}
+%doc ext/pdo/{CREDITS,README}
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/pdo.ini
 %attr(755,root,root) %{php_extensiondir}/pdo.so
 %endif
@@ -3279,7 +3287,7 @@ fi
 %if %{with phar}
 %files phar
 %defattr(644,root,root,755)
-%doc ext/phar/{CREDITS,TODO}
+%doc ext/phar/CREDITS
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/phar.ini
 %attr(755,root,root) %{php_extensiondir}/phar.so
 %attr(755,root,root) %{_bindir}/phar%{php_suffix}.phar
@@ -3339,7 +3347,6 @@ fi
 %files simplexml
 %defattr(644,root,root,755)
 %doc ext/simplexml/{CREDITS,README}
-%doc ext/simplexml/examples
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/simplexml.ini
 %attr(755,root,root) %{php_extensiondir}/simplexml.so
 
@@ -3353,7 +3360,7 @@ fi
 
 %files soap
 %defattr(644,root,root,755)
-%doc ext/soap/{CREDITS,TODO*}
+%doc ext/soap/CREDITS
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/soap.ini
 %attr(755,root,root) %{php_extensiondir}/soap.so
 
@@ -3363,10 +3370,17 @@ fi
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/sockets.ini
 %attr(755,root,root) %{php_extensiondir}/sockets.so
 
+%if %{with sodium}
+%files sodium
+%defattr(644,root,root,755)
+%doc ext/sodium/{README.md,CREDITS}
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/sodium.ini
+%attr(755,root,root) %{php_extensiondir}/sodium.so
+%endif
+
 %files spl
 %defattr(644,root,root,755)
-%doc ext/spl/{CREDITS,README,TODO}
-%doc ext/spl/examples
+%doc ext/spl/{CREDITS,README,examples}
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/SPL.ini
 %attr(755,root,root) %{php_extensiondir}/spl.so
 
@@ -3414,8 +3428,7 @@ fi
 %if %{with tidy}
 %files tidy
 %defattr(644,root,root,755)
-%doc ext/tidy/{CREDITS,README}
-%doc ext/tidy/examples
+%doc ext/tidy/CREDITS
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/tidy.ini
 %attr(755,root,root) %{php_extensiondir}/tidy.so
 %endif
@@ -3442,8 +3455,7 @@ fi
 
 %files xmlreader
 %defattr(644,root,root,755)
-%doc ext/xmlreader/{CREDITS,README,TODO}
-%doc ext/xmlreader/examples
+%doc ext/xmlreader/{CREDITS,README}
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/xmlreader.ini
 %attr(755,root,root) %{php_extensiondir}/xmlreader.so
 
@@ -3457,21 +3469,21 @@ fi
 
 %files xmlwriter
 %defattr(644,root,root,755)
-%doc ext/xmlwriter/{CREDITS,TODO}
-%doc ext/xmlwriter/examples
+%doc ext/xmlwriter/CREDITS
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/xmlwriter.ini
 %attr(755,root,root) %{php_extensiondir}/xmlwriter.so
 
+%if %{with xsl}
 %files xsl
 %defattr(644,root,root,755)
 %doc ext/xsl/CREDITS
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/xsl.ini
 %attr(755,root,root) %{php_extensiondir}/xsl.so
+%endif
 
 %files zip
 %defattr(644,root,root,755)
-%doc ext/zip/{CREDITS,TODO}
-%doc ext/zip/examples
+%doc ext/zip/{CREDITS,examples}
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/zip.ini
 %attr(755,root,root) %{php_extensiondir}/zip.so