diff options
-rw-r--r-- | PHPINFO | 4 | ||||
-rw-r--r-- | REFLECTION | 100 | ||||
-rw-r--r-- | php-pecl-zip.spec | 218 | ||||
-rw-r--r-- | zip-upstream.patch | 196 |
4 files changed, 194 insertions, 324 deletions
@@ -2,8 +2,8 @@ zip Zip => enabled -Zip version => 1.21.0 -Libzip version => 1.9.2 +Zip version => 1.22.6 +Libzip version => 1.11.3 BZIP2 compression => Yes XZ compression => Yes ZSTD compression => Yes @@ -1,4 +1,8 @@ -Extension [ <persistent> extension #66 zip version 1.21.0 ] { +Extension [ <persistent> extension #66 zip version 1.22.6 ] { + + - Dependencies { + Dependency [ pcre (Required) ] + } - Functions { Function [ <internal, deprecated:zip> function zip_open ] { @@ -77,7 +81,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { - Classes [1] { Class [ <internal:zip> class ZipArchive implements Countable ] { - - Constants [100] { + - Constants [110] { Constant [ public int CREATE ] { 1 } Constant [ public int EXCL ] { 2 } Constant [ public int CHECKCONS ] { 4 } @@ -97,6 +101,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Constant [ public int FL_ENC_STRICT ] { 128 } Constant [ public int FL_ENC_UTF_8 ] { 2048 } Constant [ public int FL_ENC_CP437 ] { 4096 } + Constant [ public int FL_OPEN_FILE_NOW ] { 1073741824 } Constant [ public int CM_DEFAULT ] { -1 } Constant [ public int CM_STORE ] { 0 } Constant [ public int CM_SHRINK ] { 1 } @@ -150,6 +155,13 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Constant [ public int ER_TELL ] { 30 } Constant [ public int ER_COMPRESSED_DATA ] { 31 } Constant [ public int ER_CANCELLED ] { 32 } + Constant [ public int ER_DATA_LENGTH ] { 33 } + Constant [ public int ER_NOT_ALLOWED ] { 34 } + Constant [ public int ER_TRUNCATED_ZIP ] { 35 } + Constant [ public int AFL_RDONLY ] { 2 } + Constant [ public int AFL_IS_TORRENTZIP ] { 4 } + Constant [ public int AFL_WANT_TORRENTZIP ] { 8 } + Constant [ public int AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE ] { 16 } Constant [ public int OPSYS_DOS ] { 0 } Constant [ public int OPSYS_AMIGA ] { 1 } Constant [ public int OPSYS_OPENVMS ] { 2 } @@ -177,7 +189,9 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Constant [ public int EM_AES_192 ] { 258 } Constant [ public int EM_AES_256 ] { 259 } Constant [ public int EM_UNKNOWN ] { 65535 } - Constant [ public string LIBZIP_VERSION ] { 1.9.2 } + Constant [ public string LIBZIP_VERSION ] { 1.11.3 } + Constant [ public int LENGTH_TO_END ] { 0 } + Constant [ public int LENGTH_UNCHECKED ] { -2 } } - Static properties [0] { @@ -204,21 +218,22 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { } - Properties [6] { - Property [ public $lastId = NULL ] - Property [ public $status = NULL ] - Property [ public $statusSys = NULL ] - Property [ public $numFiles = NULL ] - Property [ public $filename = NULL ] - Property [ public $comment = NULL ] + Property [ public int $lastId ] + Property [ public int $status ] + Property [ public int $statusSys ] + Property [ public int $numFiles ] + Property [ public string $filename ] + Property [ public string $comment ] } - - Methods [48] { + - Methods [50] { Method [ <internal:zip> public method open ] { - Parameters [2] { Parameter #0 [ <required> string $filename ] Parameter #1 [ <optional> int $flags = 0 ] } + - Tentative return [ int|bool ] } Method [ <internal:zip> public method setPassword ] { @@ -226,24 +241,28 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { - Parameters [1] { Parameter #0 [ <required> string $password ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method close ] { - Parameters [0] { } + - Tentative return [ bool ] } Method [ <internal:zip, prototype Countable> public method count ] { - Parameters [0] { } + - Tentative return [ int ] } Method [ <internal:zip> public method getStatusString ] { - Parameters [0] { } + - Tentative return [ string ] } Method [ <internal:zip> public method clearError ] { @@ -259,6 +278,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #0 [ <required> string $dirname ] Parameter #1 [ <optional> int $flags = 0 ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method addFromString ] { @@ -268,6 +288,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #1 [ <required> string $content ] Parameter #2 [ <optional> int $flags = ZipArchive::FL_OVERWRITE ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method addFile ] { @@ -276,9 +297,10 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #0 [ <required> string $filepath ] Parameter #1 [ <optional> string $entryname = "" ] Parameter #2 [ <optional> int $start = 0 ] - Parameter #3 [ <optional> int $length = 0 ] + Parameter #3 [ <optional> int $length = ZipArchive::LENGTH_TO_END ] Parameter #4 [ <optional> int $flags = ZipArchive::FL_OVERWRITE ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method replaceFile ] { @@ -287,9 +309,10 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #0 [ <required> string $filepath ] Parameter #1 [ <required> int $index ] Parameter #2 [ <optional> int $start = 0 ] - Parameter #3 [ <optional> int $length = 0 ] + Parameter #3 [ <optional> int $length = ZipArchive::LENGTH_TO_END ] Parameter #4 [ <optional> int $flags = 0 ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method addGlob ] { @@ -299,6 +322,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #1 [ <optional> int $flags = 0 ] Parameter #2 [ <optional> array $options = [] ] } + - Tentative return [ array|false ] } Method [ <internal:zip> public method addPattern ] { @@ -308,6 +332,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #1 [ <optional> string $path = "." ] Parameter #2 [ <optional> array $options = [] ] } + - Tentative return [ array|false ] } Method [ <internal:zip> public method renameIndex ] { @@ -316,6 +341,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #0 [ <required> int $index ] Parameter #1 [ <required> string $new_name ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method renameName ] { @@ -324,6 +350,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #0 [ <required> string $name ] Parameter #1 [ <required> string $new_name ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method setArchiveComment ] { @@ -331,6 +358,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { - Parameters [1] { Parameter #0 [ <required> string $comment ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method getArchiveComment ] { @@ -338,6 +366,25 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { - Parameters [1] { Parameter #0 [ <optional> int $flags = 0 ] } + - Tentative return [ string|false ] + } + + Method [ <internal:zip> public method setArchiveFlag ] { + + - Parameters [2] { + Parameter #0 [ <required> int $flag ] + Parameter #1 [ <required> int $value ] + } + - Return [ bool ] + } + + Method [ <internal:zip> public method getArchiveFlag ] { + + - Parameters [2] { + Parameter #0 [ <required> int $flag ] + Parameter #1 [ <optional> int $flags = 0 ] + } + - Return [ int ] } Method [ <internal:zip> public method setCommentIndex ] { @@ -346,6 +393,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #0 [ <required> int $index ] Parameter #1 [ <required> string $comment ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method setCommentName ] { @@ -354,6 +402,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #0 [ <required> string $name ] Parameter #1 [ <required> string $comment ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method setMtimeIndex ] { @@ -363,6 +412,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #1 [ <required> int $timestamp ] Parameter #2 [ <optional> int $flags = 0 ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method setMtimeName ] { @@ -372,6 +422,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #1 [ <required> int $timestamp ] Parameter #2 [ <optional> int $flags = 0 ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method getCommentIndex ] { @@ -380,6 +431,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #0 [ <required> int $index ] Parameter #1 [ <optional> int $flags = 0 ] } + - Tentative return [ string|false ] } Method [ <internal:zip> public method getCommentName ] { @@ -388,6 +440,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #0 [ <required> string $name ] Parameter #1 [ <optional> int $flags = 0 ] } + - Tentative return [ string|false ] } Method [ <internal:zip> public method deleteIndex ] { @@ -395,6 +448,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { - Parameters [1] { Parameter #0 [ <required> int $index ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method deleteName ] { @@ -402,6 +456,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { - Parameters [1] { Parameter #0 [ <required> string $name ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method statName ] { @@ -410,6 +465,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #0 [ <required> string $name ] Parameter #1 [ <optional> int $flags = 0 ] } + - Tentative return [ array|false ] } Method [ <internal:zip> public method statIndex ] { @@ -418,6 +474,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #0 [ <required> int $index ] Parameter #1 [ <optional> int $flags = 0 ] } + - Tentative return [ array|false ] } Method [ <internal:zip> public method locateName ] { @@ -426,6 +483,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #0 [ <required> string $name ] Parameter #1 [ <optional> int $flags = 0 ] } + - Tentative return [ int|false ] } Method [ <internal:zip> public method getNameIndex ] { @@ -434,18 +492,21 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #0 [ <required> int $index ] Parameter #1 [ <optional> int $flags = 0 ] } + - Tentative return [ string|false ] } Method [ <internal:zip> public method unchangeArchive ] { - Parameters [0] { } + - Tentative return [ bool ] } Method [ <internal:zip> public method unchangeAll ] { - Parameters [0] { } + - Tentative return [ bool ] } Method [ <internal:zip> public method unchangeIndex ] { @@ -453,6 +514,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { - Parameters [1] { Parameter #0 [ <required> int $index ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method unchangeName ] { @@ -460,6 +522,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { - Parameters [1] { Parameter #0 [ <required> string $name ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method extractTo ] { @@ -468,6 +531,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #0 [ <required> string $pathto ] Parameter #1 [ <optional> array|string|null $files = null ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method getFromName ] { @@ -477,6 +541,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #1 [ <optional> int $len = 0 ] Parameter #2 [ <optional> int $flags = 0 ] } + - Tentative return [ string|false ] } Method [ <internal:zip> public method getFromIndex ] { @@ -486,6 +551,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #1 [ <optional> int $len = 0 ] Parameter #2 [ <optional> int $flags = 0 ] } + - Tentative return [ string|false ] } Method [ <internal:zip> public method getStreamIndex ] { @@ -519,6 +585,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #2 [ <required> int $attr ] Parameter #3 [ <optional> int $flags = 0 ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method setExternalAttributesIndex ] { @@ -529,6 +596,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #2 [ <required> int $attr ] Parameter #3 [ <optional> int $flags = 0 ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method getExternalAttributesName ] { @@ -539,6 +607,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #2 [ <required> &$attr ] Parameter #3 [ <optional> int $flags = 0 ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method getExternalAttributesIndex ] { @@ -549,6 +618,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #2 [ <required> &$attr ] Parameter #3 [ <optional> int $flags = 0 ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method setCompressionName ] { @@ -558,6 +628,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #1 [ <required> int $method ] Parameter #2 [ <optional> int $compflags = 0 ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method setCompressionIndex ] { @@ -567,6 +638,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #1 [ <required> int $method ] Parameter #2 [ <optional> int $compflags = 0 ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method setEncryptionName ] { @@ -576,6 +648,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #1 [ <required> int $method ] Parameter #2 [ <optional> ?string $password = null ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method setEncryptionIndex ] { @@ -585,6 +658,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #1 [ <required> int $method ] Parameter #2 [ <optional> ?string $password = null ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method registerProgressCallback ] { @@ -593,6 +667,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { Parameter #0 [ <required> float $rate ] Parameter #1 [ <required> callable $callback ] } + - Tentative return [ bool ] } Method [ <internal:zip> public method registerCancelCallback ] { @@ -600,6 +675,7 @@ Extension [ <persistent> extension #66 zip version 1.21.0 ] { - Parameters [1] { Parameter #0 [ <required> callable $callback ] } + - Tentative return [ bool ] } } } diff --git a/php-pecl-zip.spec b/php-pecl-zip.spec index 7919458..37a034e 100644 --- a/php-pecl-zip.spec +++ b/php-pecl-zip.spec @@ -3,32 +3,35 @@ # # fedora spec file for php-pecl-zip # -# Copyright (c) 2013-2022 Remi Collet -# License: CC-BY-SA -# http://creativecommons.org/licenses/by-sa/4.0/ +# SPDX-FileCopyrightText: Copyright 2013-2025 Remi Collet +# SPDX-License-Identifier: CECILL-2.1 +# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt # # Please, preserve the changelog entries # -# we don't want -z defs linker flag -%undefine _strict_symbol_defs_build - -%{?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 +%bcond_without move_to_opt %else -%bcond_with move_to_opt +%bcond_with move_to_opt %endif -%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} -%global pecl_name zip +%bcond_without tests + +%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} +%global pecl_name zip +%global pie_vend pecl +%global pie_proj zip -%global upstream_version 1.21.0 +%global upstream_version 1.22.6 #global upstream_prever dev #global upstream_lower DEV +%global sources %{pecl_name}-%{upstream_version}%{?upstream_prever} +%global _configure ../%{sources}/configure -%global libzip_version 1.9.2 +%global libzip_version 1.11.1 %if "%{php_version}" < "5.6" %global ini_name %{pecl_name}.ini @@ -40,14 +43,12 @@ Summary: A ZIP archive management extension Name: %{?scl_prefix}php-pecl-zip Version: %{upstream_version}%{?upstream_prever:~%{upstream_lower}} -Release: 5%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} -License: PHP +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 - -Patch0: %{pecl_name}-upstream.patch +Source0: https://pecl.php.net/get/%{sources}.tgz BuildRequires: make BuildRequires: %{?dtsprefix}gcc @@ -58,69 +59,23 @@ BuildRequires: %{?scl_prefix}php-pear %if %{with move_to_opt} BuildRequires: %{?vendeur:%{vendeur}-}libzip-devel >= %{libzip_version} Requires: %{?vendeur:%{vendeur}-}libzip%{?_isa} >= %{libzip_version} +%global __brp_check_rpaths /bin/true %global __requires_exclude ^libzip\\.so.*$ %else # Ensure latest version is used -%if 0%{?rhel} == 7 -BuildRequires: libzip5-devel >= %{libzip_version} -Requires: libzip5%{?_isa} >= %{libzip_version} -%else BuildRequires: libzip-devel >= %{libzip_version} Requires: libzip%{?_isa} >= %{libzip_version} %endif -%endif Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} -%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} +Provides: %{?scl_prefix}php-pie(%{pie_vend}/%{pie_proj}) = %{version} Provides: %{?scl_prefix}php-%{pecl_name} = 1:%{version}-%{release} Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = 1:%{version}-%{release} -%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} -# Other third party repo stuff -Obsoletes: php53-pecl-%{pecl_name} <= %{version} -Obsoletes: php53u-pecl-%{pecl_name} <= %{version} -Obsoletes: php54-pecl-%{pecl_name} <= %{version} -Obsoletes: php54w-pecl-%{pecl_name} <= %{version} -%if "%{php_version}" > "5.5" -Obsoletes: php55u-pecl-%{pecl_name} <= %{version} -Obsoletes: php55w-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "5.6" -Obsoletes: php56u-pecl-%{pecl_name} <= %{version} -Obsoletes: php56w-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "7.0" -Obsoletes: php70u-pecl-%{pecl_name} <= %{version} -Obsoletes: php70w-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "7.1" -Obsoletes: php71u-pecl-%{pecl_name} <= %{version} -Obsoletes: php71w-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "7.2" -Obsoletes: php72u-pecl-%{pecl_name} <= %{version} -Obsoletes: php72w-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "7.3" -Obsoletes: php73-pecl-%{pecl_name} <= %{version} -Obsoletes: php73w-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "7.4" -Obsoletes: php74-pecl-%{pecl_name} <= %{version} -Obsoletes: php74w-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "8.0" -Obsoletes: php80-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "8.1" -Obsoletes: php81-pecl-%{pecl_name} <= %{version} -%endif -%endif - %if "%{php_version}" > "7.0" Obsoletes: %{?scl_prefix}php-zip <= 7.0.0 %endif @@ -136,33 +91,32 @@ 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"/' } \ + -e '/LICENSE/s/role="doc"/role="src"/' \ -i package.xml -cd NTS -%patch0 -p1 +cd %{sources} +sed -e '/PHP_ZIP_VERSION/s/1.22.dev/%{version}/' -i php74/php_zip.h # Sanity check, really often broken -extver=$(sed -n '/#define PHP_ZIP_VERSION/{s/.* "//;s/".*$//;p}' php7/php_zip.h) +extver=$(sed -n '/#define PHP_ZIP_VERSION/{s/.* "//;s/".*$//;p}' php74/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 @@ -173,103 +127,89 @@ cp -pr NTS ZTS export PKG_CONFIG_PATH=/opt/%{?vendeur:%{vendeur}/}libzip/%{_lib}/pkgconfig %endif -cd NTS -%{_bindir}/phpize +cd %{sources} +%{__phpize} +[ -f Makefile.global ] && GLOBAL=Makefile.global || GLOBAL=build/Makefile.global +sed -e 's/INSTALL_ROOT/DESTDIR/' -i $GLOBAL + +cd ../NTS %configure \ --with-libzip \ --with-libdir=%{_lib} \ - --with-php-config=%{_bindir}/php-config + --with-php-config=%{__phpconfig} -make %{?_smp_mflags} +%make_build %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} +%make_build %endif %install %{?dtsenable} -make -C NTS install INSTALL_ROOT=%{buildroot} +%make_install -C NTS install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} # Install XML package description install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml %if %{with_zts} -make -C ZTS install INSTALL_ROOT=%{buildroot} +%make_install -C ZTS 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 - - -%if 0%{?fedora} < 24 && 0%{?rhel} < 8 -# when pear installed alone, after us -%triggerin -- %{?scl_prefix}php-pear -if [ -x %{__pecl} ] ; then - %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : -fi - -# posttrans as pear can be installed after us -%posttrans -if [ -x %{__pecl} ] ; then - %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : -fi - -%postun -if [ $1 -eq 0 -a -x %{__pecl} ] ; then - %{pecl_uninstall} %{pecl_name} >/dev/null || : -fi %endif %files -%{?_licensedir:%license NTS/LICENSE} +%license %{sources}/LICENSE %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -283,6 +223,56 @@ fi %changelog +* Wed May 7 2025 Remi Collet <remi@remirepo.net> - 1.22.6-1 +- update to 1.22.6 + +* Thu Feb 20 2025 Remi Collet <remi@remirepo.net> - 1.22.5-1.1 +- fix reported version with PHP 7.4 + +* Thu Feb 20 2025 Remi Collet <remi@remirepo.net> - 1.22.5-1 +- update to 1.22.5 +- re-license spec file to CECILL-2.1 + +* Fri Nov 15 2024 Remi Collet <remi@remirepo.net> - 1.22.4-2 +- don't check rpath + +* Thu Sep 26 2024 Remi Collet <remi@remirepo.net> - 1.22.4-1 +- update to 1.22.4 + +* Tue Sep 24 2024 Remi Collet <remi@remirepo.net> - 1.22.3-5 +- rebuild for 8.4.0RC1 + +* Wed Aug 21 2024 Remi Collet <remi@remirepo.net> - 1.22.3-4 +- fix previous patch (for 8.0) + +* Wed Jul 17 2024 Remi Collet <remi@remirepo.net> - 1.22.3-3 +- rebuild for 8.4.0alpha2 + +* Thu Jul 4 2024 Remi Collet <remi@remirepo.net> - 1.22.3-2 +- add upstream patches for PHP 8.4 + +* Tue Nov 14 2023 Remi Collet <remi@remirepo.net> - 1.22.3-1 +- update to 1.22.3 +- build out of sources tree + +* Wed Aug 30 2023 Remi Collet <remi@remirepo.net> - 1.22.2-2 +- rebuild for PHP 8.3.0RC1 + +* Wed Aug 23 2023 Remi Collet <remi@remirepo.net> - 1.22.2-1 +- update to 1.22.2 + +* Thu Jun 29 2023 Remi Collet <remi@remirepo.net> - 1.22.1-1 +- update to 1.22.1 + +* Mon Jun 26 2023 Remi Collet <remi@remirepo.net> - 1.22.0-1 +- update to 1.22.0 + +* Mon Jun 5 2023 Remi Collet <remi@remirepo.net> - 1.21.1-2 +- add upstream patches for 8.3 + +* Fri Sep 16 2022 Remi Collet <remi@remirepo.net> - 1.21.1-1 +- update to 1.21.1 + * Thu Sep 1 2022 Remi Collet <remi@remirepo.net> - 1.21.0-5 - rebuild for PHP 8.2.0RC1 diff --git a/zip-upstream.patch b/zip-upstream.patch deleted file mode 100644 index 8783350..0000000 --- a/zip-upstream.patch +++ /dev/null @@ -1,196 +0,0 @@ -From e8de7d2a4dbe91a80bb23642eaf07342503f691a Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@remirepo.net> -Date: Tue, 12 Jul 2022 14:37:51 +0200 -Subject: [PATCH 1/3] Support the actual `#[\SensitiveParameter]` attribute in - stubs (for upcoming 8.2.0beta1) - ---- - php81/php_zip.c | 3 --- - php81/php_zip.stub.php | 9 +++------ - php81/php_zip_arginfo.h | 17 +++++++++++++---- - 3 files changed, 16 insertions(+), 13 deletions(-) - -diff --git a/php81/php_zip.c b/php81/php_zip.c -index 0de9189..29a067d 100644 ---- a/php81/php_zip.c -+++ b/php81/php_zip.c -@@ -29,9 +29,6 @@ - #include "zend_attributes.h" - #include "zend_interfaces.h" - #include "php_zip.h" --#if PHP_VERSION_ID < 80200 --#define zend_mark_function_parameter_as_sensitive(a,b,c) --#endif - #include "php_zip_arginfo.h" - - #ifdef HAVE_GLOB -diff --git a/php81/php_zip.stub.php b/php81/php_zip.stub.php -index a0866e1..aa7d783 100644 ---- a/php81/php_zip.stub.php -+++ b/php81/php_zip.stub.php -@@ -83,10 +83,9 @@ class ZipArchive implements Countable - public function open(string $filename, int $flags = 0): bool|int {} - - /** -- * @sensitive-param $password - * @tentative-return-type - */ -- public function setPassword(string $password): bool {} -+ public function setPassword(#[\SensitiveParameter] string $password): bool {} - - /** @tentative-return-type */ - public function close(): bool {} -@@ -227,16 +226,14 @@ class ZipArchive implements Countable - - #ifdef HAVE_ENCRYPTION - /** -- * @sensitive-param $password - * @tentative-return-type - */ -- public function setEncryptionName(string $name, int $method, ?string $password = null): bool {} -+ public function setEncryptionName(string $name, int $method, #[\SensitiveParameter] ?string $password = null): bool {} - - /** -- * @sensitive-param $password - * @tentative-return-type - */ -- public function setEncryptionIndex(int $index, int $method, ?string $password = null): bool {} -+ public function setEncryptionIndex(int $index, int $method, #[\SensitiveParameter] ?string $password = null): bool {} - #endif - - #ifdef HAVE_PROGRESS_CALLBACK -diff --git a/php81/php_zip_arginfo.h b/php81/php_zip_arginfo.h -index 6f00051..a3ec214 100644 ---- a/php81/php_zip_arginfo.h -+++ b/php81/php_zip_arginfo.h -@@ -1,5 +1,5 @@ - /* This is a generated file, edit the .stub.php file instead. -- * Stub hash: f8ec36ea62bfbdb74cfa6472227e08d9282413a2 */ -+ * Stub hash: 9c44d8bcf6b97804d539a9dd566d5faca60074ba */ - - ZEND_BEGIN_ARG_INFO_EX(arginfo_zip_open, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) -@@ -530,12 +530,21 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry - zend_declare_typed_property(class_entry, property_comment_name, &property_comment_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_comment_name); - -- zend_mark_function_parameter_as_sensitive(&class_entry->function_table, "setpassword", 0); -+ -+ zend_string *attribute_name_SensitiveParameter_ZipArchive_setPassword_arg0 = zend_string_init("SensitiveParameter", sizeof("SensitiveParameter") - 1, 1); -+ zend_add_parameter_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "setpassword", sizeof("setpassword") - 1), 0, attribute_name_SensitiveParameter_ZipArchive_setPassword_arg0, 0); -+ zend_string_release(attribute_name_SensitiveParameter_ZipArchive_setPassword_arg0); - #if defined(HAVE_ENCRYPTION) -- zend_mark_function_parameter_as_sensitive(&class_entry->function_table, "setencryptionname", 2); -+ -+ zend_string *attribute_name_SensitiveParameter_ZipArchive_setEncryptionName_arg2 = zend_string_init("SensitiveParameter", sizeof("SensitiveParameter") - 1, 1); -+ zend_add_parameter_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "setencryptionname", sizeof("setencryptionname") - 1), 2, attribute_name_SensitiveParameter_ZipArchive_setEncryptionName_arg2, 0); -+ zend_string_release(attribute_name_SensitiveParameter_ZipArchive_setEncryptionName_arg2); - #endif - #if defined(HAVE_ENCRYPTION) -- zend_mark_function_parameter_as_sensitive(&class_entry->function_table, "setencryptionindex", 2); -+ -+ zend_string *attribute_name_SensitiveParameter_ZipArchive_setEncryptionIndex_arg2 = zend_string_init("SensitiveParameter", sizeof("SensitiveParameter") - 1, 1); -+ zend_add_parameter_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "setencryptionindex", sizeof("setencryptionindex") - 1), 2, attribute_name_SensitiveParameter_ZipArchive_setEncryptionIndex_arg2, 0); -+ zend_string_release(attribute_name_SensitiveParameter_ZipArchive_setEncryptionIndex_arg2); - #endif - - return class_entry; --- -2.35.3 - -From f94c6772a49e5d9860b0abffc32a56a0a33a6216 Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@remirepo.net> -Date: Mon, 18 Jul 2022 12:32:56 +0200 -Subject: [PATCH 2/3] add SensitiveParameter as known string and use it in - arginfo - ---- - php81/php_zip_arginfo.h | 12 +++--------- - 1 file changed, 3 insertions(+), 9 deletions(-) - -diff --git a/php81/php_zip_arginfo.h b/php81/php_zip_arginfo.h -index a3ec214..8fb3bb9 100644 ---- a/php81/php_zip_arginfo.h -+++ b/php81/php_zip_arginfo.h -@@ -531,20 +531,14 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry - zend_string_release(property_comment_name); - - -- zend_string *attribute_name_SensitiveParameter_ZipArchive_setPassword_arg0 = zend_string_init("SensitiveParameter", sizeof("SensitiveParameter") - 1, 1); -- zend_add_parameter_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "setpassword", sizeof("setpassword") - 1), 0, attribute_name_SensitiveParameter_ZipArchive_setPassword_arg0, 0); -- zend_string_release(attribute_name_SensitiveParameter_ZipArchive_setPassword_arg0); -+ zend_add_parameter_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "setpassword", sizeof("setpassword") - 1), 0, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0); - #if defined(HAVE_ENCRYPTION) - -- zend_string *attribute_name_SensitiveParameter_ZipArchive_setEncryptionName_arg2 = zend_string_init("SensitiveParameter", sizeof("SensitiveParameter") - 1, 1); -- zend_add_parameter_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "setencryptionname", sizeof("setencryptionname") - 1), 2, attribute_name_SensitiveParameter_ZipArchive_setEncryptionName_arg2, 0); -- zend_string_release(attribute_name_SensitiveParameter_ZipArchive_setEncryptionName_arg2); -+ zend_add_parameter_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "setencryptionname", sizeof("setencryptionname") - 1), 2, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0); - #endif - #if defined(HAVE_ENCRYPTION) - -- zend_string *attribute_name_SensitiveParameter_ZipArchive_setEncryptionIndex_arg2 = zend_string_init("SensitiveParameter", sizeof("SensitiveParameter") - 1, 1); -- zend_add_parameter_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "setencryptionindex", sizeof("setencryptionindex") - 1), 2, attribute_name_SensitiveParameter_ZipArchive_setEncryptionIndex_arg2, 0); -- zend_string_release(attribute_name_SensitiveParameter_ZipArchive_setEncryptionIndex_arg2); -+ zend_add_parameter_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "setencryptionindex", sizeof("setencryptionindex") - 1), 2, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0); - #endif - - return class_entry; --- -2.35.3 - -From cbaf00ce8f6f5165399d81ff345cc6cc6f8a75d7 Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@remirepo.net> -Date: Wed, 20 Jul 2022 07:29:36 +0200 -Subject: [PATCH 3/3] compat for 8.1 - ---- - php81/php_zip.stub.php | 5 ++++- - php81/php_zip_arginfo.h | 4 +++- - 2 files changed, 7 insertions(+), 2 deletions(-) - -diff --git a/php81/php_zip.stub.php b/php81/php_zip.stub.php -index aa7d783..bab802c 100644 ---- a/php81/php_zip.stub.php -+++ b/php81/php_zip.stub.php -@@ -1,6 +1,9 @@ - <?php - --/** @generate-class-entries */ -+/** -+ * @generate-class-entries -+ * @generate-legacy-arginfo 80100 -+ */ - - /** - * @return resource|int|false -diff --git a/php81/php_zip_arginfo.h b/php81/php_zip_arginfo.h -index 8fb3bb9..da387d6 100644 ---- a/php81/php_zip_arginfo.h -+++ b/php81/php_zip_arginfo.h -@@ -1,5 +1,5 @@ - /* This is a generated file, edit the .stub.php file instead. -- * Stub hash: 9c44d8bcf6b97804d539a9dd566d5faca60074ba */ -+ * Stub hash: e077100efd41822053ca2e1ee6c62c764714e325 */ - - ZEND_BEGIN_ARG_INFO_EX(arginfo_zip_open, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) -@@ -529,6 +529,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry - zend_string *property_comment_name = zend_string_init("comment", sizeof("comment") - 1, 1); - zend_declare_typed_property(class_entry, property_comment_name, &property_comment_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_comment_name); -+#if (PHP_VERSION_ID >= 80200) - - - zend_add_parameter_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "setpassword", sizeof("setpassword") - 1), 0, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0); -@@ -539,6 +540,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry - #if defined(HAVE_ENCRYPTION) - - zend_add_parameter_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "setencryptionindex", sizeof("setencryptionindex") - 1), 2, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0); -+#endif - #endif - - return class_entry; --- -2.35.3 - |