diff options
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | PHPINFO | 4 | ||||
| -rw-r--r-- | REFLECTION | 56 | ||||
| -rw-r--r-- | composer.json | 40 | ||||
| -rw-r--r-- | php-xz.spec | 132 |
5 files changed, 148 insertions, 86 deletions
@@ -1,4 +1,4 @@ SRCDIR := $(shell pwd) NAME := $(shell basename $(SRCDIR)) -include ../../common/Makefile +include ../../../common/Makefile @@ -2,8 +2,8 @@ xz xz support => enabled -xz extension version => 1.1.2 -liblzma version => 5.2.5 +xz extension version => 1.2.0 +liblzma version => 5.8.1 Directive => Local Value => Master Value xz.compression_level => 5 => 5 @@ -1,4 +1,4 @@ -Extension [ <persistent> extension #108 xz version 1.1.2 ] { +Extension [ <persistent> extension #130 xz version 1.2.0 ] { - INI { Entry [ xz.compression_level <ALL> ] @@ -10,52 +10,60 @@ Extension [ <persistent> extension #108 xz version 1.1.2 ] { } - Functions { - Function [ <internal:xz> function xzdecode ] { + Function [ <internal:xz> function xzread ] { - - Parameters [1] { - Parameter #0 [ <required> $str ] + - Parameters [2] { + Parameter #0 [ <required> resource $fp ] + Parameter #1 [ <optional> ?int $length = <default> ] } + - Return [ string|false ] } - Function [ <internal:xz> function xzopen ] { + Function [ <internal:xz> function xzwrite ] { - Parameters [3] { - Parameter #0 [ <required> $filename ] - Parameter #1 [ <required> $mode ] - Parameter #2 [ <optional> $compression_level ] + Parameter #0 [ <required> resource $fp ] + Parameter #1 [ <required> string $str ] + Parameter #2 [ <optional> ?int $length = <default> ] } + - Return [ int|false ] } - Function [ <internal:xz> function xzencode ] { + Function [ <internal:xz> function xzclose ] { - Parameters [1] { - Parameter #0 [ <required> $str ] + Parameter #0 [ <required> resource $fp ] } + - Return [ bool ] } - Function [ <internal:xz> function xzread ] { + Function [ <internal:xz> function xzpassthru ] { - - Parameters [2] { - Parameter #0 [ <required> $fp ] - Parameter #1 [ <required> $length ] + - Parameters [1] { + Parameter #0 [ <required> resource $fp ] } + - Return [ int|false ] } - Function [ <internal:xz> function xzwrite ] { + Function [ <internal:xz> function xzencode ] { - - Parameters [3] { - Parameter #0 [ <required> $fp ] - Parameter #1 [ <required> $str ] - Parameter #2 [ <optional> $length ] + - Parameters [2] { + Parameter #0 [ <required> string $str ] + Parameter #1 [ <optional> ?int $compression_level = null ] } + - Return [ string|false ] } - Function [ <internal:xz> function xzclose ] { + Function [ <internal:xz> function xzdecode ] { - Parameters [1] { - Parameter #0 [ <required> $fp ] + Parameter #0 [ <required> string $str ] } + - Return [ string|false ] } - Function [ <internal:xz> function xzpassthru ] { + Function [ <internal:xz> function xzopen ] { - - Parameters [1] { - Parameter #0 [ <required> $fp ] + - Parameters [3] { + Parameter #0 [ <required> string $filename ] + Parameter #1 [ <required> string $mode ] + Parameter #2 [ <optional> int $compression_level = <default> ] } + - Return [ resource|false ] } } } diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..4284dbe --- /dev/null +++ b/composer.json @@ -0,0 +1,40 @@ +{ + "$schema": "https://getcomposer.org/schema.json", + "name": "mateuszanella/php-ext-xz", + "description": "A PHP Extension providing xz (LZMA2) compression/decompression via PHP streams.", + "keywords": ["php-extension", "xz", "lzma2"], + "license": "PHP-3.01", + "type": "php-ext", + "php-ext": { + "extension-name": "xz", + "priority": 99 + }, + "authors": [ + { + "name": "deniyuda348" + }, + { + "name": "udan11", + "homepage": "https://github.com/udan11/php-xz" + }, + { + "name": "smiley", + "email": "smiley@chillerlan.net", + "homepage": "https://github.com/codemasher/php-ext-xz" + }, + { + "name": "mateuszanella", + "email": "mateusblk1@gmail.com", + "homepage": "https://github.com/mateuszanella" + }, + { + "name": "Contributors", + "homepage":"https://github.com/mateuszanella/php-ext-xz/graphs/contributors" + } + ], + "homepage": "https://github.com/mateuszanella/php-ext-xz", + "support": { + "issues": "https://github.com/mateuszanella/php-ext-xz/issues", + "source": "https://github.com/mateuszanella/php-ext-xz" + } +} diff --git a/php-xz.spec b/php-xz.spec index 9bc26d8..b558d2f 100644 --- a/php-xz.spec +++ b/php-xz.spec @@ -1,36 +1,42 @@ # remirepo spec file for php-xz # -# Copyright (c) 2021 Remi Collet -# License: CC-BY-SA -# http://creativecommons.org/licenses/by-sa/4.0/ +# SPDX-FileCopyrightText: Copyright 2021-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-xz} -%if 0%{?scl:1} -%scl_package php-xz -%else -%global pkg_name %{name} -%endif +%bcond_without tests -%global gh_commit be72e636dd7dd8a220cb9b54f2970477dad878a0 -%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) -%global gh_owner codemasher +# Forge +#global gh_commit 87e7986fe109e78a9ccdb5170a377ad6abf66bfb +%global gh_owner mateuszanella %global gh_project php-ext-xz +%global forgeurl https://github.com/%{gh_owner}/%{gh_project} +%global tag v%{version} +# for EL-8 to avoid TAG usage +%global archivename %{gh_project}-%{version} +# PIE +%global pie_vend mateuszanella +%global pie_proj php-ext-xz +# Extension %global pecl_name xz %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global ini_name 40-%{pecl_name}.ini +%global sources %{gh_project}-%{version} +%global _configure ../%{sources}/configure Summary: XZ (LZMA2) compression/decompression Name: %{?scl_prefix}php-%{pecl_name} -Version: 1.1.2 -Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} -License: PHP -URL: https://github.com/%{gh_owner}/%{gh_project} -Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz +Version: 1.2.0 +%forgemeta +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +License: PHP-3.01 +URL: %{forgeurl} +Source0: %{forgesource} BuildRequires: make BuildRequires: %{?dtsprefix}gcc @@ -39,22 +45,9 @@ BuildRequires: pkgconfig(liblzma) Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} -%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} -%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} -%if "%{php_version}" > "7.3" -Obsoletes: php73-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "7.4" -Obsoletes: php74-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "8.0" -Obsoletes: php80-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "8.1" -Obsoletes: php81-%{pecl_name} <= %{version} -%endif -%endif +Provides: %{?scl_prefix}php-pie(%{pie_vend}/%{pie_proj}) = %{version} +Provides: %{?scl_prefix}php-%{pie_vend}-%{pie_proj} = %{version} %description @@ -65,10 +58,10 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -qc -mv %{gh_project}-%{gh_commit} NTS -cd NTS -mv LICENSE.txt LICENSE +cd %{sources} + +sed -e '/PHP_XZ_VERSION/s/1.1.2/%{version}/' -i php_xz.h # Sanity check, really often broken extver=$(sed -n '/#define PHP_XZ_VERSION/{s/.* "//;s/".*$//;p}' php_xz.h) @@ -78,9 +71,9 @@ if test "x${extver}" != "x%{version}%{?gh_date:-dev}"; then fi cd .. +mkdir NTS %if %{with_zts} -# duplicate for ZTS build -cp -pr NTS ZTS +mkdir ZTS %endif # Drop in the bit of configuration @@ -97,22 +90,27 @@ EOF %build %{?dtsenable} -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-php-config=%{_bindir}/php-config \ + --with-php-config=%{__phpconfig} \ --with-libdir=%{_lib} \ --with-xz -make %{?_smp_mflags} + +%make_build %if %{with_zts} cd ../ZTS -%{_bindir}/zts-phpize %configure \ - --with-php-config=%{_bindir}/zts-php-config \ + --with-php-config=%{__ztsphpconfig} \ --with-libdir=%{_lib} \ --with-xz -make %{?_smp_mflags} + +%make_build %endif @@ -120,49 +118,44 @@ make %{?_smp_mflags} %{?dtsenable} # Install the NTS stuff -make -C NTS install INSTALL_ROOT=%{buildroot} +%make_install -C NTS install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} %if %{with_zts} # Install the ZTS stuff -make -C ZTS install INSTALL_ROOT=%{buildroot} +%make_install -C ZTS install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif - %check -cd NTS +cd %{sources} + : Minimal load test for NTS extension %{__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_EXECUTABLE=%{__php} \ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \ REPORT_EXIT_STATUS=1 \ %{__php} -n run-tests.php -q -x --offline --show-diff +%endif %if %{with_zts} -cd ../ZTS : Minimal load test for ZTS extension %{__ztsphp} --no-php-ini \ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ --modules | grep '^%{pecl_name}$' - -: Upstream test suite for ZTS extension -TEST_PHP_EXECUTABLE=%{__ztsphp} \ -TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \ -REPORT_EXIT_STATUS=1 \ -%{__ztsphp} -n run-tests.php -q -x --offline --show-diff %endif %files -%{!?_licensedir:%global license %%doc} -%license NTS/LICENSE -%doc NTS/README.md +%license %{sources}/LICENSE +%doc %{sources}/README.md +%doc %{sources}/composer.json %config(noreplace) %{php_inidir}/%{ini_name} %{php_extdir}/%{pecl_name}.so @@ -174,6 +167,27 @@ REPORT_EXIT_STATUS=1 \ %changelog +* Fri Sep 26 2025 Remi Collet <remi@remirepo.net> - 1.2.0-1 +- update to 1.2.0 + +* Thu Sep 25 2025 Remi Collet <remi@remirepo.net> - 1.1.5-1 +- update to 1.1.5 (no change) +- switch to mateuszanella/php-ext-xz + +* Mon Sep 15 2025 Remi Collet <remi@remirepo.net> - 1.1.4-1 +- update to 1.1.4 (no change) +- drop patch merged upstream + +* Sat Sep 13 2025 Remi Collet <remi@remirepo.net> - 1.1.3-1 +- update to 1.1.3 +- re-license spec file to CECILL-2.1 +- add pie virtual provides +- open https://github.com/codemasher/php-ext-xz/pull/12 fix ext version +- open https://github.com/codemasher/php-ext-xz/pull/11 fix license version + +* Mon Sep 4 2023 Remi Collet <remi@remirepo.net> - 1.1.2-3 +- build out of sources tree + * Wed Sep 01 2021 Remi Collet <remi@remirepo.net> - 1.1.2-2 - rebuild for 8.1.0RC1 |
