summaryrefslogtreecommitdiffstats
path: root/php-pecl-skywalking.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2022-07-01 07:12:17 +0200
committerRemi Collet <remi@php.net>2022-07-01 07:12:17 +0200
commita51874008c21a462cf8a48f2d095c1ff80f5d43e (patch)
tree9f637427aa016e644aa23b399ff2efdb3f8f4f47 /php-pecl-skywalking.spec
parentb302bc3bdc9dca14510cc79a8128b3dee53fd6f5 (diff)
use cargo vendor feature to reduce sources size
Diffstat (limited to 'php-pecl-skywalking.spec')
-rw-r--r--php-pecl-skywalking.spec28
1 files changed, 26 insertions, 2 deletions
diff --git a/php-pecl-skywalking.spec b/php-pecl-skywalking.spec
index 6558781..958ef0b 100644
--- a/php-pecl-skywalking.spec
+++ b/php-pecl-skywalking.spec
@@ -19,7 +19,7 @@
Summary: The PHP instrument agent for Apache SkyWalking
Name: %{?sub_prefix}php-pecl-%{pecl_name}
Version: 5.0.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: ASL 2.0
URL: https://pecl.php.net/package/%{pecl_name}
@@ -44,6 +44,7 @@ BuildRequires: %{?scl_prefix}php-pcre
BuildRequires: libcurl-devel
BuildRequires: cargo
BuildRequires: rustfmt
+BuildRequires: rust-packaging
# Using system rust registry
#BuildRequires: (crate(anyhow/default) >= 1.0.57 with crate(anyhow/default) < 2.0.0~)
#BuildRequires: (crate(cbindgen/default) >= 0.23.0 with crate(cbindgen/default) < 0.24.0~)
@@ -65,7 +66,6 @@ BuildRequires: rustfmt
#*************: (crate(tonic/default) >= 0.5.2 with crate(tonic/default) < 0.6.0~)
#BuildRequires: (crate(uuid/default) >= 1.0.0 with crate(uuid/default) < 2.0.0~)
#BuildRequires: (crate(uuid/v4) >= 1.0.0 with crate(uuid/v4) < 2.0.0~)
-#BuildRequires: rust-packaging
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
@@ -101,6 +101,27 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
pushd NTS
+# Create cargo configuration to use vendor directory
+mkdir .cargo
+cat << EOF | tee .cargo/config.toml
+[build]
+rustc = "%{__rustc}"
+
+[env]
+CFLAGS = "%{build_cflags}"
+CXXFLAGS = "%{build_cxxflags}"
+LDFLAGS = "%{build_ldflags}"
+
+[term]
+verbose = true
+
+[source.crates-io]
+replace-with = "vendored-sources"
+
+[source.vendored-sources]
+directory = "$(dirname $PWD)/mycargo"
+EOF
+
: Check version
extver=$(sed -n '/#define PHP_SKYWALKING_VERSION /{s/.* "//;s/".*$//;p}' php_skywalking.h)
if test "x${extver}" != "x%{version}%{?prever}"; then
@@ -240,6 +261,9 @@ OPT="-n -d extension=curl.so -d extension=json.so"
%changelog
+* Fri Jul 1 2022 Remi Collet <remi@remirepo.net> - 5.0.1-2
+- use cargo vendor feature to reduce sources size
+
* Thu Jun 30 2022 Remi Collet <remi@remirepo.net> - 5.0.1-1
- update to 5.0.1
- use bundled rust registry