summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-pecl-skywalking.spec37
1 files changed, 22 insertions, 15 deletions
diff --git a/php-pecl-skywalking.spec b/php-pecl-skywalking.spec
index 93e2286..7180c77 100644
--- a/php-pecl-skywalking.spec
+++ b/php-pecl-skywalking.spec
@@ -16,15 +16,17 @@
# not supported by upstream
%global with_zts 0
%global ini_name 40-%{pecl_name}.ini
+%global sources %{pecl_name}-%{version}
+%global _configure ../%{sources}/configure
Summary: The PHP instrument agent for Apache SkyWalking
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: 5.0.1
-Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
-License: ASL 2.0
+Release: 3%{?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
# awfull hack, use a bundled rust registry
Source1: makedeps.sh
Source2: https://pecl.php.net/get/%{pecl_name}-deps-%{version}.tgz
@@ -75,7 +77,6 @@ Requires: %{?scl_prefix}php(api) = %{php_core_api}
Requires: %{?scl_prefix}php-curl
Requires: %{?scl_prefix}php-json
Requires: %{?scl_prefix}php-pcre
-%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
@@ -92,14 +93,13 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -q -c -a2
-mv %{pecl_name}-%{version} NTS
# Don't install/register tests
sed -e 's/role="test"/role="src"/' \
%{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
-i package.xml
-pushd NTS
+pushd %{sources}
# Create cargo configuration to use vendor directory
mkdir .cargo
cat << EOF | tee .cargo/config.toml
@@ -129,9 +129,10 @@ if test "x${extver}" != "x%{version}%{?prever}"; then
fi
popd
+mkdir NTS
+
%if %{with_zts}
-# Duplicate source tree for NTS / ZTS build
-cp -pr NTS ZTS
+mkdir ZTS
%endif
# Create configuration file
@@ -170,19 +171,22 @@ grep -h rust-version mycargo/*/Cargo.toml NTS/Cargo.toml | sort -u | tail -n 4
export CARGO_HOME=$PWD/mycargo
-cd NTS
-%{_bindir}/phpize
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
+cp -r ../%{sources}/.cargo .cargo
%configure \
--enable-skywalking \
- --with-php-config=%{_bindir}/php-config
+ --with-php-config=%{__phpconfig}
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
+cp -r ../%{sources}/.cargo .cargo
%configure \
--enable-skywalking \
- --with-php-config=%{_bindir}/zts-php-config
+ --with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -205,7 +209,7 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
# Documentation
-cd NTS
+cd %{sources}
for i in $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//')
do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
@@ -249,7 +253,7 @@ OPT="-n -d extension=curl.so -d extension=json.so"
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -263,6 +267,9 @@ OPT="-n -d extension=curl.so -d extension=json.so"
%changelog
+* Mon Sep 4 2023 Remi Collet <remi@remirepo.net> - 5.0.1-3
+- build out of sources tree
+
* Fri Jul 1 2022 Remi Collet <remi@remirepo.net> - 5.0.1-2
- use cargo vendor feature to reduce sources size