summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--PHPINFO2
-rw-r--r--REFLECTION23
-rw-r--r--mailparse-php81.patch112
-rw-r--r--php-pecl-mailparse.spec118
4 files changed, 73 insertions, 182 deletions
diff --git a/PHPINFO b/PHPINFO
index a1643d3..0f1d80c 100644
--- a/PHPINFO
+++ b/PHPINFO
@@ -2,7 +2,7 @@
mailparse
mailparse support => enabled
-Extension Version => 3.1.1
+Extension Version => 3.1.6
Directive => Local Value => Master Value
mailparse.def_charset => us-ascii => us-ascii
diff --git a/REFLECTION b/REFLECTION
index 47e8b62..a3a7e67 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,4 +1,4 @@
-Extension [ <persistent> extension #84 mailparse version 3.1.1 ] {
+Extension [ <persistent> extension #84 mailparse version 3.1.6 ] {
- Dependencies {
Dependency [ mbstring (Required) ]
@@ -47,7 +47,7 @@ Extension [ <persistent> extension #84 mailparse version 3.1.1 ] {
- Parameters [3] {
Parameter #0 [ <required> $fp ]
Parameter #1 [ <required> $msgbody ]
- Parameter #2 [ <optional> $callback ]
+ Parameter #2 [ <optional> $callback = <default> ]
}
}
Function [ <internal:mailparse> function mailparse_msg_extract_part_file ] {
@@ -55,7 +55,7 @@ Extension [ <persistent> extension #84 mailparse version 3.1.1 ] {
- Parameters [3] {
Parameter #0 [ <required> $fp ]
Parameter #1 [ <required> $filename ]
- Parameter #2 [ <optional> $callback ]
+ Parameter #2 [ <optional> $callback = <default> ]
}
}
Function [ <internal:mailparse> function mailparse_msg_extract_whole_part_file ] {
@@ -63,7 +63,7 @@ Extension [ <persistent> extension #84 mailparse version 3.1.1 ] {
- Parameters [3] {
Parameter #0 [ <required> $fp ]
Parameter #1 [ <required> $filename ]
- Parameter #2 [ <optional> $callback ]
+ Parameter #2 [ <optional> $callback = <default> ]
}
}
Function [ <internal:mailparse> function mailparse_msg_create ] {
@@ -130,7 +130,8 @@ Extension [ <persistent> extension #84 mailparse version 3.1.1 ] {
- Static methods [0] {
}
- - Properties [0] {
+ - Properties [1] {
+ Property [ public $data = NULL ]
}
- Methods [10] {
@@ -164,16 +165,16 @@ Extension [ <persistent> extension #84 mailparse version 3.1.1 ] {
Method [ <internal:mailparse> public method extract_headers ] {
- Parameters [2] {
- Parameter #0 [ <optional> $mode ]
- Parameter #1 [ <optional> $arg ]
+ Parameter #0 [ <optional> $mode = <default> ]
+ Parameter #1 [ <optional> $arg = <default> ]
}
}
Method [ <internal:mailparse> public method extract_body ] {
- Parameters [2] {
- Parameter #0 [ <optional> $mode ]
- Parameter #1 [ <optional> $arg ]
+ Parameter #0 [ <optional> $mode = <default> ]
+ Parameter #1 [ <optional> $arg = <default> ]
}
}
@@ -187,8 +188,8 @@ Extension [ <persistent> extension #84 mailparse version 3.1.1 ] {
- Parameters [3] {
Parameter #0 [ <required> $index ]
- Parameter #1 [ <optional> $mode ]
- Parameter #2 [ <optional> $arg ]
+ Parameter #1 [ <optional> $mode = <default> ]
+ Parameter #2 [ <optional> $arg = <default> ]
}
}
diff --git a/mailparse-php81.patch b/mailparse-php81.patch
deleted file mode 100644
index a0d1a2a..0000000
--- a/mailparse-php81.patch
+++ /dev/null
@@ -1,112 +0,0 @@
-From ae960dba8cb607296b7f85ca23f9d0a2462607d5 Mon Sep 17 00:00:00 2001
-From: Remi Collet <remi@php.net>
-Date: Tue, 8 Jun 2021 08:00:37 +0200
-Subject: [PATCH] fix for 8.1
-
----
- mailparse.c | 29 ++++++++++++++++++++++++++++-
- package.xml | 2 +-
- 2 files changed, 29 insertions(+), 2 deletions(-)
-
-diff --git a/mailparse.c b/mailparse.c
-index 104ab38..d4b0804 100644
---- a/mailparse.c
-+++ b/mailparse.c
-@@ -413,7 +413,11 @@ static void mailparse_mimemessage_extract(int flags, INTERNAL_FUNCTION_PARAMETER
-
-
- if (part->source.kind == mpSTRING)
-+#if PHP_VERSION_ID < 80100
- srcstream = php_stream_memory_open(TEMP_STREAM_READONLY, Z_STRVAL_P(&part->source.zval), Z_STRLEN_P(&part->source.zval));
-+#else
-+ srcstream = php_stream_memory_open(TEMP_STREAM_READONLY, Z_STR(part->source.zval));
-+#endif
- else
- php_stream_from_zval(srcstream, &part->source.zval);
-
-@@ -430,11 +434,15 @@ static void mailparse_mimemessage_extract(int flags, INTERNAL_FUNCTION_PARAMETER
- if (SUCCESS == extract_part(part, flags, srcstream, callback_data, callback)) {
-
- if (mode == MAILPARSE_EXTRACT_RETURN) {
-+#if PHP_VERSION_ID < 80100
- size_t len;
- char *buf;
-
- buf = php_stream_memory_get_buffer(deststream, &len);
- RETVAL_STRINGL(buf, len);
-+#else
-+ RETVAL_STR(php_stream_memory_get_buffer(deststream));
-+#endif
- } else {
- RETVAL_TRUE;
- }
-@@ -502,7 +510,11 @@ PHP_METHOD(mimemessage, extract_uue)
- }
-
- if (part->source.kind == mpSTRING)
-+#if PHP_VERSION_ID < 80100
- srcstream = php_stream_memory_open(TEMP_STREAM_READONLY, Z_STRVAL_P(&part->source.zval), Z_STRLEN_P(&part->source.zval));
-+#else
-+ srcstream = php_stream_memory_open(TEMP_STREAM_READONLY, Z_STR(part->source.zval));
-+#endif
- else
- php_stream_from_zval(srcstream, &part->source.zval);
-
-@@ -535,11 +547,15 @@ PHP_METHOD(mimemessage, extract_uue)
- if (nparts == index) {
- mailparse_do_uudecode(srcstream, deststream);
- if (mode == MAILPARSE_EXTRACT_RETURN) {
-+#if PHP_VERSION_ID < 80100
- size_t len;
- char *buf;
-
- buf = php_stream_memory_get_buffer(deststream, &len);
- RETVAL_STRINGL(buf, len);
-+#else
-+ RETVAL_STR(php_stream_memory_get_buffer(deststream));
-+#endif
- } else {
- RETVAL_TRUE;
- }
-@@ -584,7 +600,11 @@ PHP_METHOD(mimemessage, enum_uue)
- return;
-
- if (part->source.kind == mpSTRING)
-+#if PHP_VERSION_ID < 80100
- instream = php_stream_memory_open(TEMP_STREAM_READONLY, Z_STRVAL_P(&part->source.zval), Z_STRLEN_P(&part->source.zval));
-+#else
-+ instream = php_stream_memory_open(TEMP_STREAM_READONLY, Z_STR(part->source.zval));
-+#endif
- else
- php_stream_from_zval(instream, &part->source.zval);
-
-@@ -1308,7 +1328,11 @@ static void mailparse_do_extract(INTERNAL_FUNCTION_PARAMETERS, int decode, int i
- close_src_stream = 1;
- } else {
- /* filename is the actual data */
-+#if PHP_VERSION_ID < 80100
- srcstream = php_stream_memory_open(TEMP_STREAM_READONLY, Z_STRVAL_P(filename), Z_STRLEN_P(filename));
-+#else
-+ srcstream = php_stream_memory_open(TEMP_STREAM_READONLY, Z_STR_P(filename));
-+#endif
- close_src_stream = 1;
- }
-
-@@ -1339,12 +1363,15 @@ static void mailparse_do_extract(INTERNAL_FUNCTION_PARAMETERS, int decode, int i
- if (SUCCESS == extract_part(part, decode, srcstream, cbdata, cbfunc)) {
-
- if (deststream != NULL) {
-+#if PHP_VERSION_ID < 80100
- /* return it's contents as a string */
- char *membuf = NULL;
- size_t memlen = 0;
- membuf = php_stream_memory_get_buffer(deststream, &memlen);
- RETVAL_STRINGL(membuf, memlen);
--
-+#else
-+ RETVAL_STR(php_stream_memory_get_buffer(deststream));
-+#endif
- } else {
- RETVAL_TRUE;
- }
-
diff --git a/php-pecl-mailparse.spec b/php-pecl-mailparse.spec
index 1cd426a..d6f0602 100644
--- a/php-pecl-mailparse.spec
+++ b/php-pecl-mailparse.spec
@@ -3,7 +3,7 @@
#
# Fedora spec file for php-pecl-mailparse
#
-# Copyright (c) 2008-2021 Remi Collet
+# Copyright (c) 2008-2023 Remi Collet
# Copyright (c) 2004-2007 Matthias Saou
#
# License: MIT
@@ -12,31 +12,27 @@
# Please, preserve the changelog entries
#
-# we don't want -z defs linker flag
-%undefine _strict_symbol_defs_build
+%{?scl:%scl_package php-pecl-mailparse}
-%if 0%{?scl:1}
-%global sub_prefix %{scl_prefix}
-%scl_package php-pecl-mailparse
-%endif
+%bcond_without tests
-%global pecl_name mailparse
-%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
-%global ini_name 40-%{pecl_name}.ini
+%global pecl_name mailparse
+%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
+%global ini_name 40-%{pecl_name}.ini
+%global sources %{pecl_name}-%{version}
+%global _configure ../%{sources}/configure
Summary: PHP PECL package for parsing and working with email messages
-Name: %{?sub_prefix}php-pecl-mailparse
-Version: 3.1.1
-Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
-License: PHP
+Name: %{?scl_prefix}php-pecl-mailparse
+Version: 3.1.6
+Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+License: PHP-3.01
URL: https://pecl.php.net/package/mailparse
-Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz
-
-Patch0: %{pecl_name}-php81.patch
+Source0: https://pecl.php.net/get/%{sources}.tgz
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
-BuildRequires: %{?scl_prefix}php-devel >= 7.0
+BuildRequires: %{?scl_prefix}php-devel >= 7.3
BuildRequires: %{?scl_prefix}php-pear
BuildRequires: %{?scl_prefix}php-mbstring
# Required by phpize
@@ -48,32 +44,11 @@ BuildRequires: autoconf, automake, libtool
Requires: %{?scl_prefix}php-mbstring%{?_isa}
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
@@ -86,16 +61,12 @@ 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 -b .php81
-
+cd %{sources}
extver=$(sed -n '/#define PHP_MAILPARSE_VERSION/{s/.* "//;s/".*$//;p}' php_mailparse.h)
if test "x${extver}" != "x%{version}"; then
: Error: Upstream version is ${extver}, expecting %{version}.
@@ -111,23 +82,25 @@ extension = mailparse.so
;mailparse.def_charset = us-ascii
EOF
+mkdir NTS
%if %{with_zts}
-cp -pr NTS ZTS
+mkdir ZTS
%endif
%build
%{?dtsenable}
-cd NTS
-%{_bindir}/phpize
-%configure --with-php-config=%{_bindir}/php-config
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
+%configure --with-php-config=%{__phpconfig}
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
-%configure --with-php-config=%{_bindir}/zts-php-config
+%configure --with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -150,24 +123,27 @@ install -Dpm 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
# 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
+do install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
%check
+cd %{sources}
+
: Minimal load test for NTS extension
%{__php} --no-php-ini \
--define extension=mbstring.so \
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
--modules | grep '^%{pecl_name}$'
+%if %{with tests}
: Upstream test suite for NTS extension
-cd NTS
TEST_PHP_EXECUTABLE=%{__php} \
-%{__php} run-tests.php -n -q \
+%{__php} -n run-tests.php -n -q \
-d extension=mbstring.so \
- -d extension=$PWD/modules/%{pecl_name}.so \
+ -d extension=$PWD/../NTS/modules/%{pecl_name}.so \
--show-diff
+%endif
%if %{with_zts}
: Minimal load test for ZTS extension
@@ -176,14 +152,15 @@ TEST_PHP_EXECUTABLE=%{__php} \
--define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
--modules | grep '^%{pecl_name}$'
+%if %{with tests}
: Upstream test suite for ZTS extension
-cd ../ZTS
TEST_PHP_EXECUTABLE=%{__ztsphp} \
-php run-tests.php -n -q \
+%{__ztsphp} -n run-tests.php -n -q \
-d extension=mbstring.so \
- -d extension=$PWD/modules/%{pecl_name}.so \
+ -d extension=$PWD/../ZTS/modules/%{pecl_name}.so \
--show-diff
%endif
+%endif
%if 0%{?fedora} < 24 && 0%{?rhel} < 8
@@ -207,7 +184,7 @@ fi
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -221,6 +198,31 @@ fi
%changelog
+* Wed Aug 30 2023 Remi Collet <remi@remirepo.net> - 3.1.6-2
+- rebuild for PHP 8.3.0RC1
+
+* Tue Aug 22 2023 Remi Collet <remi@remirepo.net> - 3.1.6-1
+- update to 3.1.6
+
+* Thu Jul 27 2023 Remi Collet <remi@remirepo.net> - 3.1.5-1
+- update to 3.1.5
+- build out of sources tree
+
+* Tue Jun 6 2023 Remi Collet <remi@remirepo.net> - 3.1.4-2
+- add upstream patches for PHP 8.3
+
+* Thu Sep 15 2022 Remi Collet <remi@remirepo.net> - 3.1.4-1
+- update to 3.1.4
+
+* Tue May 24 2022 Remi Collet <remi@remirepo.net> - 3.1.3-2
+- add upstream patch for PHP 8.2
+
+* Mon Feb 21 2022 Remi Collet <remi@remirepo.net> - 3.1.3-1
+- update to 3.1.3
+
+* Wed Sep 1 2021 Remi Collet <remi@remirepo.net> - 3.1.2-1
+- update to 3.1.2
+
* Wed Sep 01 2021 Remi Collet <remi@remirepo.net> - 3.1.1-4
- rebuild for 8.1.0RC1