summaryrefslogtreecommitdiffstats
path: root/php-pecl-gnupg.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2025-04-08 17:15:24 +0200
committerRemi Collet <remi@php.net>2025-04-08 17:15:24 +0200
commite89bd3557b568cd8b48b859bbc74642b439f0c2a (patch)
tree5bc5590008fc4b62d382787abd4929da707efa80 /php-pecl-gnupg.spec
parent7114203ef3846709f24d74d037b7832feb07edec (diff)
add option to run tests with gpg1 instead og gpg2HEADmaster
Diffstat (limited to 'php-pecl-gnupg.spec')
-rw-r--r--php-pecl-gnupg.spec20
1 files changed, 14 insertions, 6 deletions
diff --git a/php-pecl-gnupg.spec b/php-pecl-gnupg.spec
index 8397c34..9e71a64 100644
--- a/php-pecl-gnupg.spec
+++ b/php-pecl-gnupg.spec
@@ -15,6 +15,8 @@
%else
%bcond_without tests
%endif
+# to run test with GnuPG v1 instead of GnuPG v2
+%bcond_with gpg1
%global pecl_name gnupg
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
@@ -45,7 +47,9 @@ BuildRequires: gnupg
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
-# We force use of /usr/bin/gpg as gpg2 is unusable in non-interactive mode
+%if %{with gpg1}
+Requires: gnupg1
+%endif
Requires: gnupg
Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
@@ -94,13 +98,18 @@ mkdir NTS
mkdir ZTS
%endif
+%if %{with gpg1}
+%{_bindir}/gpg1 --version
+%else
+%{_bindir}/gpg --version
+%endif
+
%build
%{?dtsenable}
export PHP_RPATH=no
export CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64"
-gpg --version
peclbuild() {
%configure \
@@ -149,6 +158,9 @@ done
%check
cd %{sources}
unset GPG_AGENT_INFO
+%if %{with gpg1}
+export GNUPGFILENAME=%{_bindir}/gpg1
+%endif
: Check if build NTS extension can be loaded
%{__php} -n -q \
@@ -162,12 +174,8 @@ REPORT_EXIT_STATUS=1 \
%{__php} -n run-tests.php \
-n -q \
-d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
-%if 0%{?fedora} >= 41
- --show-diff || : ignore failure
-%else
--show-diff
%endif
-%endif
%if %{with_zts}
: Check if build ZTS extension can be loaded