From 5df07be45aed49657ffb6c696c05b2db4bba6460 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 14 Nov 2023 15:26:15 +0100 Subject: update to 1.22.3 build out of sources tree --- PHPINFO | 2 +- REFLECTION | 2 +- php-pecl-zip.spec | 64 +++++++++++++++++++++++++++++++------------------------ 3 files changed, 38 insertions(+), 30 deletions(-) diff --git a/PHPINFO b/PHPINFO index 84b866b..9daeaee 100644 --- a/PHPINFO +++ b/PHPINFO @@ -2,7 +2,7 @@ zip Zip => enabled -Zip version => 1.22.2 +Zip version => 1.22.3 Libzip version => 1.10.1 BZIP2 compression => Yes XZ compression => Yes diff --git a/REFLECTION b/REFLECTION index d09d6f8..4f6df87 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #66 zip version 1.22.2 ] { +Extension [ extension #66 zip version 1.22.3 ] { - Functions { Function [ function zip_open ] { diff --git a/php-pecl-zip.spec b/php-pecl-zip.spec index bbf0e5a..f008b25 100644 --- a/php-pecl-zip.spec +++ b/php-pecl-zip.spec @@ -10,10 +10,13 @@ # Please, preserve the changelog entries # -# we don't want -z defs linker flag -%undefine _strict_symbol_defs_build +# For PHP < 5.6 and EPEL-9 +%{!?__phpize: %global __phpize %{_bindir}/phpize} +%{!?__ztsphpize: %global __ztsphpize %{_bindir}/zts-phpize} +%{!?__phpconfig: %global __phpconfig %{_bindir}/php-config} +%{!?__ztsphpconfig:%global __ztsphpconfig %{_bindir}/zts-php-config} -%{?scl: %scl_package php-pecl-zip} +%{?scl:%scl_package php-pecl-zip} %if ( 0%{?scl:1} && 0%{?rhel} == 8 ) || 0%{?rhel} >= 9 %bcond_without move_to_opt @@ -26,9 +29,11 @@ %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global pecl_name zip -%global upstream_version 1.22.2 +%global upstream_version 1.22.3 #global upstream_prever dev #global upstream_lower DEV +%global sources %{pecl_name}-%{upstream_version}%{?upstream_prever} +%global _configure ../%{sources}/configure %global libzip_version 1.10.1 @@ -42,12 +47,12 @@ Summary: A ZIP archive management extension Name: %{?scl_prefix}php-pecl-zip Version: %{upstream_version}%{?upstream_prever:~%{upstream_lower}} -Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: PHP-3.01 Group: Development/Languages URL: https://pecl.php.net/package/zip -Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz +Source0: https://pecl.php.net/get/%{sources}.tgz BuildRequires: make BuildRequires: %{?dtsprefix}gcc @@ -129,31 +134,30 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -c -q -mv %{pecl_name}-%{upstream_version}%{?upstream_prever} NTS # Don't install/register tests sed -e 's/role="test"/role="src"/' \ %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \ -i package.xml -cd NTS +cd %{sources} # Sanity check, really often broken extver=$(sed -n '/#define PHP_ZIP_VERSION/{s/.* "//;s/".*$//;p}' php7/php_zip.h) if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}" -a "x${extver}" != "x%{upstream_version}-%{?upstream_prever}"; then : Error: Upstream extension version is ${extver}, expecting %{upstream_version}%{?upstream_prever}. exit 1 fi - cd .. + : Create the configuration file cat >%{ini_name} << 'EOF' ; Enable ZIP extension module extension=%{pecl_name}.so EOF +mkdir NTS %if %{with_zts} -: Duplicate sources tree for ZTS build -cp -pr NTS ZTS +mkdir ZTS %endif @@ -164,22 +168,23 @@ cp -pr NTS ZTS export PKG_CONFIG_PATH=/opt/%{?vendeur:%{vendeur}/}libzip/%{_lib}/pkgconfig %endif -cd NTS -%{_bindir}/phpize +cd %{sources} +%{__phpize} + +cd ../NTS %configure \ --with-libzip \ --with-libdir=%{_lib} \ - --with-php-config=%{_bindir}/php-config + --with-php-config=%{__phpconfig} make %{?_smp_mflags} %if %{with_zts} cd ../ZTS -%{_bindir}/zts-phpize %configure \ --with-libzip \ --with-libdir=%{_lib} \ - --with-php-config=%{_bindir}/zts-php-config + --with-php-config=%{__ztsphpconfig} make %{?_smp_mflags} %endif @@ -200,45 +205,44 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif # Documentation -cd NTS +cd %{sources} for i in $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//') do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i done %check +cd %{sources} OPT="-q --show-diff" %if "%{php_version}" > "8.0" OPT="$OPT %{?_smp_mflags}" %endif -cd NTS : minimal load test of NTS extension -%{_bindir}/php --no-php-ini \ +%{__php} --no-php-ini \ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ --modules | grep %{pecl_name} %if %{with tests} : upstream test suite for NTS extension -TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" \ +TEST_PHP_ARGS="-n -d extension_dir=$PWD/../NTS/modules -d extension=%{pecl_name}.so" \ REPORT_EXIT_STATUS=1 \ -TEST_PHP_EXECUTABLE=%{_bindir}/php \ -%{_bindir}/php -n run-tests.php $OPT +TEST_PHP_EXECUTABLE=%{__php} \ +%{__php} -n run-tests.php $OPT %endif %if %{with_zts} -cd ../ZTS : minimal load test of ZTS extension -%{_bindir}/zts-php --no-php-ini \ +%{__ztsphp} --no-php-ini \ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ --modules | grep %{pecl_name} %if %{with tests} : upstream test suite for ZTS extension -TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" \ +TEST_PHP_ARGS="-n -d extension_dir=$PWD/../ZTS/modules -d extension=%{pecl_name}.so" \ REPORT_EXIT_STATUS=1 \ -TEST_PHP_EXECUTABLE=%{_bindir}/zts-php \ -%{_bindir}/zts-php -n run-tests.php $OPT +TEST_PHP_EXECUTABLE=%{__ztsphp} \ +%{__ztsphp} -n run-tests.php $OPT %endif %endif @@ -264,7 +268,7 @@ fi %files -%{?_licensedir:%license NTS/LICENSE} +%{?_licensedir:%license %{sources}/LICENSE} %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -278,6 +282,10 @@ fi %changelog +* Tue Nov 14 2023 Remi Collet - 1.22.3-1 +- update to 1.22.3 +- build out of sources tree + * Wed Aug 30 2023 Remi Collet - 1.22.2-2 - rebuild for PHP 8.3.0RC1 -- cgit