From 5338f97e2c42d49071fc8c177268b9dde4454828 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 24 Jun 2020 15:50:45 +0200 Subject: use system nikic/php-parser if available to generate C headers from PHP stub switch from "runselftest" option to bcond_without tests --- php-8.0.0-parser.patch | 14 ++++++++++++ php.spec | 59 ++++++++++++++++---------------------------------- 2 files changed, 33 insertions(+), 40 deletions(-) create mode 100644 php-8.0.0-parser.patch diff --git a/php-8.0.0-parser.patch b/php-8.0.0-parser.patch new file mode 100644 index 0000000..cb676e9 --- /dev/null +++ b/php-8.0.0-parser.patch @@ -0,0 +1,14 @@ +diff -up ./build/gen_stub.php.old ./build/gen_stub.php +--- ./build/gen_stub.php.old 2020-06-24 15:29:13.503969177 +0200 ++++ ./build/gen_stub.php 2020-06-24 15:29:17.627958935 +0200 +@@ -1055,6 +1055,10 @@ function installPhpParser(string $versio + } + + function initPhpParser() { ++ if (file_exists('/usr/share/php/PhpParser4/autoload.php')) { ++ require_once '/usr/share/php/PhpParser4/autoload.php'; ++ return; ++ } + $version = "4.3.0"; + $phpParserDir = __DIR__ . "/PHP-Parser-$version"; + if (!is_dir($phpParserDir)) { diff --git a/php.spec b/php.spec index 4b05292..60b7b41 100644 --- a/php.spec +++ b/php.spec @@ -56,8 +56,8 @@ %global with_lsws 1 # Regression tests take a long time, you can skip 'em with this -%{!?runselftest: %global runselftest 1} -#global runselftest 0 +%bcond_without tests + # Use the arch-specific mysql_config binary to avoid mismatch with the # arch detection heuristic used by bindir/mysql_config. @@ -108,7 +108,7 @@ Summary: PHP scripting language for creating dynamic web sites Name: %{?scl_prefix}php Version: %{upver}%{?lower:~%{lower}}%{?gh_date:.%{gh_date}} -Release: 20%{?dist} +Release: 21%{?dist} # All files licensed under PHP version 3.01, except # Zend is licensed under Zend # TSRM is licensed under BSD @@ -116,7 +116,6 @@ Release: 20%{?dist} # ext/date/lib is MIT # Zend/zend_sort is NCSA License: PHP and Zend and BSD and MIT and ASL 1.0 and NCSA -Group: Development/Languages URL: http://www.php.net/ %if 0%{?gh_date} @@ -152,6 +151,9 @@ Patch8: php-7.4.0-libdb.patch Patch9: php-7.0.7-curl.patch # Functional changes +# Use system nikic/php-parser +Patch41: php-8.0.0-parser.patch +# use system tzdata Patch42: php-7.3.3-systzdata-v18.patch # See http://bugs.php.net/53436 Patch43: php-7.4.0-phpize.patch @@ -261,7 +263,6 @@ which adds support for the PHP language to system Apache HTTP Server. %package cli -Group: Development/Languages Summary: Command-line interface for PHP # sapi/cli/ps_title.c is PostgreSQL License: PHP and Zend and BSD and MIT and ASL 1.0 and NCSA and PostgreSQL @@ -276,7 +277,6 @@ executing PHP scripts, %{_bindir}/php, and the CGI interface. %package dbg -Group: Development/Languages Summary: The interactive PHP debugger Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release} @@ -285,7 +285,6 @@ The %{?scl_prefix}php-dbg package contains the interactive PHP debugger. %package fpm -Group: Development/Languages Summary: PHP FastCGI Process Manager BuildRequires: libacl-devel BuildRequires: pkgconfig(libsystemd) >= 209 @@ -312,7 +311,6 @@ any size, especially busier sites. %if %{with_lsws} %package litespeed Summary: LiteSpeed Web Server PHP support -Group: Development/Languages Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release} %description litespeed @@ -323,7 +321,6 @@ used by the LiteSpeed Web Server (LSAPI enabled PHP). %package embedded Summary: PHP library for embedding in applications -Group: System Environment/Libraries Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release} # doing a real -devel package for just the .so symlink is a bit overkill Provides: %{?scl_prefix}php-embedded-devel = %{version}-%{release} @@ -335,7 +332,6 @@ into applications to provide PHP scripting language support. %package common -Group: Development/Languages Summary: Common files for PHP # All files licensed under PHP version 3.01, except # fileinfo is licensed under PHP version 3.0 @@ -383,7 +379,6 @@ The %{?scl_prefix}php-common package contains files used by both the %{?scl_prefix}php package and the %{?scl_prefix}php-cli package. %package devel -Group: Development/Libraries Summary: Files needed for building PHP extensions Requires: %{?scl_prefix}php-cli%{?_isa} = %{version}-%{release} # always needed to build extension @@ -400,6 +395,10 @@ Requires: openssl-devel%{?_isa} >= 1.0.1 Requires: pcre2-devel%{?_isa} >= 10.30 %endif Requires: zlib-devel%{?_isa} +# TODO add rhel 8 when EPEL will have php-nikic-php-parser4 +%if 0%{?fedora} +Recommends: php-nikic-php-parser4 >= 4.3.0 +%endif %description devel The %{?scl_prefix}php-devel package contains the files needed for building PHP @@ -408,7 +407,6 @@ need to install this package. %package opcache Summary: The Zend OPcache -Group: Development/Languages License: PHP Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release} Provides: %{?scl_prefix}php-pecl-zendopcache = %{version} @@ -426,7 +424,6 @@ bytecode optimization patterns that make code execution faster. %if %{with_imap} %package imap Summary: A module for PHP applications that use IMAP -Group: Development/Languages # All files licensed under PHP version 3.01 License: PHP Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release} @@ -443,7 +440,6 @@ messages on mail servers. PHP is an HTML-embedded scripting language. %package ldap Summary: A module for PHP applications that use LDAP -Group: Development/Languages # All files licensed under PHP version 3.01 License: PHP Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release} @@ -459,7 +455,6 @@ language. %package pdo Summary: A database access abstraction module for PHP applications -Group: Development/Languages # All files licensed under PHP version 3.01 License: PHP Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release} @@ -479,7 +474,6 @@ databases. %package mysqlnd Summary: A module for PHP applications that use MySQL databases -Group: Development/Languages # All files licensed under PHP version 3.01 License: PHP Requires: %{?scl_prefix}php-pdo%{?_isa} = %{version}-%{release} @@ -499,7 +493,6 @@ This package use the MySQL Native Driver %package pgsql Summary: A PostgreSQL database module for PHP -Group: Development/Languages # All files licensed under PHP version 3.01 License: PHP Requires: %{?scl_prefix}php-pdo%{?_isa} = %{version}-%{release} @@ -519,7 +512,6 @@ php package. %package process Summary: Modules for PHP script using system process interfaces -Group: Development/Languages # All files licensed under PHP version 3.01 License: PHP Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release} @@ -536,7 +528,6 @@ communication. %package odbc Summary: A module for PHP applications that use ODBC databases -Group: Development/Languages # All files licensed under PHP version 3.01, except # pdo_odbc is licensed under PHP version 3.0 License: PHP @@ -557,7 +548,6 @@ package. %package soap Summary: A module for PHP applications that use the SOAP protocol -Group: Development/Languages # All files licensed under PHP version 3.01 License: PHP Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release} @@ -570,7 +560,6 @@ support to PHP for using the SOAP web services protocol. %if %{with_interbase} %package pdo-firebird Summary: PDO driver for Interbase/Firebird databases -Group: Development/Languages # All files licensed under PHP version 3.01 License: PHP BuildRequires: firebird-devel @@ -596,7 +585,6 @@ License. %if %{with_oci8} %package oci8 Summary: A module for PHP applications that use OCI8 databases -Group: Development/Languages # All files licensed under PHP version 3.01 License: PHP BuildRequires: oracle-instantclient-devel >= %{oraclever} @@ -632,7 +620,6 @@ Documentation is at http://php.net/oci8 and http://php.net/pdo_oci %package snmp Summary: A module for PHP applications that query SNMP-managed devices -Group: Development/Languages # All files licensed under PHP version 3.01 License: PHP Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release}, net-snmp @@ -646,7 +633,6 @@ will need to install this package and the php package. %package xml Summary: A module for PHP applications which use XML -Group: Development/Languages # All files licensed under PHP version 3.01 License: PHP Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release} @@ -667,7 +653,6 @@ and performing XSL transformations on XML documents. %package mbstring Summary: A module for PHP applications which need multi-byte string handling -Group: Development/Languages # All files licensed under PHP version 3.01, except # libmbfl is licensed under LGPLv2 # onigurama is licensed under BSD @@ -687,7 +672,6 @@ support for multi-byte string handling to PHP. %package gd Summary: A module for PHP applications for using the gd graphics library -Group: Development/Languages # All files licensed under PHP version 3.01 %if %{with_libgd} License: PHP @@ -720,7 +704,6 @@ support for using the gd graphics library to PHP. %package bcmath Summary: A module for PHP applications for using the bcmath library -Group: Development/Languages # All files licensed under PHP version 3.01, except # libbcmath is licensed under LGPLv2+ License: PHP and LGPLv2+ @@ -733,7 +716,6 @@ support for using the bcmath library to PHP. %package gmp Summary: A module for PHP applications for using the GNU MP library -Group: Development/Languages # All files licensed under PHP version 3.01 License: PHP BuildRequires: gmp-devel @@ -745,7 +727,6 @@ using the GNU MP library. %package dba Summary: A database abstraction layer module for PHP applications -Group: Development/Languages # All files licensed under PHP version 3.01 License: PHP BuildRequires: libdb-devel @@ -760,7 +741,6 @@ support for using the DBA database abstraction layer to PHP. %if %{with_tidy} %package tidy Summary: Standard PHP module provides tidy library support -Group: Development/Languages # All files licensed under PHP version 3.01 License: PHP Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release} @@ -774,7 +754,6 @@ support for using the tidy library to PHP. %if %{with_freetds} %package pdo-dblib Summary: PDO driver for Microsoft SQL Server and Sybase databases -Group: Development/Languages # All files licensed under PHP version 3.01 License: PHP Requires: %{?scl_prefix}php-pdo%{?_isa} = %{version}-%{release} @@ -789,7 +768,6 @@ PHP to Microsoft SQL Server and Sybase databases through the FreeTDS library. %package pspell Summary: A module for PHP applications for using pspell interfaces -Group: System Environment/Libraries # All files licensed under PHP version 3.01 License: PHP Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release} @@ -801,7 +779,6 @@ support for using the pspell library to PHP. %package intl Summary: Internationalization extension for PHP applications -Group: System Environment/Libraries # All files licensed under PHP version 3.01 License: PHP Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release} @@ -818,7 +795,6 @@ support for using the ICU library to PHP. Summary: Enchant spelling extension for PHP applications # All files licensed under PHP version 3.0 License: PHP -Group: System Environment/Libraries Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release} BuildRequires: pkgconfig(enchant-2) @@ -832,7 +808,6 @@ support for using the enchant library to PHP. Summary: ZIP archive management extension for PHP # All files licensed under PHP version 3.0.1 License: PHP -Group: System Environment/Libraries Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release} BuildRequires: pkgconfig(libzip) >= 0.11 @@ -846,7 +821,6 @@ support for ZIP archive management to PHP. Summary: Wrapper for the Sodium cryptographic library # All files licensed under PHP version 3.0.1 License: PHP -Group: System Environment/Libraries # Minimal is 1.0.8, 1.0.14 is needed for argon2 password BuildRequires: pkgconfig(libsodium) >= 1.0.14 @@ -864,7 +838,6 @@ low-level PHP extension for the libsodium cryptographic library. Summary: Foreign Function Interface # All files licensed under PHP version 3.0.1 License: PHP -Group: System Environment/Libraries BuildRequires: pkgconfig(libffi) Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release} @@ -900,7 +873,8 @@ in pure PHP. %patch9 -p1 -b .curltls %endif -%if 0%{?fedora} >= 28 || 0%{?rhel} >= 6 +%patch41 -p1 -b .syslib +%if 0%{?fedora} >= 30 || 0%{?rhel} >= 6 %patch42 -p1 -b .systzdata %endif %patch43 -p1 -b .headers @@ -1276,8 +1250,7 @@ popd %check -%if %runselftest - +%if %{with tests} cd build-apache # Run tests, using the CLI SAPI @@ -1301,6 +1274,7 @@ fi unset NO_INTERACTION REPORT_EXIT_STATUS MALLOC_CHECK_ %endif + %install %{?dtsenable} @@ -1778,6 +1752,11 @@ fi %changelog +* Wed Jun 24 2020 Remi Collet - 8.0.0~alpha1-21 +- use system nikic/php-parser if available to generate + C headers from PHP stub +- switch from "runselftest" option to bcond_without tests + * Wed Jun 24 2020 Remi Collet - 8.0.0~alpha1-20 - update to 8.0.0alpha1 -- cgit