summaryrefslogtreecommitdiffstats
path: root/php-pecl-ps.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-ps.spec')
-rw-r--r--php-pecl-ps.spec71
1 files changed, 60 insertions, 11 deletions
diff --git a/php-pecl-ps.spec b/php-pecl-ps.spec
index bfb52fe..55f14a1 100644
--- a/php-pecl-ps.spec
+++ b/php-pecl-ps.spec
@@ -10,12 +10,14 @@
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global pecl_name ps
+# After 20-gd.ini
+%global ini_name 40-%{pecl_name}.ini
Summary: An extension to create PostScript files
Name: %{?scl_prefix}php-pecl-ps
-Version: 1.4.2
+Version: 1.4.3
Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
-License: BSD
+License: PHP
Group: Development/Languages
URL: https://pecl.php.net/package/%{pecl_name}
@@ -25,10 +27,15 @@ BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel >= 7.0
BuildRequires: %{?scl_prefix}php-pear
-BuildRequires: pslib-devel
+BuildRequires: %{?scl_prefix}php-gd
+BuildRequires: pkgconfig(gdlib) >= 2.1.1
+BuildRequires: pkgconfig(libps)
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
+%if "%{php_version}" > "8.0"
+Requires: %{?scl_prefix}php-gd%{?_isa}
+%endif
%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
@@ -69,8 +76,11 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
pushd NTS
+%if "%{php_version}" < "8.0"
# https://github.com/steinm/ps/issues/1
sed -e 's/HAVE_LIBGD/DISABLE_LIBGD/' -i *.c
+sed -e '/GDLIB/d' -i config.m4
+%endif
# Check version
extver=$(sed -n '/#define PHP_PS_VERSION/{s/.* "//;s/".*$//;p}' php_ps.h)
@@ -96,13 +106,41 @@ EOF
cd NTS
%{_bindir}/phpize
-%configure --with-php-config=%{_bindir}/php-config
+%configure \
+ --with-ps \
+%if "%{php_version}" > "8.0"
+ --enable-gd \
+%else
+ --disable-gd \
+%endif
+ --with-php-config=%{_bindir}/php-config
make %{?_smp_mflags}
+%{__php} --no-php-ini \
+%if "%{php_version}" > "8.0"
+ --define extension=gd \
+%endif
+ --define extension=modules/%{pecl_name}.so \
+ --ri %{pecl_name}
+
+%{__php} --no-php-ini \
+%if "%{php_version}" > "8.0"
+ --define extension=gd \
+%endif
+ --define extension=modules/%{pecl_name}.so \
+ --re %{pecl_name} >REFLECTION
+
%if %{with_zts}
cd ../ZTS
%{_bindir}/zts-phpize
-%configure --with-php-config=%{_bindir}/zts-php-config
+%configure \
+ --with-ps \
+%if "%{php_version}" > "8.0"
+ --enable-gd \
+%else
+ --disable-gd \
+%endif
+ --with-php-config=%{_bindir}/zts-php-config
make %{?_smp_mflags}
%endif
@@ -125,34 +163,39 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
# Documentation
cd NTS
-for i in $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//')
+for i in $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//') REFLECTION
do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
%check
+OPT="-n"
+%if "%{php_version}" > "8.0"
+ OPT="$OPT -d extension=gd"
+%endif
+
: Minimal load test for NTS extension
cd NTS
-%{_bindir}/php --no-php-ini \
+%{_bindir}/php $OPT \
--define extension=modules/%{pecl_name}.so \
--modules | grep %{pecl_name}
: Upstream test suite for NTS extension
TEST_PHP_EXECUTABLE=%{_bindir}/php \
-TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
+TEST_PHP_ARGS="$OPT -d extension=$PWD/modules/%{pecl_name}.so" \
%{_bindir}/php -n run-tests.php -q --show-diff
%if %{with_zts}
: Minimal load test for ZTS extension
cd ../ZTS
-%{__ztsphp} --no-php-ini \
+%{__ztsphp} $OPT \
--define extension=modules/%{pecl_name}.so \
--modules | grep %{pecl_name}
: Upstream test suite for ZTS extension
TEST_PHP_EXECUTABLE=%{__ztsphp} \
-TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
+TEST_PHP_ARGS="$OPT -d extension=$PWD/modules/%{pecl_name}.so" \
%{__ztsphp} -n run-tests.php -q --show-diff
%endif
@@ -178,7 +221,7 @@ fi
%files
-#%%{?_licensedir:%%license NTS/LICENSE}
+%{?_licensedir:%license NTS/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -192,6 +235,12 @@ fi
%changelog
+* Tue Sep 28 2021 Remi Collet <remi@remirepo.net> - 1.4.3-1
+- update to 1.4.3
+- add REFLECTION file to package documentation
+- License is PHP
+- Enable GD support with PHP 8 only
+
* Sun Sep 26 2021 Remi Collet <remi@remirepo.net> - 1.4.2-1
- new package
- open https://github.com/steinm/ps/pull/2 cleanup