summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2023-09-04 12:02:36 +0200
committerRemi Collet <remi@php.net>2023-09-04 12:02:36 +0200
commite349d92d34ae21199778801afbee394c200a680e (patch)
tree7304abd660404ee6a115a79849bedab04e614da2
parent17d854cb73f61a09d3563c2dea84c083f48d90d8 (diff)
add patch for PHP 8.3 from ammendedHEADmaster
https://github.com/cataphract/php-rar/pull/18 build out of sources tree
-rw-r--r--REFLECTION125
-rw-r--r--php-pecl-rar.spec112
2 files changed, 136 insertions, 101 deletions
diff --git a/REFLECTION b/REFLECTION
index ba9be69..c8cc94d 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,4 +1,4 @@
-Extension [ <persistent> extension #117 rar version 4.2.0 ] {
+Extension [ <persistent> extension #125 rar version 4.2.0 ] {
- Constants [6] {
Constant [ int RAR_HOST_MSDOS ] { 0 }
@@ -14,8 +14,8 @@ Extension [ <persistent> extension #117 rar version 4.2.0 ] {
- Parameters [3] {
Parameter #0 [ <required> $filename ]
- Parameter #1 [ <optional> $password ]
- Parameter #2 [ <optional> $volume_callback ]
+ Parameter #1 [ <optional> $password = <default> ]
+ Parameter #2 [ <optional> $volume_callback = <default> ]
}
}
Function [ <internal:rar> function rar_list ] {
@@ -70,7 +70,7 @@ Extension [ <persistent> extension #117 rar version 4.2.0 ] {
}
- Classes [3] {
- Class [ <internal:rar> <iterateable> final class RarArchive implements Traversable ] {
+ Class [ <internal:rar> <iterateable> final class RarArchive implements Stringable, IteratorAggregate, Traversable ] {
- Constants [0] {
}
@@ -83,8 +83,8 @@ Extension [ <persistent> extension #117 rar version 4.2.0 ] {
- Parameters [3] {
Parameter #0 [ <required> $filename ]
- Parameter #1 [ <optional> $password ]
- Parameter #2 [ <optional> $volume_callback ]
+ Parameter #1 [ <optional> $password = <default> ]
+ Parameter #2 [ <optional> $volume_callback = <default> ]
}
}
}
@@ -92,7 +92,7 @@ Extension [ <persistent> extension #117 rar version 4.2.0 ] {
- Properties [0] {
}
- - Methods [9] {
+ - Methods [10] {
Method [ <internal:rar> public method getEntries ] {
- Parameters [0] {
@@ -137,10 +137,11 @@ Extension [ <persistent> extension #117 rar version 4.2.0 ] {
}
}
- Method [ <internal:rar> public method __toString ] {
+ Method [ <internal:rar, prototype Stringable> public method __toString ] {
- Parameters [0] {
}
+ - Return [ string ]
}
Method [ <internal:rar, ctor> private method __construct ] {
@@ -148,10 +149,17 @@ Extension [ <persistent> extension #117 rar version 4.2.0 ] {
- Parameters [0] {
}
}
+
+ Method [ <internal:rar, prototype IteratorAggregate> public method getIterator ] {
+
+ - Parameters [0] {
+ }
+ - Return [ Traversable ]
+ }
}
}
- Class [ <internal:rar> final class RarEntry ] {
+ Class [ <internal:rar> final class RarEntry implements Stringable ] {
- Constants [46] {
Constant [ public int HOST_MSDOS ] { 0 }
@@ -209,32 +217,33 @@ Extension [ <persistent> extension #117 rar version 4.2.0 ] {
}
- Properties [15] {
- Property [ <default> private $rarfile ]
- Property [ <default> private $position ]
- Property [ <default> private $name ]
- Property [ <default> private $unpacked_size ]
- Property [ <default> private $packed_size ]
- Property [ <default> private $host_os ]
- Property [ <default> private $file_time ]
- Property [ <default> private $crc ]
- Property [ <default> private $attr ]
- Property [ <default> private $version ]
- Property [ <default> private $method ]
- Property [ <default> private $flags ]
- Property [ <default> private $redir_type ]
- Property [ <default> private $redir_to_directory ]
- Property [ <default> private $redir_target ]
+ Property [ private $rarfile = NULL ]
+ Property [ private $position = NULL ]
+ Property [ private $name = NULL ]
+ Property [ private $unpacked_size = NULL ]
+ Property [ private $packed_size = NULL ]
+ Property [ private $host_os = NULL ]
+ Property [ private $file_time = NULL ]
+ Property [ private $crc = NULL ]
+ Property [ private $attr = NULL ]
+ Property [ private $version = NULL ]
+ Property [ private $method = NULL ]
+ Property [ private $flags = NULL ]
+ Property [ private $redir_type = NULL ]
+ Property [ private $redir_to_directory = NULL ]
+ Property [ private $redir_target = NULL ]
}
- Methods [19] {
Method [ <internal:rar> public method extract ] {
- Parameters [4] {
- Parameter #0 [ <required> $path ]
- Parameter #1 [ <optional> $filename ]
- Parameter #2 [ <optional> $password ]
- Parameter #3 [ <optional> $extended_data ]
+ Parameter #0 [ <required> ?string $dir ]
+ Parameter #1 [ <optional> ?string $filepath = '' ]
+ Parameter #2 [ <optional> ?string $password = null ]
+ Parameter #3 [ <optional> bool $extended_data = false ]
}
+ - Return [ bool ]
}
Method [ <internal:rar> public method getPosition ] {
@@ -300,7 +309,7 @@ Extension [ <persistent> extension #117 rar version 4.2.0 ] {
Method [ <internal:rar> public method getStream ] {
- Parameters [1] {
- Parameter #0 [ <optional> $password ]
+ Parameter #0 [ <optional> $password = <default> ]
}
}
@@ -334,10 +343,11 @@ Extension [ <persistent> extension #117 rar version 4.2.0 ] {
}
}
- Method [ <internal:rar> public method __toString ] {
+ Method [ <internal:rar, prototype Stringable> public method __toString ] {
- Parameters [0] {
}
+ - Return [ string ]
}
Method [ <internal:rar, ctor> private method __construct ] {
@@ -348,13 +358,13 @@ Extension [ <persistent> extension #117 rar version 4.2.0 ] {
}
}
- Class [ <internal:rar> final class RarException extends Exception implements Throwable ] {
+ Class [ <internal:rar> final class RarException extends Exception implements Throwable, Stringable ] {
- Constants [0] {
}
- Static properties [1] {
- Property [ public static $usingExceptions ]
+ Property [ public static $usingExceptions = false ]
}
- Static methods [2] {
@@ -373,47 +383,82 @@ Extension [ <persistent> extension #117 rar version 4.2.0 ] {
}
- Properties [4] {
- Property [ <default> protected $message ]
- Property [ <default> protected $code ]
- Property [ <default> protected $file ]
- Property [ <default> protected $line ]
+ Property [ protected $message = '' ]
+ Property [ protected $code = 0 ]
+ Property [ protected string $file = '' ]
+ Property [ protected int $line = 0 ]
}
- Methods [10] {
Method [ <internal:Core, inherits Exception, ctor> public method __construct ] {
- Parameters [3] {
- Parameter #0 [ <optional> $message ]
- Parameter #1 [ <optional> $code ]
- Parameter #2 [ <optional> $previous ]
+ Parameter #0 [ <optional> string $message = "" ]
+ Parameter #1 [ <optional> int $code = 0 ]
+ Parameter #2 [ <optional> ?Throwable $previous = null ]
}
}
Method [ <internal:Core, inherits Exception> public method __wakeup ] {
+
+ - Parameters [0] {
+ }
+ - Tentative return [ void ]
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getMessage ] {
+
+ - Parameters [0] {
+ }
+ - Return [ string ]
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getCode ] {
+
+ - Parameters [0] {
+ }
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getFile ] {
+
+ - Parameters [0] {
+ }
+ - Return [ string ]
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getLine ] {
+
+ - Parameters [0] {
+ }
+ - Return [ int ]
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getTrace ] {
+
+ - Parameters [0] {
+ }
+ - Return [ array ]
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getPrevious ] {
+
+ - Parameters [0] {
+ }
+ - Return [ ?Throwable ]
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getTraceAsString ] {
+
+ - Parameters [0] {
+ }
+ - Return [ string ]
}
- Method [ <internal:Core, inherits Exception, prototype Throwable> public method __toString ] {
+ Method [ <internal:Core, inherits Exception, prototype Stringable> public method __toString ] {
+
+ - Parameters [0] {
+ }
+ - Return [ string ]
}
}
}
diff --git a/php-pecl-rar.spec b/php-pecl-rar.spec
index 669d5c7..ea22e2c 100644
--- a/php-pecl-rar.spec
+++ b/php-pecl-rar.spec
@@ -1,31 +1,37 @@
# spec file for php-pecl-rar
#
-# Copyright (c) 2013-2021 Remi Collet
+# Copyright (c) 2013-2022 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
-%{?scl: %scl_package php-pecl-rar}
+%{?scl:%scl_package php-pecl-rar}
-%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
-%global pecl_name rar
+%bcond_without tests
+
+%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
+%global pecl_name rar
%if "%{php_version}" < "5.6"
-%global ini_name %{pecl_name}.ini
+%global ini_name %{pecl_name}.ini
%else
-%global ini_name 40-%{pecl_name}.ini
+%global ini_name 40-%{pecl_name}.ini
%endif
+%global sources %{pecl_name}-%{version}
+%global _configure ../%{sources}/configure
Summary: PHP extension for reading RAR archives
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: 4.2.0
-Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
-License: PHP and Freeware with further limitations
+Release: 4%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+License: PHP-3.01 and Freeware with further limitations
Group: Development/Languages
URL: https://pecl.php.net/package/%{pecl_name}
-Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+Source0: https://pecl.php.net/get/%{sources}.tgz
Patch0: %{pecl_name}-php81.patch
+Patch1: %{pecl_name}-php82.patch
+Patch2: %{pecl_name}-php83.patch
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
@@ -34,32 +40,11 @@ BuildRequires: %{?scl_prefix}php-pear
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_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
-%if "%{?scl_prefix}" != "%{?sub_prefix}"
-Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
-Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
-%endif
-
-%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
-# Other third party repo stuff
-%if "%{php_version}" > "7.3"
-Obsoletes: php73-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.4"
-Obsoletes: php74-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
%description
@@ -72,15 +57,16 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -q -c
-mv %{pecl_name}-%{version} 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
-%patch0 -p1
+cd %{sources}
+%patch -P0 -p1
+%patch -P1 -p1
+%patch -P2 -p1
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_RAR_VERSION/{s/.* "//;s/".*$//;p}' php_rar.h)
@@ -90,9 +76,9 @@ if test "x${extver}" != "x%{version}%{?prever:-%{prever}}"; then
fi
cd ..
+mkdir NTS
%if %{with_zts}
-# Duplicate source tree for NTS / ZTS build
-cp -pr NTS ZTS
+mkdir ZTS
%endif
# Create configuration file
@@ -105,20 +91,21 @@ EOF
%build
%{?dtsenable}
-cd NTS
-%{_bindir}/phpize
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
%configure \
--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-libdir=%{_lib} \
- --with-php-config=%{_bindir}/zts-php-config
+ --with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -144,7 +131,7 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
# Documentation
for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
do
- install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
+ install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
@@ -169,39 +156,33 @@ fi
%check
+cd %{sources}
+
: Minimal load test for NTS extension
-cd NTS
-%{_bindir}/php --no-php-ini \
- --define extension=modules/%{pecl_name}.so \
- --modules | grep %{pecl_name}
+%{__php} --no-php-ini \
+ --define extension=../NTS/modules/%{pecl_name}.so \
+ --modules | grep '^%{pecl_name}$'
+%if %{with tests}
: Upstream test suite for NTS extension
-TEST_PHP_EXECUTABLE=%{_bindir}/php \
-TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
-NO_INTERACTION=1 \
+TEST_PHP_EXECUTABLE=%{__php} \
+TEST_PHP_ARGS="-n -d extension=$PWD/../NTS/modules/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
-%{_bindir}/php -n run-tests8.php --show-diff
+%{__php} -n run-tests8.php -q --show-diff
+%endif
%if %{with_zts}
: Minimal load test for ZTS extension
-cd ../ZTS
%{__ztsphp} --no-php-ini \
- --define extension=modules/%{pecl_name}.so \
- --modules | grep %{pecl_name}
-
-: Upstream test suite for ZTS extension
-TEST_PHP_EXECUTABLE=%{__ztsphp} \
-TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
-NO_INTERACTION=1 \
-REPORT_EXIT_STATUS=1 \
-%{__ztsphp} -n run-tests8.php --show-diff
+ --define extension=../ZTS/modules/%{pecl_name}.so \
+ --modules | grep '^%{pecl_name}$'
%endif
%files
-%{?_licensedir:%license NTS/LICENSE}
-%{?_licensedir:%license NTS/unrar/LICENSE.txt}
+%{?_licensedir:%license %{sources}/LICENSE}
+%{?_licensedir:%license %{sources}/unrar/LICENSE.txt}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
%config(noreplace) %{php_inidir}/%{ini_name}
@@ -214,6 +195,15 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Mon Sep 4 2023 Remi Collet <remi@remirepo.net> - 4.2.0-4
+- add patch for PHP 8.3 from ammended
+ https://github.com/cataphract/php-rar/pull/18
+- build out of sources tree
+
+* Thu Sep 15 2022 Remi Collet <remi@remirepo.net> - 4.2.0-3
+- add patch for PHP 8.2 from
+ https://github.com/cataphract/php-rar/pull/18
+
* Fri Sep 10 2021 Remi Collet <remi@remirepo.net> - 4.2.0-2
- add upstream patch for PHP 8.1