|
| 1 | +# Ubuntu calls their own software netplan.io in the archive due to name conflicts |
| 2 | +%global ubuntu_name netplan.io |
| 3 | + |
| 4 | +# If the definition isn't available for python3_pkgversion, define it |
| 5 | +%global python3_pkgversion 3 |
| 6 | + |
| 7 | +# If this isn't defined, define it |
| 8 | +%{?!_systemdgeneratordir:%global _systemdgeneratordir /usr/lib/systemd/system-generators} |
| 9 | + |
| 10 | +# Force auto-byte-compilation to Python 3 |
| 11 | +%global __python %{__python3} |
| 12 | + |
| 13 | + |
| 14 | +Name: netplan |
| 15 | +Version: 0.95 |
| 16 | +Release: 1%{?dist} |
| 17 | +Summary: Network configuration tool using YAML |
| 18 | +Group: System Environment/Base |
| 19 | +Vendor: Microsoft Corporation |
| 20 | +Distribution: Mariner |
| 21 | +License: GPLv3 |
| 22 | +URL: https://netplan.io/ |
| 23 | +# Source0: https://github.com/canonical/%{name}/archive/%{version}/%{version}.tar.gz |
| 24 | +Source0: %{name}-%{version}.tar.gz |
| 25 | + |
| 26 | +BuildRequires: gcc |
| 27 | +BuildRequires: make |
| 28 | +BuildRequires: bash-completion-devel |
| 29 | +BuildRequires: libgcc-devel |
| 30 | +BuildRequires: bash-devel |
| 31 | +BuildRequires: systemd-devel |
| 32 | +BuildRequires: glib-devel |
| 33 | +BuildRequires: libyaml-devel |
| 34 | +BuildRequires: util-linux-devel |
| 35 | +BuildRequires: python%{python3_pkgversion}-devel |
| 36 | +# For tests |
| 37 | +BuildRequires: iproute |
| 38 | +BuildRequires: python%{python3_pkgversion}-coverage |
| 39 | +BuildRequires: python%{python3_pkgversion}-netifaces |
| 40 | +BuildRequires: python%{python3_pkgversion}-pycodestyle |
| 41 | +BuildRequires: python%{python3_pkgversion}-PyYAML |
| 42 | + |
| 43 | +# /usr/sbin/netplan is a Python 3 script that requires netifaces and PyYAML |
| 44 | +Requires: python%{python3_pkgversion}-netifaces |
| 45 | +Requires: python%{python3_pkgversion}-PyYAML |
| 46 | +# 'ip' command is used in netplan apply subcommand |
| 47 | +Requires: iproute |
| 48 | + |
| 49 | +# netplan supports either systemd or NetworkManager as backends to configure the network |
| 50 | +Requires: systemd |
| 51 | +Requires: wpa_supplicant |
| 52 | + |
| 53 | +%description |
| 54 | +netplan reads network configuration from /etc/netplan/*.yaml which are written by administrators, |
| 55 | +installers, cloud image instantiations, or other OS deployments. During early boot, it generates |
| 56 | +backend specific configuration files in /run to hand off control of devices to a particular |
| 57 | +networking daemon. |
| 58 | + |
| 59 | +Currently supported backends are systemd-networkd and NetworkManager. |
| 60 | + |
| 61 | + |
| 62 | +%prep |
| 63 | +%autosetup -p1 |
| 64 | + |
| 65 | +# Drop -Werror to avoid the following error: |
| 66 | +# /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: 'ip_str' may be used uninitialized in this function [-Werror=maybe-uninitialized] |
| 67 | +sed -e "s/-Werror//g" -i Makefile |
| 68 | +# Do not use Pandoc to format documentation |
| 69 | +sed -e "s/pandoc/echo pandoc/g" -i Makefile |
| 70 | +cp doc/netplan.md doc/netplan.5 |
| 71 | +cp doc/netplan.md doc/netplan.html |
| 72 | +# No man8 files only man5 files are generated |
| 73 | +sed -e "s/*.8/*.5/g" -i Makefile |
| 74 | +sed -e "s/man8/man5/g" -i Makefile |
| 75 | + |
| 76 | +%build |
| 77 | +%make_build CFLAGS="%{optflags}" |
| 78 | + |
| 79 | + |
| 80 | +%install |
| 81 | +%make_install ROOTPREFIX=%{_prefix} |
| 82 | + |
| 83 | +# Pre-create the config directory |
| 84 | +mkdir -p %{buildroot}%{_sysconfdir}/%{name} |
| 85 | +# Invalid symlink. Make it correct symlink |
| 86 | +rm -r %{buildroot}%{_systemdgeneratordir}/%{name} |
| 87 | +ln -s %{_libdir}/netplan/generate %{buildroot}%{_systemdgeneratordir}/%{name} |
| 88 | + |
| 89 | +%check |
| 90 | +make check |
| 91 | + |
| 92 | +%files |
| 93 | +%license COPYING |
| 94 | +%doc debian/changelog |
| 95 | +%doc %{_docdir}/%{name}/ |
| 96 | +%{_sbindir}/%{name} |
| 97 | +%{_datadir}/%{name}/ |
| 98 | +%{_unitdir}/%{name}*.service |
| 99 | +%{_systemdgeneratordir}/%{name} |
| 100 | +%{_mandir}/man5/%{name}.5* |
| 101 | +%dir %attr(0755, root, root) %{_sysconfdir}/%{name} |
| 102 | +%{_prefix}/lib/%{name}/ |
| 103 | +%{_datadir}/bash-completion/completions/%{name} |
| 104 | + |
| 105 | + |
| 106 | +%changelog |
| 107 | +* Fri Sep 17 2021 Suresh Babu Chalamalasetty <[email protected]> - 0.95-1 |
| 108 | +- Initial CBL-Mariner import from Netplan source (license: GPLv3) |
| 109 | +- License verified |
| 110 | +- Update netplan to Netplan |
| 111 | + |
| 112 | +* Fri Dec 14 2018 Mathieu Trudel-Lapierre <[email protected]> - 0.95 |
| 113 | +- Update to 0.95 |
| 114 | + |
| 115 | +* Sat Oct 13 2018 Neal Gompa <[email protected]> - 0.40.3-0 |
| 116 | +- Rebase to 0.40.3 |
| 117 | + |
| 118 | +* Tue Mar 13 2018 Neal Gompa <[email protected]> - 0.34-0.1 |
| 119 | +- Update to 0.34 |
| 120 | + |
| 121 | +* Wed Mar 7 2018 Neal Gompa <[email protected]> - 0.33-0.1 |
| 122 | +- Rebase to 0.33 |
| 123 | + |
| 124 | +* Sat Nov 4 2017 Neal Gompa <[email protected]> - 0.30-1 |
| 125 | +- Rebase to 0.30 |
| 126 | + |
| 127 | +* Sun Jul 2 2017 Neal Gompa <[email protected]> - 0.23~17.04.1-1 |
| 128 | +- Initial packaging |
0 commit comments