summaryrefslogtreecommitdiffstats
path: root/php-pecl-mailparse.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-mailparse.spec')
-rw-r--r--php-pecl-mailparse.spec57
1 files changed, 29 insertions, 28 deletions
diff --git a/php-pecl-mailparse.spec b/php-pecl-mailparse.spec
index ad6d566..25eb483 100644
--- a/php-pecl-mailparse.spec
+++ b/php-pecl-mailparse.spec
@@ -19,19 +19,19 @@
%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: %{?scl_prefix}php-pecl-mailparse
-Version: 3.1.4
-Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Version: 3.1.5
+Release: 1%{?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}-php83.patch
+Source0: https://pecl.php.net/get/%{sources}.tgz
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
@@ -47,7 +47,6 @@ 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}
@@ -65,16 +64,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
-%patch -P0 -p1 -b.php83
-
+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}.
@@ -90,23 +85,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
@@ -129,11 +126,13 @@ 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 \
@@ -142,11 +141,10 @@ done
%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
@@ -159,11 +157,10 @@ TEST_PHP_EXECUTABLE=%{__php} \
%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
@@ -190,7 +187,7 @@ fi
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -204,6 +201,10 @@ fi
%changelog
+* 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