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.spec47
1 files changed, 27 insertions, 20 deletions
diff --git a/php-pecl-imagick.spec b/php-pecl-imagick.spec
index 13cb3b7..3fb64bf 100644
--- a/php-pecl-imagick.spec
+++ b/php-pecl-imagick.spec
@@ -43,6 +43,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
@@ -56,7 +62,7 @@ Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
Release: 0.10.%{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: 7.10%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 8%{?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-3.01
@@ -182,12 +188,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)
@@ -203,7 +206,7 @@ then : "Font files detected!"
exit 1
fi
-cd NTS
+cd %{sources}
: Avoid arginfo to be regenerated
rm *.stub.php
@@ -240,18 +243,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=%{prefix} --with-php-config=%{__phpconfig}
make %{?_smp_mflags}
: Dump REFLECTION
@@ -260,10 +266,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=%{prefix} --with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -285,7 +290,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
@@ -317,17 +322,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 ?TS/tests/073_Imagick_forwardFourierTransformImage_basic.phpt
-rm ?TS/tests/086_Imagick_forwardFourierTransformImage_basic.phpt
+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 \
@@ -346,7 +351,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 \
@@ -355,7 +359,7 @@ cd ../ZTS
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -378,6 +382,9 @@ cd ../ZTS
%changelog
+* 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