From 0ecddffc7d6799705a3ebe59f838032b023cf905 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 24 Aug 2023 07:08:21 +0200 Subject: build out of sources tree ignore 1 test failing with recent GM --- php-pecl-gmagick.spec | 104 ++++++++++++++++++-------------------------------- 1 file changed, 38 insertions(+), 66 deletions(-) diff --git a/php-pecl-gmagick.spec b/php-pecl-gmagick.spec index 2c23bda..e72bdfb 100644 --- a/php-pecl-gmagick.spec +++ b/php-pecl-gmagick.spec @@ -1,34 +1,35 @@ # spec file for php-pecl-gmagick # -# Copyright (c) 2010-2021 Remi Collet +# Copyright (c) 2010-2023 Remi Collet # Copyright (c) 2009-2010 Pavel Alexeev # License: MIT # http://opensource.org/licenses/MIT # # Please, preserve the changelog entries # -%if 0%{?scl:1} -%global sub_prefix %{scl_prefix} -%scl_package php-pecl-gmagick -%endif -%bcond_without tests +%{?scl:%scl_package php-pecl-gmagick} + +%bcond_without tests -%global pecl_name gmagick -%global prever RC1 -%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} -%global ini_name 40-%{pecl_name}.ini +%global pecl_name gmagick +%global prever RC1 +%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} +%global ini_name 40-%{pecl_name}.ini %global upstream_version 2.0.6 %global upstream_prever RC1 +%global sources %{pecl_name}-%{upstream_version}%{?upstream_prever} +%global _configure ../%{sources}/configure + Summary: Provides a wrapper to the GraphicsMagick library -Name: %{?sub_prefix}php-pecl-%{pecl_name} +Name: %{?scl_prefix}php-pecl-%{pecl_name} Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} -Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} -License: PHP +Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +License: PHP-3.01 URL: https://pecl.php.net/package/%{pecl_name} -Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz +Source0: https://pecl.php.net/get/%{sources}.tgz Patch0: %{pecl_name}-php81.patch @@ -40,36 +41,15 @@ BuildRequires: GraphicsMagick-devel >= 1.3.17 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 Conflicts: %{?scl_prefix}php-pecl-imagick Conflicts: %{?scl_prefix}php-magickwand -%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 %{pecl_name} is a php extension to create, modify and obtain meta information @@ -80,15 +60,14 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -qc -mv %{pecl_name}-%{upstream_version}%{?upstream_prever} 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 extver=$(sed -n '/#define PHP_GMAGICK_VERSION/{s/.* "//;s/".*$//;p}' php_gmagick.h) if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then @@ -103,24 +82,25 @@ cat >%{ini_name} << 'EOF' extension=%{pecl_name}.so EOF +mkdir NTS %if %{with_zts} -# Duplicate build tree for nts/zts -cp -r NTS ZTS +mkdir ZTS %endif %build %{?dtsenable} -cd NTS -%{_bindir}/phpize -%{configure} --with-%{pecl_name} --with-php-config=%{_bindir}/php-config +cd %{sources} +%{__phpize} + +cd ../NTS +%{configure} --with-%{pecl_name} --with-php-config=%{__phpconfig} make %{?_smp_mflags} %if %{with_zts} cd ../ZTS -%{_bindir}/zts-phpize -%{configure} --with-%{pecl_name} --with-php-config=%{_bindir}/zts-php-config +%{configure} --with-%{pecl_name} --with-php-config=%{__ztsphpconfig} make %{?_smp_mflags} %endif @@ -143,7 +123,7 @@ install -D -m 664 %{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 +do install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i done @@ -168,24 +148,14 @@ fi %check +cd %{sources} # Workaround for old libgomp, ensure single thread is used export OMP_NUM_THREADS=1 -rm ?TS/tests/gmagick-056-set_getsamplingfactors.phpt - -%if 0%{?fedora} == 31 -# see https://bugzilla.redhat.com/1530057 (F31 with 1.3.34) -rm ?TS/tests/bug71626.phpt -rm ?TS/tests/gmagick-006-annotateimage.phpt -rm ?TS/tests/gmagickdraw-003-annotate.phpt -rm ?TS/tests/gmagickdraw_038_setFontStretch_basic.phpt -rm ?TS/tests/gmagickdraw_042_setTextAntialias_basic.phpt -rm ?TS/tests/gmagickdraw_044_setTextUnderColor_basic.phpt -rm ?TS/tests/gmagickdraw_045_setFontFamily_basic.phpt -%endif +rm tests/gmagick-056-set_getsamplingfactors.phpt +rm tests/gmagickdraw_036_pushPattern_basic.phpt : simple module load test for NTS extension -cd NTS %{__php} --no-php-ini \ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ --modules | grep '^%{pecl_name}$' @@ -194,14 +164,12 @@ cd NTS : upstream test suite for NTS extension export TEST_PHP_EXECUTABLE=%{__php} export REPORT_EXIT_STATUS=1 -export NO_INTERACTION=1 -export TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" -%{__php} -n run-tests.php --show-diff +export TEST_PHP_ARGS="-n -d extension=$PWD/../NTS/modules/%{pecl_name}.so" +%{__php} -n run-tests.php -q --show-diff %endif %if %{with_zts} : simple module load test for ZTS extension -cd ../ZTS %{__ztsphp} --no-php-ini \ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ --modules | grep '^%{pecl_name}$' @@ -209,14 +177,14 @@ cd ../ZTS %if %{with tests} : upstream test suite for ZTS extension export TEST_PHP_EXECUTABLE=%{__ztsphp} -export TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" -%{__ztsphp} -n run-tests.php --show-diff +export TEST_PHP_ARGS="-n -d extension=$PWD/../ZTS/modules/%{pecl_name}.so" +%{__ztsphp} -n run-tests.php -q --show-diff %endif %endif %files -%{?_licensedir:%license NTS/LICENSE} +%{?_licensedir:%license %{sources}/LICENSE} %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -230,6 +198,10 @@ export TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" %changelog +* Thu Aug 24 2023 Remi Collet - 2.0.6~RC1-4 +- build out of sources tree +- ignore 1 test failing with recent GM + * Wed Sep 01 2021 Remi Collet - 2.0.6~RC1-3 - rebuild for 8.1.0RC1 -- cgit