summaryrefslogtreecommitdiffstats
path: root/php-pecl-gnupg.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-gnupg.spec')
-rw-r--r--php-pecl-gnupg.spec104
1 files changed, 46 insertions, 58 deletions
diff --git a/php-pecl-gnupg.spec b/php-pecl-gnupg.spec
index 8db5d5e..0d5ade8 100644
--- a/php-pecl-gnupg.spec
+++ b/php-pecl-gnupg.spec
@@ -1,38 +1,42 @@
# spec file for php-pecl-gnupg
#
-# Copyright (c) 2012-2021 Remi Collet
-# License: CC-BY-SA
+# Copyright (c) 2012-2023 Remi Collet
+# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
-%if 0%{?scl:1}
-%global sub_prefix %{scl_prefix}
-%scl_package php-pecl-gnupg
-%endif
-%global with_tests 0%{!?_without_tests:1}
+%{?scl:%scl_package php-pecl-gnupg}
+
+%bcond_without tests
-%global pecl_name gnupg
-%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
+%global pecl_name gnupg
+%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%if "%{php_version}" < "5.6"
-%global ini_name %{pecl_name}.ini
+%global ini_name %{pecl_name}.ini
%else
-%global ini_name 40-%{pecl_name}.ini
+%global ini_name 40-%{pecl_name}.ini
%endif
-%global upstream_version 1.5.0
+%global upstream_version 1.5.1
#global upstream_prever RC2
+%global sources %{pecl_name}-%{upstream_version}%{?upstream_prever}
+%global _configure ../%{sources}/configure
+
+# For PHP < 5.6 and EPEL-9
+%{!?__phpize: %global __phpize %{_bindir}/phpize}
+%{!?__ztsphpize: %global __ztsphpize %{_bindir}/zts-phpize}
+%{!?__phpconfig: %global __phpconfig %{_bindir}/php-config}
+%{!?__ztsphpconfig:%global __ztsphpconfig %{_bindir}/zts-php-config}
Summary: Wrapper around the gpgme library
-Name: %{?sub_prefix}php-pecl-gnupg
+Name: %{?scl_prefix}php-pecl-gnupg
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
-Release: 3%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
-License: BSD
+License: BSD-2-Clause
URL: https://pecl.php.net/package/gnupg
Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz
-Patch0: %{pecl_name}-php81.patch
-
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel
@@ -52,32 +56,11 @@ Requires: gnupg1
%else
Requires: gnupg
%endif
-%{?_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
-
-%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
@@ -102,10 +85,7 @@ cat >%{ini_name} << 'EOF'
extension=%{pecl_name}.so
EOF
-mv %{pecl_name}-%{upstream_version}%{?upstream_prever} NTS
-cd NTS
-%patch0 -p1 -b .php81
-
+cd %{sources}
# Check extension version
extver=$(sed -n '/#define PHP_GNUPG_VERSION/{s/.* "//;s/".*$//;p}' php_gnupg.h)
if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then
@@ -114,9 +94,10 @@ if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then
fi
cd ..
+mkdir NTS
%if %{with_zts}
# Build ZTS extension if ZTS devel available (fedora >= 17)
-cp -r NTS ZTS
+mkdir ZTS
%endif
@@ -133,23 +114,25 @@ gpg --version
%endif
peclbuild() {
-%{_bindir}/${1}ize
%configure \
%if 0%{?rhel} == 7
--with-gpg=$GPG1 \
%endif
--with-libdir=%{_lib} \
- --with-php-config=%{_bindir}/${1}-config
+ --with-php-config=${1}
make %{?_smp_mflags}
}
-cd NTS
-peclbuild php
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
+peclbuild %{__phpconfig}
%if %{with_zts}
cd ../ZTS
-peclbuild zts-php
+peclbuild %{__ztsphpconfig}
%endif
@@ -171,7 +154,7 @@ install -D -m 644 %{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
@@ -196,22 +179,21 @@ fi
%check
+cd %{sources}
sed -e '/GnuPG v1/d' \
- -i ?TS/tests/gnupg_*_export.phpt
+ -i tests/gnupg_*_export.phpt
unset GPG_AGENT_INFO
-cd NTS
: Check if build NTS extension can be loaded
%{__php} -n -q \
-d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
- --modules | grep %{pecl_name}
+ --modules | grep '^%{pecl_name}$'
-%if %{with_tests}
+%if %{with tests}
: Run upstream test suite for NTS extension
-TEST_PHP_EXECUTABLE=%{_bindir}/php \
+TEST_PHP_EXECUTABLE=%{__php} \
REPORT_EXIT_STATUS=1 \
-NO_INTERACTION=1 \
%{__php} -n run-tests.php \
-n -q \
-d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
@@ -219,16 +201,15 @@ NO_INTERACTION=1 \
%endif
%if %{with_zts}
-cd ../ZTS
: Check if build ZTS extension can be loaded
%{__ztsphp} -n -q \
-d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
- --modules | grep %{pecl_name}
+ --modules | grep '^%{pecl_name}$'
%endif
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -242,6 +223,13 @@ cd ../ZTS
%changelog
+* Fri Jul 21 2023 Remi Collet <remi@remirepo.net> - 1.5.1-2
+- build out of sources tree
+
+* Sat Jan 1 2022 Remi Collet <remi@remirepo.net> - 1.5.1-1
+- update to 1.5.1
+- drop patch merged upstream
+
* Thu Sep 9 2021 Remi Collet <remi@remirepo.net> - 1.5.0-3
- improve patch for PHP 8.1 from
https://github.com/php-gnupg/php-gnupg/pull/35