%global _hardened_build 1 # Ubuntu called their own software nplan in the archive due to name conflicts %global old_ubuntu_name nplan # Ubuntu calls their own software netplan.io in the archive due to name conflicts %global ubuntu_name netplan.io # If the definition isn't available for python3_pkgversion, define it %{?!python3_pkgversion:%global python3_pkgversion 3} # If this isn't defined, define it %{?!_systemdgeneratordir:%global _systemdgeneratordir /usr/lib/systemd/system-generators} # Force auto-byte-compilation to Python 3 %global __python %{__python3} #global snapdate 20180313 %global commit fefbe675c053fd7d7f0f231c0e0ebf263e8aa9bb %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: netplan Version: 0.40.2%{?snapdate:+git%{snapdate}.%{shortcommit}} Release: 0%{?dist}.1 Summary: Network configuration tool using YAML License: GPLv3 URL: http://netplan.io/ %if 0%{?snapdate} Source0: https://github.com/CanonicalLtd/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz %else Source0: https://github.com/CanonicalLtd/%{name}/archive/%{version}/%{name}-%{version}.tar.gz %endif # Backports from upstream Patch0001: 0001-Makefile-Locate-the-correct-nosetests-binary-on-RPM-.patch BuildRequires: pkgconfig(bash-completion) BuildRequires: pkgconfig(systemd) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(yaml-0.1) BuildRequires: pkgconfig(uuid) BuildRequires: gcc BuildRequires: make BuildRequires: %{_bindir}/pandoc BuildRequires: python%{python3_pkgversion}-devel # For tests BuildRequires: python%{python3_pkgversion}-coverage BuildRequires: python%{python3_pkgversion}-netifaces BuildRequires: python%{python3_pkgversion}-nose BuildRequires: python%{python3_pkgversion}-pycodestyle BuildRequires: python%{python3_pkgversion}-pyflakes BuildRequires: python%{python3_pkgversion}-yaml # /usr/sbin/netplan is a Python 3 script that requires netifaces and PyYAML Requires: python%{python3_pkgversion}-netifaces Requires: python%{python3_pkgversion}-yaml # netplan supports either systemd or NetworkManager as backends to configure the network Requires: systemd %if 0%{?el7} # systemd-networkd is a separate subpackage in EL7 Requires: systemd-networkd %endif %if 0%{?fedora} || 0%{?mageia} || 0%{?rhel} >= 8 Recommends: NetworkManager %endif # For handling Wi-Fi networks Requires: wpa_supplicant # Provide the package name that Ubuntu uses for it too... Obsoletes: %{old_ubuntu_name} < %{version}-%{release} Provides: %{old_ubuntu_name} = %{version}-%{release} Provides: %{old_ubuntu_name}%{?_isa} = %{version}-%{release} Provides: %{ubuntu_name} = %{version}-%{release} Provides: %{ubuntu_name}%{?_isa} = %{version}-%{release} %description netplan reads network configuration from /etc/nplan/*.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 %if 0%{?snapdate} %autosetup -n %{name}-%{commit} -p1 %else %autosetup -p1 %endif # Drop -Werror to avoid the following: # /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: 'ip_str' may be used uninitialized in this function [-Werror=maybe-uninitialized] sed -e "s/-Werror//g" -i Makefile %build %make_build CFLAGS="%{optflags}" %install %make_install ROOTPREFIX=%{_prefix} # Pre-create the config directory mkdir -p %{buildroot}%{_sysconfdir}/%{name} %check make check %{?el7:NOSETESTS3=/usr/bin/nosetests-%{python3_version}} %files %license COPYING %doc debian/changelog %doc %{_docdir}/%{name}/ %{_sbindir}/%{name} %{_datadir}/%{name}/ %{_unitdir}/%{name}*.service %{_systemdgeneratordir}/%{name} %{_mandir}/man5/%{name}.5* %{_mandir}/man8/%{name}-*.8* %dir %{_sysconfdir}/%{name} %{_prefix}/lib/%{name}/ %{_datadir}/bash-completion/completions/%{name} %changelog * Sat Oct 13 2018 Neal Gompa - 0.40.2-0.1 - Rebase to 0.40.2 * Sun Mar 18 2018 Neal Gompa - 0.34-0.2 - Backported upstreamed version of patch to fix build on Fedora * Tue Mar 13 2018 Neal Gompa - 0.34-0.1 - Update to 0.34 * Wed Mar 7 2018 Neal Gompa - 0.33-0.1 - Rebase to 0.33 * Sat Nov 4 2017 Neal Gompa - 0.30-1 - Rebase to 0.30 * Sun Jul 2 2017 Neal Gompa - 0.23~17.04.1-1 - Initial packaging