summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2023-09-01 09:06:37 +0200
committerRemi Collet <remi@php.net>2023-09-01 09:06:37 +0200
commit6275a74e06439ee69029af8cbfe9d42133217b74 (patch)
tree89e1b9456b21d1b6043da4b06c288fa8951a8823
parent1767d7b88549a2f261d2590c8999801516649b08 (diff)
build out of sources tree
-rw-r--r--php-pecl-excimer.spec53
1 files changed, 26 insertions, 27 deletions
diff --git a/php-pecl-excimer.spec b/php-pecl-excimer.spec
index 33259e8..6d93065 100644
--- a/php-pecl-excimer.spec
+++ b/php-pecl-excimer.spec
@@ -6,26 +6,25 @@
#
# Please, preserve the changelog entries
#
-%if 0%{?scl:1}
-%scl_package php-pecl-excimer
-%else
-%global _root_prefix %{_prefix}
-%endif
+%{?scl:%scl_package php-pecl-excimer}
-%bcond_without tests
+%bcond_without tests
-%global pecl_name excimer
-%global ini_name 40-%{pecl_name}.ini
+%global pecl_name excimer
+%global ini_name 40-%{pecl_name}.ini
# segfault in test suite
-%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
+%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
+%global sources %{pecl_name}-%{version}
+%global _configure ../%{sources}/configure
+
Summary: Interrupting timer and low-overhead sampling profiler
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: 1.1.1
-Release: 1%{?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: Apache-2.0
URL: https://pecl.php.net/package/%{pecl_name}
-Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+Source0: https://pecl.php.net/get/%{sources}.tgz
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
@@ -34,7 +33,6 @@ BuildRequires: %{?scl_prefix}php-pear
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
-%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
@@ -58,9 +56,7 @@ sed -e 's/role="test"/role="src"/' \
%{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
-i package.xml
-mv %{pecl_name}-%{version} NTS
-
-cd NTS
+cd %{sources}
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_EXCIMER_VERSION/{s/.* "//;s/".*$//;p}' php_excimer.h)
if test "x${extver}" != "x%{version}"; then
@@ -69,9 +65,9 @@ if test "x${extver}" != "x%{version}"; then
fi
cd ..
+mkdir NTS
%if %{with_zts}
-# Duplicate source tree for NTS / ZTS build
-cp -pr NTS ZTS
+mkdir ZTS
%endif
# Create configuration file
@@ -84,21 +80,22 @@ EOF
%build
%{?dtsenable}
-cd NTS
-%{_bindir}/phpize
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
%configure \
--enable-excimer \
--with-libdir=%{_lib} \
- --with-php-config=%{_bindir}/php-config
+ --with-php-config=%{__phpconfig}
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
%configure \
--enable-excimer \
--with-libdir=%{_lib} \
- --with-php-config=%{_bindir}/zts-php-config
+ --with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -124,7 +121,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
@@ -149,15 +146,15 @@ fi
%check
+cd %{sources}
# erratic results, randomly fails in mock
-rm ?TS/tests/cpu.phpt
+rm tests/cpu.phpt
OPT="-q -P --show-diff"
%if "%{php_version}" > "7.4"
OPT="$OPT %{?_smp_mflags}"
%endif
-cd NTS
# Minimal load test for NTS extension
%{__php} --no-php-ini \
--define extension=%{buildroot}/%{php_extdir}/%{pecl_name}.so \
@@ -170,7 +167,6 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}/%{php_extdir}/%{pecl_name}.so" \
%endif
%if %{with_zts}
-cd ../ZTS
# Minimal load test for ZTS extension
%{__ztsphp} --no-php-ini \
--define extension=%{buildroot}/%{php_ztsextdir}/%{pecl_name}.so \
@@ -185,7 +181,7 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}/%{php_ztsextdir}/%{pecl_name}.so" \
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -199,6 +195,9 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}/%{php_ztsextdir}/%{pecl_name}.so" \
%changelog
+* Fri Sep 1 2023 Remi Collet <remi@remirepo.net> - 1.1.1-2
+- build out of sources tree
+
* Tue Mar 14 2023 Remi Collet <remi@remirepo.net> - 1.1.1-1
- update to 1.1.1
- drop patch merged upstream