File netplan.spec of Package netplan

#
# spec file for package netplan
#
# Copyright (c) 2021, Martin Hauke <mardnh@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           netplan
Version:        0.103
Release:        0
Summary:        Network configuration tool using YAML
License:        GPL-3.0-or-later
Group:          System/Base
#Git-Clone:     https://github.com/canonical/netplan.git
URL:            https://netplan.io/
Source:         https://github.com/canonical/%{name}/archive/%{version}/%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires:  gcc
BuildRequires:  pandoc
BuildRequires:  pkgconfig
BuildRequires:  python3-PyYAML
BuildRequires:  python3-coverage
BuildRequires:  python3-netifaces
BuildRequires:  python3-nose
BuildRequires:  python3-pycodestyle
BuildRequires:  python3-pyflakes
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(libsystemd)
BuildRequires:  pkgconfig(uuid)
BuildRequires:  pkgconfig(yaml-0.1)
Requires:       iproute2
Requires:       python3-PyYAML
Requires:       python3-netifaces
Requires:       systemd-network
Suggests:       NetworkManager
Suggests:       wpa_supplicant

%description
netplan reads network configuration from %{_sysconfdir}/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 systemd-networkd and NetworkManager.

%prep
%setup -q

%build
%make_build CFLAGS="%{optflags}" LIBDIR=%{_libdir} DOCDIR=%{_docdir}

%install
%make_install LIBDIR=%{_libdir} DOCDIR=%{_docdir}
install -d %{buildroot}%{_sysconfdir}/%{name}

%check
%make_build check

%files
%license COPYING
%doc README.md
%doc %{_docdir}/%{name}
%{_sbindir}/%{name}
%{_mandir}/man5/%{name}.5%{?ext_man}
%{_mandir}/man8/%{name}*.8%{?ext_man}
%dir %{_sysconfdir}/%{name}
%{_datadir}/netplan/
%{_libdir}/libnetplan.so.*
# wrong dir
%{_sysconfdir}/bash_completion.d/netplan
# devel
%{_libdir}/libnetplan.so
%{_includedir}/%{name}/
# dbus (wrong dir)
%dir /lib/netplan
/lib/netplan/generate
/lib/netplan/netplan-dbus
%dir %{_datadir}/dbus-1/
%dir %{_datadir}/dbus-1/system-services/
%dir %{_datadir}/dbus-1/system.d
%{_datadir}/dbus-1/system-services/io.netplan.Netplan.service
%{_datadir}/dbus-1/system.d/io.netplan.Netplan.conf
# wtf (wrong dir)
/netplan

%changelog
openSUSE Build Service is sponsored by