From 3014118a72162f0228d80b80bb9754ef34862997 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Fri, 9 Jun 2023 14:50:21 +0900 Subject: [PATCH] Fix cargo environment --- packaging/rust-unic-ucd-version.spec | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packaging/rust-unic-ucd-version.spec b/packaging/rust-unic-ucd-version.spec index 1c0bb97..8e4375c 100644 --- a/packaging/rust-unic-ucd-version.spec +++ b/packaging/rust-unic-ucd-version.spec @@ -24,6 +24,7 @@ Source4: extern.patch # BuildRequires # specifies build-time dependencies for the package # ========================================================== +BuildRequires: cargo BuildRequires: rust BuildRequires: rust-unic-common @@ -44,7 +45,10 @@ cp %{SOURCE3} . # crate-type : dylib, proc-macro, cdylib, bin, etc. # ========================================================== %build -export CARGO_PKG_VERSION=1.67.1 +export CARGO_PKG_VERSION=$(cargo --version | cut -d ' ' -f 2) +export CARGO_PKG_VERSION_MAJOR=$(echo $CARGO_PKG_VERSION | cut -d'.' -f 1 ) +export CARGO_PKG_VERSION_MINOR=$(echo $CARGO_PKG_VERSION | cut -d'.' -f 2 ) +export CARGO_PKG_VERSION_PATCH=$(echo $CARGO_PKG_VERSION | cut -d'.' -f 3 ) export CARGO_PKG_NAME="%{crate}" export CARGO_PKG_DESCRIPTION="%{summary}" @@ -63,7 +67,10 @@ install -m 0644 lib%{real_crate_name}.so %{buildroot}/%{_rust_dylibdir}/lib%{rea %check %if 0%{?run_tests} -export CARGO_PKG_VERSION=1.67.1 +export CARGO_PKG_VERSION=$(cargo --version | cut -d ' ' -f 2) +export CARGO_PKG_VERSION_MAJOR=$(echo $CARGO_PKG_VERSION | cut -d'.' -f 1 ) +export CARGO_PKG_VERSION_MINOR=$(echo $CARGO_PKG_VERSION | cut -d'.' -f 2 ) +export CARGO_PKG_VERSION_PATCH=$(echo $CARGO_PKG_VERSION | cut -d'.' -f 3 ) export CARGO_PKG_NAME="%{crate}" export CARGO_PKG_DESCRIPTION="%{summary}" -- 2.34.1