summaryrefslogtreecommitdiffstats
path: root/php-pecl-imagick.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-imagick.spec')
-rw-r--r--php-pecl-imagick.spec99
1 files changed, 67 insertions, 32 deletions
diff --git a/php-pecl-imagick.spec b/php-pecl-imagick.spec
index 332b139..0811cdd 100644
--- a/php-pecl-imagick.spec
+++ b/php-pecl-imagick.spec
@@ -1,15 +1,24 @@
# remirepo spec file for php-pecl-imagick
#
-# Copyright (c) 2008-2022 Remi Collet
-# License: CC-BY-SA
+# Copyright (c) 2008-2024 Remi Collet
+# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
+%bcond_without tests
+
+# Distribution default IM version
+%if 0%{?fedora} >= 38 || 0%{?rhel} >= 10
+%global default 7
%bcond_with im6
%bcond_with im7
-%bcond_without tests
+%else
+%global default 6
+%bcond_with im6
+%bcond_with im7
+%endif
# 2 builds needed to get the full set
# --with im6
@@ -19,7 +28,9 @@
%undefine _strict_symbol_defs_build
%if 0%{?scl:1}
-%scl_package php-pecl-imagick
+%scl_package php-pecl-imagick
+%else
+%global _root_prefix %{_prefix}
%endif
%global gh_commit 623a3ac0386c93d62c60cbfe610505f2e35780f3
@@ -36,6 +47,12 @@
%endif
%global upstream_version 3.7.0
#global upstream_prever RC1
+%if 0%{?gh_date:1}
+%global sources %{gh_project}-%{gh_commit}
+%else
+%global sources %{pecl_name}-%{upstream_version}%{?upstream_prever}
+%endif
+%global _configure ../%{sources}/configure
%if %{with im7}
Summary: Extension to create and modify images using ImageMagick 7
@@ -46,15 +63,17 @@ Name: %{?scl_prefix}php-pecl-imagick-im6
%endif
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
%if 0%{?gh_date}
-Release: 0.10.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 0.11.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz
%else
-Release: 2.1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 10.3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz
%endif
-License: PHP
+License: PHP-3.01
URL: https://pecl.php.net/package/imagick
+Patch0: %{pecl_name}-tests.patch
+
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel
@@ -72,7 +91,6 @@ BuildRequires: ImageMagick-devel
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
-%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
%if %{with im7}
Provides: %{?scl_prefix}php-%{pecl_name} = 1:%{version}%{?prever}
@@ -87,15 +105,23 @@ Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}%{?preve
Conflicts: %{?scl_prefix}php-pecl-gmagick
%if %{with im7}
Conflicts: %{?scl_prefix}php-pecl-imagick-im6 <= %{version}-%{release}
+%if %{default} == 7
+Obsoletes: %{?scl_prefix}php-pecl-imagick <= %{version}-%{release}
+%else
Conflicts: %{?scl_prefix}php-pecl-imagick <= %{version}-%{release}
+%endif
%else
Conflicts: %{?scl_prefix}php-pecl-imagick-im7 <= %{version}-%{release}
+%if %{default} == 6
Obsoletes: %{?scl_prefix}php-pecl-imagick <= %{version}-%{release}
+%else
+Conflicts: %{?scl_prefix}php-pecl-imagick <= %{version}-%{release}
+%endif
%endif
Provides: %{?scl_prefix}php-pecl-imagick = %{version}-%{release}
Provides: %{?scl_prefix}php-pecl-imagick%{?_isa} = %{version}-%{release}
-%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
+%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} == 7
# Other third party repo stuff
Obsoletes: php53-pecl-%{pecl_name} <= %{version}
Obsoletes: php53u-pecl-%{pecl_name} <= %{version}
@@ -128,12 +154,6 @@ Obsoletes: php73w-pecl-%{pecl_name} <= %{version}
%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
@@ -173,12 +193,9 @@ These are the files needed to compile programs using %{pecl_name} extension.
%prep
%setup -q -c
%if 0%{?gh_date}
-mv %{gh_project}-%{gh_commit} NTS
mv NTS/package.xml .
sed -e 's/@PACKAGE_VERSION@/%{version}dev/' -i NTS/php_imagick.h
sed -e 's/3.3.0RC2/%{version}dev/' -i package.xml
-%else
-mv %{pecl_name}-%{upstream_version}%{?upstream_prever} NTS
%endif
# don't install any font (and test using it)
@@ -194,7 +211,9 @@ then : "Font files detected!"
exit 1
fi
-cd NTS
+cd %{sources}
+%patch -P0 -p1
+
: Avoid arginfo to be regenerated
rm *.stub.php
@@ -231,18 +250,21 @@ imagick.skip_version_check=1
;imagick.allow_zero_dimension_images => 0 => 0
EOF
+mkdir NTS
%if %{with_zts}
-cp -r NTS ZTS
+mkdir ZTS
%endif
%build
%{?dtsenable}
+cd %{sources}
+%{__phpize}
+
: Standard NTS build
-cd NTS
-%{_bindir}/phpize
-%configure --with-imagick=%{prefix} --with-php-config=%{_bindir}/php-config
+cd ../NTS
+%configure --with-imagick=%{_root_prefix} --with-php-config=%{__phpconfig}
make %{?_smp_mflags}
: Dump REFLECTION
@@ -251,10 +273,9 @@ make %{?_smp_mflags}
--re imagick >REFLECTION
%if %{with_zts}
-cd ../ZTS
: ZTS build
-%{_bindir}/zts-phpize
-%configure --with-imagick=%{prefix} --with-php-config=%{_bindir}/zts-php-config
+cd ../ZTS
+%configure --with-imagick=%{_root_prefix} --with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -276,7 +297,7 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
# Test & Documentation
-cd NTS
+cd %{sources}
for i in $(grep 'role="test"' ../package.xml | sed -e 's/^.*name="//;s/".*$//')
do [ -f $i ] && install -Dpm 644 $i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i
[ -f tests/$i ] && install -Dpm 644 tests/$i %{buildroot}%{pecl_testdir}/%{pecl_name}/tests/$i
@@ -308,14 +329,17 @@ fi
%check
+cd %{sources}
export REPORT_EXIT_STATUS=1
# very long, and erratic results, sometime timeout
-rm ?TS/tests/229_Tutorial_fxAnalyzeImage_case1.phpt
-rm ?TS/tests/244_Tutorial_psychedelicFontGif_basic.phpt
+rm tests/229_Tutorial_fxAnalyzeImage_case1.phpt
+rm tests/244_Tutorial_psychedelicFontGif_basic.phpt
+# very long, and erratic results, sometime segfault on shutdown (EL-7/8)
+rm tests/073_Imagick_forwardFourierTransformImage_basic.phpt
+rm tests/086_Imagick_forwardFourierTransformImage_basic.phpt
: simple module load test for NTS extension
-cd NTS
%{__php} --no-php-ini \
--define extension_dir=%{buildroot}%{php_extdir} \
--define extension=%{pecl_name}.so \
@@ -334,7 +358,6 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \
%if %{with_zts}
: simple module load test for ZTS extension
-cd ../ZTS
%{__ztsphp} --no-php-ini \
--define extension_dir=%{buildroot}%{php_ztsextdir} \
--define extension=%{pecl_name}.so \
@@ -343,7 +366,7 @@ cd ../ZTS
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -366,6 +389,18 @@ cd ../ZTS
%changelog
+* Mon Feb 12 2024 Remi Collet <remi@remirepo.net> - 3.7.0-10
+- add upstream patch for test suite with recent IM versions
+
+* Wed Aug 30 2023 Remi Collet <remi@remirepo.net> - 3.7.0-9
+- rebuild for PHP 8.3.0RC1
+
+* Wed Jul 12 2023 Remi Collet <remi@remirepo.net> - 3.7.0-8
+- build out of sources tree
+
+* Fri Mar 10 2023 Remi Collet <remi@remirepo.net> - 3.7.0-7
+- rebuild with latest ImageMagick 6/7
+
* Thu Sep 1 2022 Remi Collet <remi@remirepo.net> - 3.7.0-2
- rebuild for PHP 8.2.0RC1