8
8
%global libsomajor 1
9
9
10
10
# networkd is not available everywhere
11
- %if 0%{?rhel }
11
+ %if 0%{?rhel } && ! 0%{? epel }
12
12
%bcond_with networkd_support
13
13
%else
14
14
%bcond_without networkd_support
15
15
%endif
16
16
17
+ %bcond_with tests
18
+
17
19
Name: netplan
18
- Version: 0.106
19
- Release: 0 %{?dist }
20
+ Version: 1.1.2
21
+ Release: 1 %{?dist }
20
22
Summary: Network configuration tool using YAML
21
- Group: System Environment/Base
22
23
License: GPL-3.0 -only
23
24
URL: http://netplan.io/
24
25
Source0: https://github.com/canonical/%{name }/archive/%{version }/%{name }-%{version }.tar.gz
25
26
26
27
BuildRequires: gcc
27
- BuildRequires: meson >= 0.61
28
+ BuildRequires: meson
28
29
BuildRequires: pkgconfig(bash-completion)
29
30
BuildRequires: pkgconfig(glib-2.0)
30
31
BuildRequires: pkgconfig(gio-2.0)
@@ -33,29 +34,24 @@ BuildRequires: pkgconfig(systemd)
33
34
BuildRequires: pkgconfig(yaml-0.1)
34
35
BuildRequires: pkgconfig(uuid)
35
36
BuildRequires: python3-devel
36
- BuildRequires: python3-cffi
37
37
BuildRequires: systemd-rpm-macros
38
38
BuildRequires: %{_bindir }/pandoc
39
- BuildRequires: %{_bindir }/find
39
+ BuildRequires: python3dist(cffi)
40
+ %if %{with tests }
40
41
# For tests
41
42
BuildRequires: %{_sbindir }/ip
42
- BuildRequires: pkgconfig(cmocka)
43
+ BuildRequires: libcmocka-devel
43
44
BuildRequires: python3dist(coverage)
44
- BuildRequires: dbus-x11
45
+ BuildRequires: python3dist(pytest)
45
46
BuildRequires: python3dist(netifaces)
46
47
BuildRequires: python3dist(pycodestyle)
47
48
BuildRequires: python3dist(pyflakes)
48
- BuildRequires: python3dist(pytest)
49
- BuildRequires: python3dist(pytest-cov)
50
49
BuildRequires: python3dist(pyyaml)
51
- BuildRequires: python3dist(rich)
52
- BuildRequires: %{_bindir }/ovs-vsctl
53
- BuildRequires: systemd-udev
50
+ %endif
54
51
55
- # /usr/sbin/netplan is a Python 3 script that requires Python modules
52
+ # /usr/sbin/netplan is a Python 3 script that requires netifaces and PyYAML
56
53
Requires: python3dist(netifaces)
57
54
Requires: python3dist(pyyaml)
58
- Requires: python3dist(rich)
59
55
# 'ip' command is used in netplan apply subcommand
60
56
Requires: %{_sbindir }/ip
61
57
# netplan ships dbus files
@@ -69,10 +65,15 @@ Suggests: %{name}-default-backend-NetworkManager
69
65
# Netplan requires its core libraries
70
66
Requires: %{name }-libs%{?_isa } = %{version }-%{release }
71
67
68
+ # Python bindings are in their own package but are required for CLI
69
+ Requires: python3-%{name }%{?_isa } = %{version }-%{release }
70
+
72
71
# Provide the package name that Ubuntu uses for it too...
73
72
Provides: %{ubuntu_name } = %{version }-%{release }
74
73
Provides: %{ubuntu_name }%{?_isa } = %{version }-%{release }
75
74
75
+
76
+
76
77
%description
77
78
netplan reads network configuration from /etc/netplan/*.yaml which are written by administrators,
78
79
installers, cloud image instantiations, or other OS deployments. During early boot, it generates
@@ -84,25 +85,23 @@ Currently supported backends are NetworkManager and systemd-networkd.
84
85
%files
85
86
%license COPYING
86
87
%doc %{_docdir }/%{name }/
87
- /usr/sbin /%{name }
88
+ %{ _sbindir } /%{name }
88
89
%{_datadir }/%{name }/
89
- %{_datadir }/dbus-1/system-services/io.netplan .Netplan.service
90
- %{_datadir }/dbus-1/system.d/io.netplan .Netplan.conf
90
+ %{_datadir }/dbus-1/system-services/io.%{ name } .Netplan.service
91
+ %{_datadir }/dbus-1/system.d/io.%{ name } .Netplan.conf
91
92
%{_systemdgeneratordir }/%{name }
92
93
%{_mandir }/man5/%{name }.5*
93
94
%{_mandir }/man8/%{name }* .8*
94
95
%dir %{_sysconfdir }/%{name }
95
- %dir %{_prefix }/lib/%{name }
96
- %{_libexecdir }/%{name }/
96
+ %dir %{_libexecdir }/%{name }
97
+ %{_libexecdir }/%{name }/generate
98
+ %{_libexecdir }/%{name }/%{name }-dbus
97
99
%{_datadir }/bash-completion/completions/%{name }
98
- %{python3_sitelib }/%{name }/
99
- %{python3_sitearch }/%{name }/
100
100
101
101
# ------------------------------------------------------------------------------------------------
102
102
103
103
%package libs
104
104
Summary: Network configuration tool using YAML (core library)
105
- Group: System Environment/Libraries
106
105
107
106
%description libs
108
107
netplan reads network configuration from /etc/netplan/*.yaml which are written by administrators,
@@ -114,13 +113,12 @@ This package provides Netplan's core libraries.
114
113
115
114
%files libs
116
115
%license COPYING
117
- %{_libdir }/libnetplan .so.%{libsomajor }{,.* }
116
+ %{_libdir }/lib%{ name } .so.%{libsomajor }{,.* }
118
117
119
118
# ------------------------------------------------------------------------------------------------
120
119
121
120
%package devel
122
121
Summary: Network configuration tool using YAML (development files)
123
- Group: Development/Libraries
124
122
Requires: %{name }-libs%{?_isa } = %{version }-%{release }
125
123
126
124
%description devel
@@ -133,14 +131,13 @@ This package provides development headers and libraries for building application
133
131
134
132
%files devel
135
133
%{_includedir }/%{name }/
136
- %{_libdir }/libnetplan .so
134
+ %{_libdir }/lib%{ name } .so
137
135
%{_libdir }/pkgconfig/%{name }.pc
138
136
139
137
# ------------------------------------------------------------------------------------------------
140
138
141
139
%package default-backend-NetworkManager
142
140
Summary: Network configuration tool using YAML (NetworkManager backend)
143
- Group: System Environment/Base
144
141
Requires: %{name } = %{version }-%{release }
145
142
# Netplan requires NetworkManager for configuration
146
143
Requires: NetworkManager
@@ -166,14 +163,36 @@ networking daemon.
166
163
This package configures Netplan to use NetworkManager as its backend.
167
164
168
165
%files default-backend-NetworkManager
169
- %{_prefix }/lib/%{name }/00-netplan-default-renderer-nm.yaml
166
+ %attr(600,root,root) %{_prefix }/lib/%{name }/00-network-manager-all.yaml
167
+
168
+ # ------------------------------------------------------------------------------------------------
169
+
170
+ %package -n python3-%{name }
171
+ Summary: Python bindings for lib%{name }
172
+
173
+ Requires: python3-cffi
174
+ Requires: %{name }-libs%{?_isa } = %{version }-%{release }
175
+
176
+ %description -n python3-%{name }
177
+ Declarative network configuration Python bindings
178
+ Netplan reads YAML network configuration files which are written
179
+ by administrators, installers, cloud image instantiations, or other OS
180
+ deployments. During early boot it then generates backend specific
181
+ configuration files in /run to hand off control of devices to a particular
182
+ networking daemon.
183
+
184
+ Currently supported backends are networkd and NetworkManager.
185
+
186
+ This package provides a CFFI based Python bindings to libnetplan.
187
+
188
+ %files -n python3-%{name }
189
+ %{python3_sitearch }/%{name }/
170
190
171
191
# ------------------------------------------------------------------------------------------------
172
192
173
193
%if %{with networkd_support }
174
194
%package default-backend-networkd
175
195
Summary: Network configuration tool using YAML (systemd-networkd backend)
176
- Group: System Environment/Base
177
196
Requires: %{name } = %{version }-%{release }
178
197
# Netplan requires systemd-networkd for configuration
179
198
Requires: systemd-networkd
@@ -202,47 +221,65 @@ This package configures Netplan to use systemd-networkd as its backend.
202
221
203
222
# ------------------------------------------------------------------------------------------------
204
223
224
+
205
225
%prep
206
226
%autosetup -p1
207
227
208
- # Drop -Werror to avoid the following error:
209
- # /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: 'ip_str' may be used uninitialized in this function [-Werror=maybe-uninitialized]
210
- sed -e "s/werror= true/werror= false/g" -i meson.build
228
+ # these tests all fail in containers, or are linting/codestyle which we don't care about
229
+ sed -i -e "/ test('legacy-tests',/,+3d" \
230
+ -e "/ test('codestyle',/,+3d" \
231
+ -e "/ test('linting',/,+3d" \
232
+ -e "/ test('unit-tests',/,+4d" \
233
+ meson.build
211
234
212
235
213
236
%build
214
- %meson --sbindir=sbin
237
+ %if %{with tests }
238
+ %meson
239
+ %else
240
+ %meson -Dtesting=false
241
+ %endif
215
242
%meson_build
216
243
217
244
218
245
%install
219
246
%meson_install
220
247
221
- # Remove superfluous __pycache__
222
- rm -rf %{buildroot }/usr/lib/python3.11/site-packages/netplan/__pycache__
223
-
224
- # Pre-create the config directories
248
+ # Pre-create the config directory
225
249
mkdir -p %{buildroot }%{_sysconfdir }/%{name }
250
+
251
+ # Create the lib dir for default config
226
252
mkdir -p %{buildroot }%{_prefix }/lib/%{name }
227
253
254
+ mv -n %{buildroot }/%{python3_sitelib }/%{name }/* %{buildroot }/%{python3_sitearch }/%{name }/
255
+ rm -f %{python3_sitelib }/%{name }/
256
+
228
257
# Generate Netplan default renderer configuration
229
- cat > %{buildroot }%{_prefix }/lib/%{name }/00-netplan-default-renderer-nm .yaml << EOF
258
+ cat > %{buildroot }%{_prefix }/lib/%{name }/00-network-manager-all .yaml << EOF
230
259
network:
260
+ version: 2
231
261
renderer: NetworkManager
232
262
EOF
233
263
%if %{with networkd_support }
234
264
cat > %{buildroot }%{_prefix }/lib/%{name }/00-netplan-default-renderer-networkd.yaml << EOF
235
265
network:
266
+ version: 2
236
267
renderer: networkd
237
268
EOF
238
269
%endif
239
270
240
271
272
+ %if %{with tests }
241
273
%check
242
274
%meson_test
275
+ %endif
243
276
244
277
245
278
%changelog
279
+ * Thu Jul 10 2025 Jonathan Wright <jonathan@almalinux.org> - 1.1.2-0
280
+ - Update to 1.1.2
281
+ - Resync with Fedora spec
282
+
246
283
* Tue Feb 14 2023 Neal Gompa <ngompa13@gmail.com> - 0.106-0
247
284
- Update to 0.106
248
285
- Resync with Fedora spec
271
308
- Rebase to 0.30
272
309
273
310
* Sun Jul 2 2017 Neal Gompa <ngompa13@gmail.com> - 0.23~17.04.1-1
274
- - Initial packaging
311
+ - Initial packaging
0 commit comments