From 918609aaf83cf378a3ed358e91ef7745a6c2bdb5 Mon Sep 17 00:00:00 2001 From: Gris Ge Date: Fri, 10 Dec 2021 15:35:36 +0800 Subject: [PATCH] Upgrade to 2.0.0 alpha 4 Resolves: RHBZ#1996575 Signed-off-by: Gris Ge --- .gitignore | 3 +++ nmstate.spec | 66 ++++++++++++++++++++++++++++++++++++++++++++++++---- sources | 5 ++-- 3 files changed, 68 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index e193298..3c5910f 100644 --- a/.gitignore +++ b/.gitignore @@ -69,3 +69,6 @@ /nmstate-2.0.0-alpha2.tar.gz.asc /nmstate-2.0.0-alpha3.tar.gz /nmstate-2.0.0-alpha3.tar.gz.asc +/nmstate-2.0.0-alpha4.tar.gz +/nmstate-2.0.0-alpha4.tar.gz.asc +/nmstate-rust-vendor-2.0.0-alpha4.tar.xz diff --git a/nmstate.spec b/nmstate.spec index 6117fad..9235942 100644 --- a/nmstate.spec +++ b/nmstate.spec @@ -4,17 +4,19 @@ Name: nmstate Version: 2.0.0 -Release: 0.4.alpha3%{?dist} +Release: 0.1.alpha4%{?dist} Summary: Declarative network manager API License: LGPLv2+ URL: https://github.com/%{srcname}/%{srcname} -Source0: %{url}/releases/download/v%{version}/%{srcname}-%{version}-alpha3.tar.gz -Source1: %{url}/releases/download/v%{version}/%{srcname}-%{version}-alpha3.tar.gz.asc +Source0: %{url}/releases/download/v%{version}/%{srcname}-%{version}-alpha4.tar.gz +Source1: %{url}/releases/download/v%{version}/%{srcname}-%{version}-alpha4.tar.gz.asc Source2: nmstate.gpg -BuildArch: noarch +Source3: nmstate-rust-vendor-%{version}-alpha4.tar.xz BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: gnupg2 +BuildRequires: rust-toolset +BuildRequires: pkg-config Requires: python3-setuptools Requires: python3-%{libname} = %{?epoch:%{epoch}:}%{version}-%{release} @@ -53,6 +55,21 @@ Recommends: python3dist(ovs) Requires: python3dist(ovs) %endif +%package libs +Summary: C binding of nmstate +License: ASL 2.0 + +%package devel +Summary: C binding development files of nmstate +License: ASL 2.0 +Requires: nmstate-libs%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} + +%description libs +This package contains the C binding of nmstate. + +%description devel +This package contains the C binding development files of nmstate. + %description -n python3-%{libname} This package contains the Python 3 library for Nmstate. @@ -65,11 +82,32 @@ gpg2 --import --import-options import-export,import-minimal %{SOURCE2} > ./gpgke gpgv2 --keyring ./gpgkey-mantainers.gpg %{SOURCE1} %{SOURCE0} %setup -q +pushd rust +# Source3 is vendored dependencies +%cargo_prep -V 3 + +# The cargo_prep will create `.cargo/config` which take precedence over +# `.cargo/config.toml` shipped by upstream which fix the SONAME of cdylib. +# To workaround that, merge upstream rustflags into cargo_prep created one. +_FLAGS=`sed -ne 's/rustflags = "\(.\+\)"/\1/p' .cargo/config.toml` +sed -i -e "s/rustflags = \[\(.\+\), \]$/rustflags = [\1, \"$_FLAGS\"]/" \ + .cargo/config +rm .cargo/config.toml + +popd + %build %py3_build +pushd rust +make +popd + %install %py3_install +pushd rust +env SKIP_PYTHON_INSTALL=1 PREFIX=%{_prefix} LIBDIR=%{_libdir} %make_install +popd %files %doc README.md @@ -79,6 +117,7 @@ gpgv2 --keyring ./gpgkey-mantainers.gpg %{SOURCE1} %{SOURCE0} %{python3_sitelib}/nmstatectl %{_bindir}/nmstatectl %{_bindir}/nmstate-autoconf +%{_bindir}/nmstatectl-rust %files -n python3-%{libname} %license LICENSE @@ -91,7 +130,26 @@ gpgv2 --keyring ./gpgkey-mantainers.gpg %{SOURCE1} %{SOURCE0} %{python3_sitelib}/%{libname}/plugins/nmstate_plugin_ovsdb* %{python3_sitelib}/%{libname}/plugins/__pycache__/nmstate_plugin_ovsdb* +%files libs +%license rust/LICENSE +%{_libdir}/libnmstate.so.* + +%files devel +%license LICENSE +%{_libdir}/libnmstate.so +%{_includedir}/nmstate.h +%{_libdir}/pkgconfig/nmstate.pc + +%post libs +/sbin/ldconfig + +%postun libs +/sbin/ldconfig + %changelog +* Thu Dec 09 2021 Gris Ge - 2.0.0-0.1.alpha4 +- Upgrade to 2.0.0 alpha 4. Resolves: RHBZ#1996575 + * Thu Sep 23 2021 Ana Cabral - 2.0.0-0.4.alpha3 - Upgrade to 2.0.0 alpha 3. Resolves: RHBZ#1996575 - Remove connection renaming behaviour. Resolves: RHBZ#1998222 diff --git a/sources b/sources index 6bcf3a6..a1a36d4 100644 --- a/sources +++ b/sources @@ -1,3 +1,4 @@ -SHA512 (nmstate-2.0.0-alpha3.tar.gz) = 17a146f68c764722091c7fb57079f0ebef24e5def01cbb2694b0df035c8e600e16d238566c323318b5dc959b74675394995e840c170ee7207c2b142ecca42067 -SHA512 (nmstate-2.0.0-alpha3.tar.gz.asc) = 2beee74af7c040bdc2a44500dfd78bf8ed3d4bd7d8b4b768713d3ec509fbf2bad4b0a7e61c77d70657a99e02ee284ee0b05cbe3dee4ab6a15f0d13338a47084c +SHA512 (nmstate-2.0.0-alpha4.tar.gz) = 1ff627e6f8a8ce59f16282273c80f48807b3228fd9607d35b397ca326fc56209685e6db148036bfd70bdaf55c6c6caee7a3c68928141c98c137e53e8dc37c99b +SHA512 (nmstate-2.0.0-alpha4.tar.gz.asc) = 6989ec51a506c64dc275a1434cc5e7b7167b41d3dbdc49443e2cc2b19cebd339ce72d7f5ffb54370bc56433e8b797961036036ee79df1765d8b4595f70090da9 +SHA512 (nmstate-rust-vendor-2.0.0-alpha4.tar.xz) = 302d7b2f09cfec0d107a68fb6526c802bbd3bd45857dfd9dcc94f162b743351d3846259b8962bfce2c2bc433c00a1fb081167cd10f0eeedb860e78891acfba23 SHA512 (nmstate.gpg) = af6af2024ea46b5c87c6c71d4be278ce4eed58c1783385619987fe8e254eb599f9b218897e7db67050b0e9f7101b206561f63218fda18a0d95103a04682c8309