%bcond_without embed # disable building Embedded API
%bcond_with gcov # Enable Code coverage reporting
%bcond_without kerberos5 # without Kerberos5 support
-%bcond_with suhosin # with suhosin patch, has little point in PHP>=5.3, see https://github.com/stefanesser/suhosin/issues/42#issuecomment-41728178
%bcond_with systemtap # systemtap/DTrace support
%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
+%bcond_with debug # Zend Debug Build
# - SAPI
%bcond_without apache2 # disable building Apache 2.x SAPI
%bcond_without cgi # disable CGI/FCGI SAPI
%bcond_without wddx # without WDDX extension module
%bcond_without xmlrpc # without XML-RPC extension module
%bcond_without xsl # without xsl extension module
+%bcond_without zip # without zip 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_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
Patch42: %{orgname}-fpm-shared.patch
Patch43: %{orgname}-silent-session-cleanup.patch
Patch44: %{orgname}-include_path.patch
-Patch47: suhosin.patch
Patch50: extension-shared-optional-dep.patch
Patch51: spl-shared.patch
Patch52: pcre-shared.patch
BuildRequires: automake >= 1.4d
BuildRequires: bison
BuildRequires: bzip2-devel >= 1.0.0
-%{?with_curl:BuildRequires: curl-devel >= 7.12.0}
+%{?with_curl:BuildRequires: curl-devel >= 7.15.5}
BuildRequires: cyrus-sasl-devel >= 2
BuildRequires: db-devel >= 4.0
BuildRequires: elfutils-devel
BuildRequires: libtool >= 2:2.4.6
BuildRequires: libxml2-devel >= 1:2.7.6-4
%{?with_xsl:BuildRequires: libxslt-devel >= 1.1.0}
-%{?with_system_libzip:BuildRequires: libzip-devel >= 1.2.0}
+%{?with_zip:BuildRequires: libzip-devel >= 1.3.1}
%{?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_pdo_mysql:BuildRequires: mysql-devel}
%{?with_snmp:BuildRequires: net-snmp-devel >= 5.3}
BuildRequires: oniguruma-devel
%{?with_ldap:BuildRequires: openldap-devel >= 2.3.0}
%endif
%{?with_oci:%{?with_instantclient:BuildRequires: oracle-instantclient-devel}}
BuildRequires: pam-devel
-%{?with_pcre:BuildRequires: pcre-devel >= 8.10}
+%{?with_pcre:BuildRequires: pcre2-8-devel >= 10.30}
BuildRequires: pkgconfig
%{?with_pgsql:BuildRequires: postgresql-devel}
BuildRequires: readline-devel
%define sodiumver %{version}
%define _zend_zts %{!?with_zts:0}%{?with_zts:1}
-%define php_debug %{!?debug:0}%{?debug:1}
+%define php_debug %{!?with_debug:0}%{?with_debug:1}
%if %{with gcov}
%undefine with_ccache
Provides: php(reflection)
Provides: php(standard)
%{!?with_mysqlnd:Obsoletes: %{name}-mysqlnd}
-%{?with_pcre:%requires_ge_to pcre pcre-devel}
+%{?with_pcre:%requires_ge_to pcre2-8 pcre2-8-devel}
Suggests: browscap
Obsoletes: php-common < 4:5.3.28-7
# withdrawn modules
Requires: autoconf >= 2.13
Requires: automake
Requires: libtool >= 2:2.4.6
-%{?with_pcre:Requires: pcre-devel >= 8.10}
+%{?with_pcre:Requires: pcre2-8-devel >= 10.30}
Requires: shtool
Provides: php-devel = %{epoch}:%{version}-%{release}
+Obsoletes: php-devel
Obsoletes: php-pear-devel
Obsoletes: php4-devel
Obsoletes: php52-devel
Obsoletes: php53-devel
Obsoletes: php54-devel
Obsoletes: php55-devel
+Obsoletes: php56-devel
%description devel
The php-devel package lets you compile dynamic extensions to PHP.
Group: Libraries
URL: http://php.net/manual/en/book.zip.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
-%{?with_system_libzip:Requires: libzip >= 1.2.0}
+%{?with_zip:Requires: libzip >= 1.3.1}
Provides: php(zip) = %{zipver}
Obsoletes: php-pecl-zip < %{zipver}
Obsoletes: php-zip < 4:5.3.28-7
%endif
%patch43 -p1
%patch44 -p1
-%if %{with suhosin}
-%patch47 -p1
-%endif
%patch50 -p1
%patch51 -p1 -b .spl-shared
%patch52 -p1 -b .pcre-shared
sh -xe %{_sourcedir}/skip-tests.sh
%build
+get_version() {
+ local define="$1" filename="$2"
+ awk -vdefine="$define" '/#define/ && $2 == define {print $3}' "$filename" | xargs
+}
+
API=$(awk '/#define PHP_API_VERSION/{print $3}' main/php.h)
if [ $API != %{php_api_version} ]; then
echo "Set %%define php_api_version to $API and re-run."
: Update the fileinfover macro and rebuild.
exit 1
fi
-ver=$(awk '/#define PHP_PHAR_VERSION/ {print $3}' ext/phar/php_phar.h | xargs)
+ver=$(get_version PHP_PHAR_VERSION ext/phar/php_phar.h)
if test "$ver" != "PHP_VERSION"; then
: Error: Upstream PHAR version is now ${ver}, expecting %{pharver}.
: Update the pharver macro and rebuild.
: Update the phpdbgver macro and rebuild.
exit 1
fi
-ver=$(awk '/#define PHP_BZ2_VERSION/ {print $3}' ext/bz2/php_bz2.h | xargs)
+ver=$(get_version PHP_BZ2_VERSION ext/bz2/php_bz2.h)
if test "$ver" != "PHP_VERSION"; then
: Error: Upstream BZIP2 version is now ${ver}, expecting %{bz2ver}.
: Update the bz2ver macro and rebuild.
if test "$ver" != "PHP_VERSION"; then
exit 1
fi
-ver=$(awk '/#define PHP_HASH_VERSION/ {print $3}' ext/hash/php_hash.h | xargs)
+ver=$(get_version PHP_HASH_VERSION ext/hash/php_hash.h)
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=$(awk '/#define PHP_INTL_VERSION/ {print $3}' ext/intl/php_intl.h | xargs)
+ver=$(get_version PHP_INTL_VERSION ext/intl/php_intl.h)
if test "$ver" != "PHP_VERSION"; then
: Error: Upstream Intl version is now ${ver}, expecting %{intlver}.
: Update the intlver macro and rebuild.
export CXXFLAGS="%{rpmcxxflags} -fPIC -DPIC"
export CFLAGS="%{rpmcflags} -fPIC -DPIC"
+%if %{with intl}
+# icu 59+ C++ API requires C++ >= 11
+CXXFLAGS="$CXXFLAGS -std=c++11"
+%endif
+
sapis="
cli
%if %{with cgi}
--with-config-file-scan-dir=%{_sysconfdir}/conf.d \
--with-system-tzdata \
%{?with_argon2:--with-password-argon2} \
- --%{!?debug:dis}%{?debug:en}able-debug \
+ --%{!?with_debug:dis}%{?with_debug:en}able-debug \
%{?with_zts:--enable-maintainer-zts} \
--enable-inline-optimization \
%{__enable_disable bcmath bcmath shared} \
%{?with_xsl:--with-xsl=shared} \
--with-zlib=shared \
--with-zlib-dir=shared,/usr \
- %{?with_system_libzip:--with-libzip} \
- --enable-zip=shared,/usr \
+ %{?with_zip:--enable-zip=shared,/usr --with-libzip} \
# save for debug
cp -f Makefile Makefile.$sapi
[ "$mod" = "spl" ] && conf="SPL.ini"
# session needs to be loaded before php-pecl-http, php-pecl-memcache, php-pecl-session_mysql
[ "$mod" = "session" ] && conf="Session.ini"
+ # hash needs to be loaded before mysqlnd
+ [ "$mod" = "hash" ] && conf="hash.ini"
# mysqlnd needs to be loaded before mysqli,pdo_mysqli
[ "$mod" = "mysqlnd" ] && conf="MySQLND.ini"
echo "+ $conf"
%attr(755,root,root) %{php_extensiondir}/xsl.so
%endif
+%if %{with zip}
%files zip
%defattr(644,root,root,755)
%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
+%endif
%files zlib
%defattr(644,root,root,755)