Upgrade to nmstate 2.1.2

Signed-off-by: Gris Ge <fge@redhat.com>
This commit is contained in:
Gris Ge 2022-07-11 21:01:34 +08:00
parent 1e1eb1c696
commit 9adc7ec7a6
4 changed files with 95 additions and 9 deletions

2
.gitignore vendored
View File

@ -73,3 +73,5 @@
/nmstate-2.1.0-alpha2.tar.gz.asc
/nmstate-2.1.0.tar.gz
/nmstate-2.1.0.tar.gz.asc
/nmstate-2.1.2.tar.gz
/nmstate-2.1.2.tar.gz.asc

View File

@ -2,14 +2,15 @@
%define libname libnmstate
Name: nmstate
Version: 2.1.0
Release: 2%{?dist}
Version: 2.1.2
Release: 1%{?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: nmstate.gpg
Source2: https://nmstate.io/nmstate.gpg
Patch1: use_uuid_1_1.patch
BuildRequires: patchelf
BuildRequires: python3-devel
BuildRequires: python3-setuptools
@ -21,7 +22,8 @@ BuildRequires: (crate(serde/default) >= 1.0 with crate(serde/default) < 2.0)
BuildRequires: (crate(serde/derive) >= 1.0 with crate(serde/derive) < 2.0)
BuildRequires: (crate(serde_json/default) >= 1.0 with crate(serde_json/default) < 2.0)
BuildRequires: (crate(serde_yaml/default) >= 0.8 with crate(serde_yaml/default) < 0.9)
BuildRequires: (crate(uuid/v4) >= 0.8 with crate(uuid/v4) < 0.9)
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(log/default) >= 0.4 with crate(log/default) < 0.5)
@ -30,7 +32,7 @@ BuildRequires: (crate(clap/default) >= 3.1 with crate(clap/default) < 4.0)
BuildRequires: (crate(clap/cargo) >= 3.1 with crate(clap/cargo) < 4.0)
BuildRequires: (crate(ctrlc/default) >= 3.2 with crate(ctrlc/default) < 4.0)
BuildRequires: (crate(env_logger/default) >= 0.9 with crate(env_logger/default) < 1.0)
BuildRequires: (crate(nispor/default) >= 1.2.5 with crate(nispor/default) < 2.0)
BuildRequires: (crate(nispor/default) >= 1.2.7 with crate(nispor/default) < 2.0)
%description
Nmstate is a library with an accompanying command line tool that manages host
@ -60,6 +62,13 @@ License: ASL 2.0
%description devel
Development files of nmstate C binding.
%package static
Summary: Static development files for nmstate
Group: Development/Libraries
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
%description static
Static C library bindings for nmstate.
%package -n python3-%{libname}
Summary: nmstate Python 3 API library
@ -100,7 +109,7 @@ which use "%{name}" crate with default feature.
gpg2 --import --import-options import-export,import-minimal \
%{SOURCE2} > ./gpgkey-mantainers.gpg
gpgv2 --keyring ./gpgkey-mantainers.gpg %{SOURCE1} %{SOURCE0}
%setup -q
%autosetup -p1
pushd rust
rm .cargo/config.toml
@ -120,6 +129,7 @@ popd
env SKIP_PYTHON_INSTALL=1 \
PREFIX=%{_prefix} \
LIBDIR=%{_libdir} \
SYSCONFDIR=%{_sysconfdir} \
%make_install
patchelf --set-soname libnmstate.so.2 \
%{buildroot}/%{_libdir}/libnmstate.so.%{version}
@ -137,8 +147,12 @@ popd
%doc examples/
%{_mandir}/man8/nmstatectl.8*
%{_mandir}/man8/nmstate-autoconf.8*
%{_mandir}/man8/nmstate.service.8*
%{_bindir}/nmstatectl
%{_bindir}/nmstate-autoconf
%{_unitdir}/nmstate.service
%dir %{_sysconfdir}/%{name}
%{_sysconfdir}/%{name}/README
%files libs
%{_libdir}/libnmstate.so.*
@ -160,5 +174,8 @@ popd
%files -n rust-%{name}+default-devel
%ghost %{cargo_registry}/%{name}-%{version}/Cargo.toml
%files static
%{_libdir}/libnmstate.a
%changelog
%autochangelog

View File

@ -1,3 +1,3 @@
SHA512 (nmstate-2.1.0.tar.gz) = 52f4f3076e8efc7fb940a999a659488e1162253056e2dcab73cf1cc17e1fe2d8f64b5e5b7d343486eaf61926702a10a1d899ef68adfa19667e610d2ec5b7815c
SHA512 (nmstate-2.1.0.tar.gz.asc) = 044914887be2edea22260a9cee7fd53fc0c3e9fd640aa8fcc353f064a548e23a1ecb6fd09c9d23342f8839c917edfac686ff33c5ac40563802838da3103c7309
SHA512 (nmstate.gpg) = af6af2024ea46b5c87c6c71d4be278ce4eed58c1783385619987fe8e254eb599f9b218897e7db67050b0e9f7101b206561f63218fda18a0d95103a04682c8309
SHA512 (nmstate-2.1.2.tar.gz) = 4c50350f3e9a26420ec90b476230ea2702545666c005cf0d7e95f912f6586248df07fb85e5f8f4972ae1704e5bc104d94377c58f47435c636e04638432c75da2
SHA512 (nmstate-2.1.2.tar.gz.asc) = a05e158ea6c2cebf8453efeaca30cf4cc0e518a065cb392fb49ade6d89df9d804aff3a09a769e77378b1013f70b1b355fc980934d06d217637dcab59f688aedc
SHA512 (nmstate.gpg) = 91c6b1d8aef4944520d4bdd4e90121bbbbaf772444f5eb6081cee81e17b21b66798437cdc09a117c6fc77c54d798aaa30400857aa090cb2102b47841f45cf6eb

67
use_uuid_1_1.patch Normal file
View File

@ -0,0 +1,67 @@
From 56dae17862eb284900439d2af21a715678f3e45a Mon Sep 17 00:00:00 2001
From: Gris Ge <fge@redhat.com>
Date: Mon, 11 Jul 2022 20:51:46 +0800
Subject: [PATCH] nm: Upgrade to uuid 1.1 crate
The uuid crate is upgrade from 0.8 to 1.1. Per Fedora request, we should
upgrade to latest version.
Signed-off-by: Gris Ge <fge@redhat.com>
---
rust/src/cli/Cargo.toml | 2 +-
rust/src/lib/Cargo.toml | 2 +-
rust/src/lib/nm/connection.rs | 2 +-
rust/src/lib/nm/nm_dbus/nm_api.rs | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/rust/src/cli/Cargo.toml b/rust/src/cli/Cargo.toml
index 50d8305b..34bd8fdd 100644
--- a/rust/src/cli/Cargo.toml
+++ b/rust/src/cli/Cargo.toml
@@ -17,4 +17,4 @@ env_logger = "0.9.0"
log = "0.4.14"
serde_json = "1.0.75"
ctrlc = "3.2.1"
-uuid = { version = "0.8", features = ["v4"] }
+uuid = { version = "1.1", features = ["v4"] }
diff --git a/rust/src/lib/Cargo.toml b/rust/src/lib/Cargo.toml
index 718e6e64..767235e2 100644
--- a/rust/src/lib/Cargo.toml
+++ b/rust/src/lib/Cargo.toml
@@ -21,7 +21,7 @@ nispor = "1.2.7"
nix = "0.24.1"
serde = { version = "1.0.132", features = ["derive"] }
serde_json = "1.0.68"
-uuid = { version = "0.8.2", features = ["v4", "v5"] }
+uuid = { version = "1.1", features = ["v4", "v5"] }
zbus = "1.9.2"
zvariant = "2.10.0"
diff --git a/rust/src/lib/nm/connection.rs b/rust/src/lib/nm/connection.rs
index 3a49a9f8..2b85af39 100644
--- a/rust/src/lib/nm/connection.rs
+++ b/rust/src/lib/nm/connection.rs
@@ -509,6 +509,6 @@ fn uuid_from_name_and_type(
&uuid::Uuid::NAMESPACE_URL,
format!("{}://{}", iface_type, iface_name).as_bytes(),
)
- .to_hyphenated()
+ .hyphenated()
.to_string()
}
diff --git a/rust/src/lib/nm/nm_dbus/nm_api.rs b/rust/src/lib/nm/nm_dbus/nm_api.rs
index eb999b78..9b14d342 100644
--- a/rust/src/lib/nm/nm_dbus/nm_api.rs
+++ b/rust/src/lib/nm/nm_dbus/nm_api.rs
@@ -205,7 +205,7 @@ impl<'a> NmApi<'a> {
pub fn uuid_gen() -> String {
// Use Linux random number generator (RNG) to generate UUID
- uuid::Uuid::new_v4().to_hyphenated().to_string()
+ uuid::Uuid::new_v4().hyphenated().to_string()
}
pub fn active_connections_get(
--
2.37.0