From 878db1ae465a985452e1d3327f9079ec0ceb58d8 Mon Sep 17 00:00:00 2001 From: Gris Ge Date: Mon, 16 Jan 2023 14:35:39 +0800 Subject: [PATCH] cargo: Use explicit dependency line for rust-nmstate+query_apply-devel Resolves: RHBZ#2159314 Signed-off-by: Gris Ge --- ...Workaround-for-Fedora-rust-packaging.patch | 33 +++++++++++++++++++ nmstate.spec | 11 ++++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 0001-Workaround-for-Fedora-rust-packaging.patch diff --git a/0001-Workaround-for-Fedora-rust-packaging.patch b/0001-Workaround-for-Fedora-rust-packaging.patch new file mode 100644 index 0000000..15cd542 --- /dev/null +++ b/0001-Workaround-for-Fedora-rust-packaging.patch @@ -0,0 +1,33 @@ +From a78d7610a7a3adc4cd80433bdded7d37e738eb12 Mon Sep 17 00:00:00 2001 +From: Gris Ge +Date: Mon, 16 Jan 2023 11:56:16 +0800 +Subject: [PATCH] Workaround for Fedora rust packaging + +Signed-off-by: Gris Ge +--- + rust/src/lib/Cargo.toml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/rust/src/lib/Cargo.toml b/rust/src/lib/Cargo.toml +index 801b3e33..67c7f3dd 100644 +--- a/rust/src/lib/Cargo.toml ++++ b/rust/src/lib/Cargo.toml +@@ -9,7 +9,7 @@ documentation = "https://nmstate.io" + repository = "https://github.com/nmstate/nmstate" + keywords = ["network", "linux"] + categories = ["network-programming", "os::linux-apis"] +-rust-version = "1.58" ++rust-version = "1.60" + edition = "2018" + + [lib] +@@ -62,5 +62,5 @@ serde_yaml = "0.9" + + [features] + default = ["query_apply", "gen_conf"] +-query_apply = ["nispor", "nix", "zbus"] ++query_apply = ["dep:nispor", "dep:nix", "dep:zbus"] + gen_conf = [] +-- +2.39.0 + diff --git a/nmstate.spec b/nmstate.spec index eb69c1a..76bbde5 100644 --- a/nmstate.spec +++ b/nmstate.spec @@ -3,13 +3,17 @@ Name: nmstate Version: 2.2.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Declarative network manager API License: LGPLv2+ URL: https://github.com/%{srcname}/%{srcname} Source0: %{url}/releases/download/v%{version}/%{srcname}-%{version}.tar.gz Source1: %{url}/releases/download/v%{version}/%{srcname}-%{version}.tar.gz.asc Source2: https://nmstate.io/nmstate.gpg +# We use `dep: dep_name` to prevent rust packaging generate incorect dependency +# https://bugzilla.redhat.com/show_bug.cgi?id=2161128 +# but list Requires manually +Patch1: 0001-Workaround-for-Fedora-rust-packaging.patch BuildRequires: patchelf BuildRequires: python3-devel BuildRequires: python3-setuptools @@ -34,6 +38,7 @@ BuildRequires: (crate(uuid/v4) >= 1.1 with crate(uuid/v4) < 2.0) BuildRequires: (crate(uuid/v5) >= 1.1 with crate(uuid/v5) < 2.0) BuildRequires: (crate(zbus/default) >= 1.9 with crate(zbus/default) < 2.0) BuildRequires: (crate(zvariant/default) >= 2.10 with crate(zvariant/default) < 3.0) +BuildRequires: (crate(nix/default) >= 0.24 with crate(nix/default) < 0.25) %description Nmstate is a library with an accompanying command line tool that manages host @@ -117,6 +122,10 @@ which use "%{name}" crate with gen_conf feature. %package -n rust-%{name}+query_apply-devel Summary: Rust crate of nmstate with default feature BuildArch: noarch +# https://bugzilla.redhat.com/show_bug.cgi?id=2161128 +Requires: (crate(nispor/default) >= 1.2.9 with crate(nispor/default) < 2.0) +Requires: (crate(nix/default) >= 0.24 with crate(nix/default) < 0.25) +Requires: (crate(zbus/default) >= 1.9 with crate(zbus/default) < 2.0) %description -n rust-%{name}+query_apply-devel This package contains library source intended for building other packages