summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--0001-use-zend_str_tolower-instead-of-php_strtolower.patch29
-rw-r--r--php-pecl-mailparse.spec45
2 files changed, 46 insertions, 28 deletions
diff --git a/0001-use-zend_str_tolower-instead-of-php_strtolower.patch b/0001-use-zend_str_tolower-instead-of-php_strtolower.patch
new file mode 100644
index 0000000..2c7b5e8
--- /dev/null
+++ b/0001-use-zend_str_tolower-instead-of-php_strtolower.patch
@@ -0,0 +1,29 @@
+From 56c80d21dc57cae955c496d7b4bc1f3c388788df Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@php.net>
+Date: Wed, 25 Sep 2024 15:20:25 +0200
+Subject: [PATCH] use zend_str_tolower instead of php_strtolower
+
+---
+ package.xml | 2 +-
+ php_mailparse_rfc822.c | 4 ++++
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/php_mailparse_rfc822.c b/php_mailparse_rfc822.c
+index 3be2915..3ad872c 100644
+--- a/php_mailparse_rfc822.c
++++ b/php_mailparse_rfc822.c
+@@ -428,7 +428,11 @@ PHP_MAILPARSE_API char *php_rfc822_recombine_tokens(php_rfc822_tokenized_t *toks
+ ret[len] = 0;
+
+ if (flags & PHP_RFC822_RECOMBINE_STRTOLOWER)
++#if PHP_VERSION_ID < 80400
+ php_strtolower(ret, len);
++#else
++ zend_str_tolower(ret, len);
++#endif
+
+ return ret;
+ }
+--
+2.46.1
+
diff --git a/php-pecl-mailparse.spec b/php-pecl-mailparse.spec
index d6f0602..859c239 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-2023 Remi Collet
+# Copyright (c) 2008-2024 Remi Collet
# Copyright (c) 2004-2007 Matthias Saou
#
# License: MIT
@@ -25,11 +25,13 @@
Summary: PHP PECL package for parsing and working with email messages
Name: %{?scl_prefix}php-pecl-mailparse
Version: 3.1.6
-Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 3%{?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/%{sources}.tgz
+Patch0: 0001-use-zend_str_tolower-instead-of-php_strtolower.patch
+
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel >= 7.3
@@ -63,10 +65,12 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
# 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 %{sources}
+%patch -P0 -p1
+
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}.
@@ -93,27 +97,29 @@ mkdir ZTS
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=%{__phpconfig}
-make %{?_smp_mflags}
+%make_build
%if %{with_zts}
cd ../ZTS
%configure --with-php-config=%{__ztsphpconfig}
-make %{?_smp_mflags}
+%make_build
%endif
%install
%{?dtsenable}
-make -C NTS install INSTALL_ROOT=%{buildroot}
+%make_install -C NTS
# Drop in the bit of configuration
install -Dpm 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
%if %{with_zts}
-make -C ZTS install INSTALL_ROOT=%{buildroot}
+%make_install -C ZTS
# Drop in the bit of configuration
install -Dpm 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
@@ -163,28 +169,8 @@ TEST_PHP_EXECUTABLE=%{__ztsphp} \
%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 %{sources}/LICENSE}
+%license %{sources}/LICENSE
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -198,6 +184,9 @@ fi
%changelog
+* Wed Sep 25 2024 Remi Collet <remi@remirepo.net> - 3.1.6-3
+- add upstream patch for PHP 8.4
+
* Wed Aug 30 2023 Remi Collet <remi@remirepo.net> - 3.1.6-2
- rebuild for PHP 8.3.0RC1