From 17bd3ef7dbb395a469c010acddab84e5196a5c12 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 19 Jul 2023 16:39:26 +0200 Subject: build out of sources tree --- REFLECTION | 2 +- php-pecl-xhprof.spec | 58 ++++++++++++++++++++++++++++------------------------ 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/REFLECTION b/REFLECTION index 0dd0491..a93e08a 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #123 xhprof version 2.3.9 ] { +Extension [ extension #124 xhprof version 2.3.9 ] { - INI { Entry [ xhprof.output_dir ] diff --git a/php-pecl-xhprof.spec b/php-pecl-xhprof.spec index 54a5cc0..f7297c8 100644 --- a/php-pecl-xhprof.spec +++ b/php-pecl-xhprof.spec @@ -3,8 +3,8 @@ # # Fedora spec file for php-pecl-xhprof # -# Copyright (c) 2012-2022 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 @@ -19,18 +19,20 @@ %global _root_sysconfdir %{_sysconfdir} %endif -%global pecl_name xhprof -%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} -%global ini_name 40-%{pecl_name}.ini +%global pecl_name xhprof +%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} +%global ini_name 40-%{pecl_name}.ini +%global sources %{pecl_name}-%{version} +%global _configure ../extension/configure Name: %{?scl_prefix}php-pecl-xhprof Version: 2.3.9 -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Summary: PHP extension for XHProf, a Hierarchical Profiler 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 # https://bugs.php.net/61262 ExclusiveArch: %{ix86} x86_64 aarch64 @@ -42,7 +44,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} @@ -98,7 +99,7 @@ sed -e 's/role="php"/role="src"/' \ %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \ -i package.xml -pushd %{pecl_name}-%{version}/extension +pushd %{sources}/extension sed -e '/XHPROF_VERSION/s/2.3.5/%{version}/' -i php_xhprof.h # Sanity check, really often broken extver=$(sed -n '/#define XHPROF_VERSION/{s/.* "//;s/".*$//;p}' php_xhprof.h) @@ -133,29 +134,30 @@ Alias /xhprof %{_datadir}/xhprof/xhprof_html EOF -cd %{pecl_name}-%{version} +cd %{sources} chmod -x extension/*.{c,h} +mkdir NTS %if %{with_zts} -# duplicate for ZTS build -cp -r extension ext-zts +mkdir ZTS %endif %build %{?dtsenable} -cd %{pecl_name}-%{version}/extension -%{_bindir}/phpize +cd %{sources}/extension +%{__phpize} + +cd ../NTS %configure \ - --with-php-config=%{_bindir}/php-config + --with-php-config=%{__phpconfig} make %{?_smp_mflags} %if %{with_zts} -cd ../ext-zts -%{_bindir}/zts-phpize +cd ../ZTS %configure \ - --with-php-config=%{_bindir}/zts-php-config + --with-php-config=%{__ztsphpconfig} make %{?_smp_mflags} %endif @@ -163,11 +165,11 @@ make %{?_smp_mflags} %install %{?dtsenable} -make install -C %{pecl_name}-%{version}/extension INSTALL_ROOT=%{buildroot} +make install -C %{sources}/NTS INSTALL_ROOT=%{buildroot} install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} %if %{with_zts} -make install -C %{pecl_name}-%{version}/ext-zts INSTALL_ROOT=%{buildroot} +make install -C %{sources}/ZTS INSTALL_ROOT=%{buildroot} install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif @@ -179,12 +181,12 @@ install -D -m 644 httpd.conf %{buildroot}%{_root_sysconfdir}/httpd/conf.d/%{?scl # Install the web interface mkdir -p %{buildroot}%{_datadir}/xhprof -cp -pr %{pecl_name}-%{version}/xhprof_html %{buildroot}%{_datadir}/xhprof/xhprof_html -cp -pr %{pecl_name}-%{version}/xhprof_lib %{buildroot}%{_datadir}/xhprof/xhprof_lib +cp -pr %{sources}/xhprof_html %{buildroot}%{_datadir}/xhprof/xhprof_html +cp -pr %{sources}/xhprof_lib %{buildroot}%{_datadir}/xhprof/xhprof_lib rm -r %{buildroot}%{_datadir}/xhprof/xhprof_html/docs # Test & Documentation -cd %{pecl_name}-%{version} +cd %{sources} for i in $(grep 'role="test"' ../package.xml | sed -e 's/^.*name="//;s/".*$//') do install -Dpm 644 $i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i done @@ -200,13 +202,12 @@ done --modules | grep '^%{pecl_name}$' %if %{with tests} -cd %{pecl_name}-%{version}/extension +cd %{sources}/extension : 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 +%{__php} -n run-tests.php -q --show-diff %endif %if %{with_zts} @@ -238,7 +239,7 @@ fi %files -%{?_licensedir:%license %{pecl_name}-%{version}/LICENSE} +%{?_licensedir:%license %{sources}/LICENSE} %doc %{pecl_docdir}/%{pecl_name} %exclude %{pecl_docdir}/%{pecl_name}/examples %exclude %{pecl_docdir}/%{pecl_name}/xhprof_html @@ -262,6 +263,9 @@ fi %changelog +* Wed Jul 19 2023 Remi Collet - 2.3.9-2 +- build out of sources tree + * Wed Dec 14 2022 Remi Collet - 2.3.9-1 - update to 2.3.9 - use SPDX license id -- cgit