summaryrefslogtreecommitdiffstats
path: root/php-realpath-turbo.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-realpath-turbo.spec')
-rw-r--r--php-realpath-turbo.spec51
1 files changed, 25 insertions, 26 deletions
diff --git a/php-realpath-turbo.spec b/php-realpath-turbo.spec
index b35e943..d99f3d7 100644
--- a/php-realpath-turbo.spec
+++ b/php-realpath-turbo.spec
@@ -1,14 +1,12 @@
# remirepo spec file for php-realpath-turbo
#
-# Copyright (c) 2020-2022 Remi Collet
-# License: CC-BY-SA
+# Copyright (c) 2020-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-realpath-turbo
-%endif
+%{?scl:%scl_package php-realpath-turbo}
%bcond_without tests
@@ -22,14 +20,16 @@
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global ini_name 40-%{pecl_name}.ini
+%global sources %{gh_project}-%{gh_commit}
+%global _configure ../%{sources}/configure
Name: %{?scl_prefix}php-%{pack_name}
Version: 2.0.0
-Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Summary: Use realpath cache despite open_basedir restriction
-License: BSD
+License: BSD-2-Clause
URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pack_name}-%{version}-%{gh_short}.tar.gz
@@ -55,10 +55,9 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -q -c
-mv %{gh_project}-%{gh_commit} NTS
-cd NTS
-%patch0 -p1 -b .pr20
+cd %{sources}
+%patch -P0 -p1 -b .pr20
# Check extension version
ver=$(sed -n '/define REALPATH_TURBO_VERSION/{s/.* "//;s/".*$//;p}' realpath_turbo.h)
@@ -77,25 +76,25 @@ extension=%{pecl_name}.so
;realpath_turbo.disable_dangerous_functions = On
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
-%configure --with-php-config=%{_bindir}/php-config
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
+%configure --with-php-config=%{__phpconfig}
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
-%configure --with-php-config=%{_bindir}/zts-php-config
+%configure --with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -128,22 +127,19 @@ install -Dpm 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
%if %{with tests}
-cd NTS
+cd %{sources}
: Upstream test suite for NTS extension
TEST_PHP_EXECUTABLE=%{__php} \
TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \
-NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
-%{__php} -n run-tests.php --show-diff || ret=1
+%{__php} -n run-tests.php -q --show-diff || ret=1
%if %{with_zts}
-cd ../ZTS
: Upstream test suite for ZTS extension
TEST_PHP_EXECUTABLE=%{__ztsphp} \
TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \
-NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
-%{__ztsphp} -n run-tests.php --show-diff || ret=1
+%{__ztsphp} -n run-tests.php -q --show-diff || ret=1
%endif
exit $ret
@@ -152,8 +148,8 @@ exit $ret
%files
%{!?_licensedir:%global license %%doc}
-%license NTS/LICENSE
-%doc NTS/README.md
+%license %{sources}/LICENSE
+%doc %{sources}/README.md
%config(noreplace) %{php_inidir}/%{ini_name}
%{php_extdir}/%{pecl_name}.so
@@ -165,6 +161,9 @@ exit $ret
%changelog
+* Fri Sep 1 2023 Remi Collet <remi@remirepo.net> - 2.0.0-4
+- build out of sources tree
+
* Tue Sep 13 2022 Remi Collet <remi@remirepo.net> - 2.0.0-3
- add patch for test suite with PHP 8.2 from
https://github.com/Whissi/realpath_turbo/pull/20