summaryrefslogtreecommitdiffstats
path: root/php-pecl-uopz.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-uopz.spec')
-rw-r--r--php-pecl-uopz.spec73
1 files changed, 40 insertions, 33 deletions
diff --git a/php-pecl-uopz.spec b/php-pecl-uopz.spec
index 2abe8f8..7e55285 100644
--- a/php-pecl-uopz.spec
+++ b/php-pecl-uopz.spec
@@ -1,32 +1,36 @@
# remirepo spec file for php-pecl-uopz
#
-# Copyright (c) 2014-2022 Remi Collet
-# License: CC-BY-SA
+# Copyright (c) 2014-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}
-%scl_package php-pecl-uopz
-%endif
+%{?scl:%scl_package php-pecl-uopz}
%bcond_without tests
-%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
-%global pecl_name uopz
-%global ini_name 05-%{pecl_name}.ini
-
# see https://github.com/krakjoe/uopz/releases
#global gh_commit c335700be4dc4350605bc4fb1efd8e96ba51b733
#global gh_short %%(c=ยต%{gh_commit}; echo ${c:0:7})
#global gh_owner krakjoe
#global gh_project uopz
+%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
+%global pecl_name uopz
+%global ini_name 05-%{pecl_name}.ini
+%if 0%{?gh_commit:1}
+%global sources %{gh_project}-%{gh_commit}
+%else
+%global sources %{pecl_name}-%{version}
+%endif
+%global _configure ../%{sources}/configure
+
Summary: User Operations for Zend
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: 7.1.1
-Release: 3%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
-License: PHP
+Release: 4%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+License: PHP-3.01
URL: https://pecl.php.net/package/%{pecl_name}
%if 0%{?gh_commit:1}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz
@@ -77,7 +81,6 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -q -c
%if 0%{?gh_commit:1}
-mv %{gh_project}-%{gh_commit} NTS
# Temporary, until released on PECL
%{__php} -r '
$pkg = simplexml_load_file("NTS/package.xml");
@@ -88,8 +91,6 @@ mv %{gh_project}-%{gh_commit} NTS
$pkg->stability->api = "beta";
$pkg->asXML("package.xml");
'
-%else
-mv %{pecl_name}-%{version} NTS
%endif
# Don't install/register tests
@@ -97,7 +98,7 @@ sed -e 's/role="test"/role="src"/' \
%{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
-i package.xml
-cd NTS
+cd %{sources}
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_UOPZ_VERSION/{s/.* "//;s/".*$//;p}' uopz.h)
if test "x${extver}" != "x%{version}"; then
@@ -122,26 +123,27 @@ extension=%{pecl_name}.so
;uopz.exit = 0
EOF
+mkdir NTS
%if %{with_zts}
-# Duplicate source tree for NTS / ZTS build
-cp -pr NTS ZTS
+mkdir ZTS
%endif
%build
%{?dtsenable}
-cd NTS
-%{_bindir}/phpize
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
%configure \
- --with-php-config=%{_bindir}/php-config
+ --with-php-config=%{__phpconfig}
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
%configure \
- --with-php-config=%{_bindir}/zts-php-config
+ --with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -164,7 +166,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
@@ -189,19 +191,21 @@ fi
%check
+cd %{sources}
%if "%{php_version}" >= "8.1"
-# https://github.com/krakjoe/uopz/issues/160
-rm ?TS/tests/012.phpt
+rm tests/012.phpt
%endif
%if "%{php_version}" >= "8.2"
-rm ?TS/tests/019.phpt
+rm tests/019.phpt
+%endif
+%if "%{php_version}" >= "8.3"
+rm tests/007.phpt
%endif
-cd NTS
: Minimal load test for NTS extension
%{__php} --no-php-ini \
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
- --modules | grep %{pecl_name}
+ --modules | grep '^%{pecl_name}$'
%if %{with tests}
: Upstream test suite for NTS extension
@@ -212,24 +216,23 @@ REPORT_EXIT_STATUS=1 \
%endif
%if %{with_zts}
-cd ../ZTS
: Minimal load test for ZTS extension
%{__ztsphp} --no-php-ini \
--define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
- --modules | grep %{pecl_name}
+ --modules | grep '^%{pecl_name}$'
%if %{with tests}
: Upstream test suite for ZTS extension
-TEST_PHP_EXECUTABLE=%{_bindir}/zts-php \
+TEST_PHP_EXECUTABLE=%{__ztsphp} \
TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
-%{_bindir}/zts-php -n run-tests.php -q --show-diff
+%{__ztsphp} -n run-tests.php -q --show-diff
%endif
%endif
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -243,6 +246,10 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Wed Jul 19 2023 Remi Collet <remi@remirepo.net> - 7.1.1-4
+- build out of sources tree
+- skip 1 test failing with 8.3
+
* Fri Sep 9 2022 Remi Collet <remi@remirepo.net> - 7.1.1-3
- skip 1 test failing with 8.2