加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
netplan.spec 5.13 KB
一键复制 编辑 原始数据 按行查看 历史
ZoeDong 提交于 2024-09-20 16:08 . Fix netplan import fail
%global libsomajor 1
%bcond_with doc
Summary: Network configuration tool using YAML
Name: netplan
Version: 1.1
Release: 1%{?dist}
License: GPL-3.0-only
URL: http://netplan.io/
Source0: https://github.com/canonical/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
BuildRequires: gcc meson
BuildRequires: pkgconfig(bash-completion) pkgconfig(glib-2.0) pkgconfig(gio-2.0) pkgconfig(libsystemd)
BuildRequires: pkgconfig(systemd) pkgconfig(yaml-0.1) pkgconfig(uuid) python3-devel python3-cffi
BuildRequires: python3dist(coverage) python3dist(netifaces) python3dist(pycodestyle) python3dist(pyflakes)
BuildRequires: python3dist(pytest) python3dist(pytest-cov) python3dist(pyyaml) python3dist(rich)
BuildRequires: pkgconfig(cmocka) python3-dbus
BuildRequires: systemd-rpm-macros systemd-udev
BuildRequires: dbus-x11
BuildRequires: %{_bindir}/find
BuildRequires: %{_sbindir}/ip
BuildRequires: %{_bindir}/ovs-vsctl
%if %{with doc}
BuildRequires: %{_bindir}/pandoc
%endif
Requires: python3dist(netifaces) python3dist(pyyaml) python3dist(rich)
Requires: %{_sbindir}/ip
Requires: dbus-common
Requires: %{name}-libs = %{version}-%{release}
Requires: %{name}-default-backend
Suggests: %{name}-default-backend-NetworkManager
%description
netplan reads network configuration from /etc/netplan/*.yaml which are written by administrators,
installers, cloud image instantiations, or other OS deployments. During early boot, it generates
backend specific configuration files in /run to hand off control of devices to a particular
networking daemon.
Currently supported backends are NetworkManager and systemd-networkd.
%package libs
Summary: Network configuration tool using YAML (core library)
%description libs
netplan reads network configuration from /etc/netplan/*.yaml which are written by administrators,
installers, cloud image instantiations, or other OS deployments. During early boot, it generates
backend specific configuration files in /run to hand off control of devices to a particular
networking daemon.
This package provides Netplan's core libraries.
%package devel
Summary: Network configuration tool using YAML (development files)
Requires: %{name}-libs = %{version}-%{release}
%description devel
netplan reads network configuration from /etc/netplan/*.yaml which are written by administrators,
installers, cloud image instantiations, or other OS deployments. During early boot, it generates
backend specific configuration files in /run to hand off control of devices to a particular
networking daemon.
This package provides development headers and libraries for building applications using Netplan.
%package default-backend-NetworkManager
Summary: Network configuration tool using YAML (NetworkManager backend)
Requires: %{name} = %{version}-%{release}
Requires: NetworkManager
Requires: NetworkManager-config-server
Recommends: (NetworkManager-wifi if linux-firmware)
Suggests: NetworkManager-wifi
Conflicts: %{name}-default-backend
Provides: %{name}-default-backend
BuildArch: noarch
%description default-backend-NetworkManager
netplan reads network configuration from /etc/netplan/*.yaml which are written by administrators,
installers, cloud image instantiations, or other OS deployments. During early boot, it generates
backend specific configuration files in /run to hand off control of devices to a particular
networking daemon.
This package configures Netplan to use NetworkManager as its backend.
%prep
%autosetup -p1
sed -e "s/werror=true/werror=false/g" -i meson.build
sed -i 's/egrep/grep -E/g' tests/validate_docs.sh
%build
%meson
%meson_build
%install
%meson_install
mkdir -p %{buildroot}%{_sysconfdir}/%{name}
mkdir -p %{buildroot}%{_prefix}/lib/%{name}
mv %{buildroot}%{python3_sitelib}/%{name}/* %{buildroot}%{python3_sitearch}/%{name}/
cat > %{buildroot}%{_prefix}/lib/%{name}/00-netplan-default-renderer-nm.yaml <<EOF
network:
renderer: NetworkManager
EOF
%check
%meson_test
%clean
rm -rf %{buildroot}/usr/lib/python3.11/site-packages/netplan/__pycache__
%files
%license COPYING
%doc %{_docdir}/%{name}/
%{_sbindir}/%{name}
%{_datadir}/%{name}/
%{_datadir}/dbus-1/system-services/io.netplan.Netplan.service
%{_datadir}/dbus-1/system.d/io.netplan.Netplan.conf
%{_systemdgeneratordir}/%{name}
%if %{with doc}
%{_mandir}/man5/%{name}.5*
%{_mandir}/man8/%{name}*.8*
%endif
%dir %{_sysconfdir}/%{name}
%dir %{_prefix}/lib/%{name}
%{_libexecdir}/%{name}/
%{_datadir}/bash-completion/completions/%{name}
%{python3_sitearch}/%{name}/
%files libs
%license COPYING
%{_libdir}/libnetplan.so.%{libsomajor}{,.*}
%files devel
%{_includedir}/%{name}/
%{_libdir}/libnetplan.so
%{_libdir}/pkgconfig/%{name}.pc
%files default-backend-NetworkManager
%{_prefix}/lib/%{name}/00-netplan-default-renderer-nm.yaml
%changelog
* Thu Sep 19 2024 Miaojun Dong <zoedong@tencent.com> - 1.1-1
- Upgrade version to 1.1 (Fix CVE-2022-4968)
* Fri Aug 16 2024 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 0.106-2
- Rebuilt for loongarch release
* Mon Nov 20 2023 Miaojun Dong <zoedong@tencent.com> - 0.106-1
- Initial Build
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化