diff --git a/.gitignore b/.gitignore index 27e0797..f56cc12 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,5 @@ /nmstate-1.2.0.tar.gz /nmstate-2.0.0.tar.gz /nmstate-2.0.0.tar.gz.asc +/nmstate-2.1.0-alpha1.tar.gz +/nmstate-2.1.0-alpha1.tar.gz.asc diff --git a/nmstate.spec b/nmstate.spec index b749ef5..fc71d4c 100644 --- a/nmstate.spec +++ b/nmstate.spec @@ -1,24 +1,37 @@ -%?python_enable_dependency_generator %define srcname nmstate %define libname libnmstate Name: nmstate -Version: 2.0.0 -Release: 1%{?dist} +Version: 2.1.0 +Release: 0.alpha1%{?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 +Source0: %{url}/releases/download/v%{version}/%{srcname}-%{version}-alpha1.tar.gz +Source1: %{url}/releases/download/v%{version}/%{srcname}-%{version}-alpha1.tar.gz.asc Source2: nmstate.gpg -BuildArch: noarch +BuildRequires: patchelf BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: gnupg2 BuildRequires: systemd-devel BuildRequires: systemd-rpm-macros -Requires: python3-setuptools -Requires: python3-%{libname} = %{?epoch:%{epoch}:}%{version}-%{release} +BuildRequires: rust-packaging +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(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) +BuildRequires: (crate(libc/default) >= 0.2 with crate(libc/default) < 0.3) +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) +Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description Nmstate is a library with an accompanying command line tool that manages host @@ -27,9 +40,28 @@ needs to manage host networking through a northbound declarative API and multi provider support on the southbound. +%package libs +Summary: C binding of nmstate +# Use Recommends for NetworkManager because only access to NM DBus is required, +# but NM could be running on a different host +Recommends: NetworkManager +# Avoid automatically generated profiles +Recommends: NetworkManager-config-server + +%description libs +C binding of nmstate. + +%package devel +Summary: Development files for nmstate +Group: Development/Libraries +Requires: %{name}-libs%{?_isa} = %{version}-%{release} + +%description devel +Development files of nmstate C binding. + + %package -n python3-%{libname} Summary: nmstate Python 3 API library -Requires: NetworkManager-libnm >= 1:1.26.0 # Use Recommends for NetworkManager because only access to NM DBus is required, # but NM could be running on a different host Recommends: NetworkManager @@ -40,243 +72,103 @@ Recommends: (nmstate-plugin-ovsdb if openvswitch) # required for OVS and team support Suggests: NetworkManager-ovs Suggests: NetworkManager-team -# FIXME: Once upstream included nispor into requirement.txt, remove below line -Requires: python3dist(nispor) - -%package -n nmstate-plugin-ovsdb -Summary: nmstate plugin for OVS database manipulation -Requires: python3-%{libname} = %{?epoch:%{epoch}:}%{version}-%{release} -%if 0%{?rhel} -# The python-openvswitch rpm package is not in the same repo with nmstate, -# require only if openvswitch is installed. -Requires: (python3dist(ovs) if openvswitch) -Recommends: python3dist(ovs) -%else -Requires: python3dist(ovs) -%endif - +Provides: nmstate-plugin-ovsdb = %{version}-%{release} +Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Obsoletes: nmstate-plugin-ovsdb < 2.0-1 %description -n python3-%{libname} This package contains the Python 3 library for Nmstate. -%description -n nmstate-plugin-ovsdb -This package contains the nmstate plugin for OVS database manipulation. - %prep -gpg2 --import --import-options import-export,import-minimal %{SOURCE2} > ./gpgkey-mantainers.gpg +gpg2 --import --import-options import-export,import-minimal \ + %{SOURCE2} > ./gpgkey-mantainers.gpg gpgv2 --keyring ./gpgkey-mantainers.gpg %{SOURCE1} %{SOURCE0} %setup -q +pushd rust +rm .cargo/config.toml +%cargo_prep +popd + %build +pushd rust +%cargo_build +popd + +pushd rust/src/python %py3_build +popd %install +# We do manual install here before upstream has it +pushd rust +install -D --mode 0755 target/release/libnmstate.so \ + %{buildroot}/%{_libdir}/libnmstate.so.%{version} +ln -s libnmstate.so.%{version} %{buildroot}/%{_libdir}/libnmstate.so.2 +ln -s libnmstate.so.%{version} %{buildroot}/%{_libdir}/libnmstate.so +patchelf --set-soname libnmstate.so.2 \ + %{buildroot}/%{_libdir}/libnmstate.so.%{version} + +install -D --mode 0755 target/release/nmstatectl-rust \ + %{buildroot}/%{_bindir}/nmstatectl +ln -s nmstatectl %{buildroot}/%{_bindir}/nmstatectl-rust +ln -s nmstatectl %{buildroot}/%{_bindir}/nmstate-autoconf +popd +install -D --mode 0644 nmstatectl.8 \ + %{buildroot}/%{_mandir}/man8/nmstatectl.8 +install -D --mode 0644 nmstate-autoconf.8 \ + %{buildroot}/%{_mandir}/man8/nmstate-autoconf.8 +gzip %{buildroot}/%{_mandir}/man8/nmstatectl.8 +gzip %{buildroot}/%{_mandir}/man8/nmstate-autoconf.8 + +pushd rust/src/python %py3_install +popd + +pushd rust/src/clib +install -D --mode 0644 nmstate.h.in %{buildroot}/%{_includedir}/nmstate.h +MAJOR_VERSION=$(echo %{version} | cut -f1 -d.) +MINOR_VERSION=$(echo %{version} | cut -f2 -d.) +MICRO_VERSION=$(echo %{version} | cut -f3 -d.) +sed -i -e "s#@_VERSION_MAJOR@#${MAJOR_VERSION}#" \ + %{buildroot}/%{_includedir}/nmstate.h +sed -i -e "s#@_VERSION_MINOR@#${MINOR_VERSION}#" \ + %{buildroot}/%{_includedir}/nmstate.h +sed -i -e "s#@_VERSION_MICRO@#${MICRO_VERSION}#" \ + %{buildroot}/%{_includedir}/nmstate.h + +install -D --mode 0644 nmstate.pc.in %{buildroot}/%{_libdir}/pkgconfig/nmstate.pc +sed -i -e "s#@PREFIX@#%{_prefix}#" \ + %{buildroot}/%{_libdir}/pkgconfig/nmstate.pc +sed -i -e "s#@LIBDIR@#%{_libdir}#" \ + %{buildroot}/%{_libdir}/pkgconfig/nmstate.pc +sed -i -e "s#@INCLUDE_DIR@#%{_includedir}#" \ + %{buildroot}/%{_libdir}/pkgconfig/nmstate.pc +sed -i -e "s#@VERSION@#%{version}#" \ + %{buildroot}/%{_libdir}/pkgconfig/nmstate.pc +popd %files %doc README.md %doc examples/ %{_mandir}/man8/nmstatectl.8* %{_mandir}/man8/nmstate-autoconf.8* -%{python3_sitelib}/nmstatectl %{_bindir}/nmstatectl +%{_bindir}/nmstatectl-rust %{_bindir}/nmstate-autoconf +%files libs +%{_libdir}/libnmstate.so.* + +%files devel +%{_libdir}/libnmstate.so +%{_includedir}/nmstate.h +%{_libdir}/pkgconfig/nmstate.pc + %files -n python3-%{libname} %license LICENSE %{python3_sitelib}/%{libname} %{python3_sitelib}/%{srcname}-*.egg-info/ -%exclude %{python3_sitelib}/%{libname}/plugins/nmstate_plugin_* -%exclude %{python3_sitelib}/%{libname}/plugins/__pycache__/nmstate_plugin_* - -%files -n nmstate-plugin-ovsdb -%{python3_sitelib}/%{libname}/plugins/nmstate_plugin_ovsdb* -%{python3_sitelib}/%{libname}/plugins/__pycache__/nmstate_plugin_ovsdb* %changelog -* Mon Feb 15 2022 Fernando Fernandez Mancera - 2.0.0-1 -- Upgrade to 2.0.0 - -* Tue Feb 01 2022 Fernando Fernandez Mancera - 1.2.0-1 -- Upgrade to 1.2.0 - -* Thu Jan 20 2022 Fedora Release Engineering - 1.1.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Tue Jul 27 2021 Gris Ge - 1.1.0-2 -- Add varlink service back. - -* Tue Jul 27 2021 Gris Ge - 1.1.0-1 -- Upgrade to 1.1.0 - -* Thu Jul 22 2021 Fedora Release Engineering - 1.0.3-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Fri Jun 04 2021 Python Maint - 1.0.3-3 -- Rebuilt for Python 3.10 - -* Mon Apr 19 2021 Fernando Fernandez Mancera - 1.0.3-2 -- Fix installation nmstate-varlink.service - -* Thu Apr 15 2021 Fernando Fernandez Mancera - 1.0.3-1 -- Upgrade to 1.0.3 - -* Sun Feb 21 2021 Fernando Fernandez Mancera - 1.0.2-1 -- Upgrade to 1.0.2 - -* Tue Jan 26 2021 Fedora Release Engineering - 1.0.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Tue Jan 19 2021 Fernando Fernandez Mancera - 1.0.1-1 -- Upgrade to 1.0.1 - -* Tue Dec 08 2020 Fernando Fernandez Mancera - 1.0.0-1 -- Upgrade to 1.0.0 - -* Thu Oct 22 2020 Fernando Fernandez Mancera - 0.4.1-1 -- Upgrade to 0.4.1 - -* Tue Oct 13 2020 Gris Ge - 0.4.0-2 -- Fix the ELN build by put ovs stuff as soft requirement. - -* Sun Sep 20 2020 Gris Ge - 0.4.0-1 -- Upgrade to 0.4.0 - -* Mon Aug 31 2020 Fernando Fernandez Mancera - 0.3.5-1 -- Update to 0.3.5 - -* Tue Jul 28 2020 Fedora Release Engineering - 0.3.4-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Sat Jul 25 2020 Fernando Fernandez Mancera - 0.3.4-1 -- Update to 0.3.4 -- Sync. with upstream specfile - -* Thu Jul 02 2020 Fernando Fernandez Mancera - 0.3.3-1 -- Update to 0.3.3 - -* Tue Jun 16 2020 Fernando Fernandez Mancera - 0.3.2-1 -- Update to 0.3.2 -- Sync with upstream specfile - -* Tue Jun 09 2020 Fernando Fernandez Mancera - 0.3.1-1 -- Update to 0.3.1 - -* Tue May 26 2020 Miro Hrončok - 0.3.0-5 -- Rebuilt for Python 3.9 - -* Fri May 08 2020 Fernando Fernandez Mancera - 0.3.0-4 -- Fix source path - -* Fri May 08 2020 Fernando Fernandez Mancera - 0.3.0-3 -- Fix signature verification - -* Fri May 08 2020 Fernando Fernandez Mancera - 0.3.0-2 -- Update signature verification - -* Fri May 08 2020 Fernando Fernandez Mancera - 0.3.0-1 -- Update to 0.3.0 -- Sync with upstream specfile - -* Tue Apr 21 2020 Fernando Fernandez Mancera - 0.2.10-1 -- Update to 0.2.10 - -* Thu Mar 26 2020 Fernando Fernandez Mancera - 0.2.9-1 -- Update to 0.2.9 - -* Fri Mar 13 2020 Fernando Fernandez Mancera - 0.2.8-1 -- Update to 0.2.8 - -* Wed Mar 04 2020 Fernando Fernandez Mancera - 0.2.7-1 -- Update to 0.2.7 - -* Mon Feb 24 2020 Fernando Fernandez Mancera - 0.2.6-1 -- Update to 0.2.6 - -* Wed Feb 19 2020 Fernando Fernandez Mancera - 0.2.5-1 -- Update to 0.2.5 -- Sync with upstream specfile - -* Wed Feb 12 2020 Fernando Fernandez Mancera - 0.2.4-1 -- Update to 0.2.4 - -* Wed Feb 05 2020 Fernando Fernandez Mancera - 0.2.3-1 -- Update to 0.2.3 - -* Tue Feb 04 2020 Fernando Fernandez Mancera - 0.2.2-1 -- Update to 0.2.2 -- Sync with upstream specfile - -* Wed Jan 29 2020 Fedora Release Engineering - 0.2.1-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Tue Jan 14 2020 Fernando Fernandez Mancera - 0.2.1-2 -- Fix changelog - -* Tue Jan 14 2020 Fernando Fernandez Mancera - 0.2.1-1 -- Update to 0.2.1 - -* Tue Dec 03 2019 Fernando Fernandez Mancera - 0.2.0-2 -- Fix changelog - -* Tue Dec 03 2019 Fernando Fernandez Mancera - 0.2.0-1 -- Update to 0.2.0 - -* Mon Dec 02 2019 Till Maas - 0.1.1-1 -- Update to 0.1.1 -- Sync with upstream specfile - -* Thu Oct 03 2019 Miro Hrončok - 0.0.8-3 -- Rebuilt for Python 3.8.0rc1 (#1748018) - -* Mon Aug 19 2019 Miro Hrončok - 0.0.8-2 -- Rebuilt for Python 3.8 - -* Fri Jul 26 2019 Gris Ge - 0.0.8-1 -- Upgrade to 0.0.8. - -* Thu Jul 25 2019 Fedora Release Engineering - 0.0.7-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Fri Jun 14 2019 Gris Ge - 0.0.7-2 -- Workaround broken dbus-python packaging: - https://bugzilla.redhat.com/show_bug.cgi?id=1654774 - -* Fri Jun 14 2019 Gris Ge - 0.0.7-1 -- Upgrade to 0.0.7 - -* Sun May 05 2019 Gris Ge - 0.0.6-1 -- Upgrade to 0.0.6 - -* Fri Apr 12 2019 Gris Ge - 0.0.5-1 -- Upgrade to 0.0.5 - -* Fri Feb 01 2019 Fedora Release Engineering - 0.0.4-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Tue Jan 29 2019 Till Maas - 0.0.4-2 -- Sync with upstream spec -- Use Recommends for NetworkManager -- Add Suggests for NetworkManager-ovs -- package examples as doc - -* Thu Jan 24 2019 Gris Ge - 0.0.4-1 -- Upgrade to 0.0.4. - -* Mon Jan 21 2019 Gris Ge - 0.0.3-3 -- Add missing runtime dependency for nmstatectl. - -* Wed Jan 02 2019 Gris Ge - 0.0.3-2 -- Add source file PGP verification. - -* Thu Dec 20 2018 Gris Ge - 0.0.3-1 -- Upgrade to 0.0.3. - -* Mon Dec 03 2018 Gris Ge - 0.0.2-2 -- Trival RPM SPEC fix. - -* Wed Nov 28 2018 Gris Ge - 0.0.2-1 -- Initial release. +%autochangelog diff --git a/sources b/sources index 056ed32..3ac99ab 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (nmstate-2.0.0.tar.gz) = bbc0c4c52e73646b8461e61b049f96ef1f0bce8815284e7560e65daddb177bef36cf5ec074837f6a07e6b3c8ce8ed7f13cb9b4d1b45527e6076188a762b933c6 -SHA512 (nmstate-2.0.0.tar.gz.asc) = 8d9beb2d772a5d654e4fbce492ff95792edc42e6047552d745f033552d4206a64e9a0aeff1e437d0f683fbe89f8c061c7b02f88cf79607784889845b6cd9365b +SHA512 (nmstate-2.1.0-alpha1.tar.gz) = 540121a850a070f4e19591d05027c4b1f596d9b40599f3c667f7b4e9dbe8d84269b94867fbf48891add4b86d731e139931d304b3437555b4edd26cbad389409a +SHA512 (nmstate-2.1.0-alpha1.tar.gz.asc) = b9930f6baa19faf2e86c7f0659ea461f9c7fe6f1e8f370febe9565838e66e6edaf4e7a3c0fda9cf06ea670e7fd4bb67222be9be9f6796828616a2b8d87d611c9 SHA512 (nmstate.gpg) = af6af2024ea46b5c87c6c71d4be278ce4eed58c1783385619987fe8e254eb599f9b218897e7db67050b0e9f7101b206561f63218fda18a0d95103a04682c8309