File openvswitch3.spec of Package openvswitch3 (Revision c37636e9b368e6eb32e235faf9f472da)
Currently displaying revision c37636e9b368e6eb32e235faf9f472da , Show latest
1438
1
#
2
# spec file for package openvswitch3
3
#
4
# Copyright (c) 2023 SUSE LLC
5
#
6
# All modifications and additions to the file contributed by third parties
7
# remain the property of their copyright owners, unless otherwise agreed
8
# upon. The license for this file, and modifications and additions to the
9
# file, is the same license as for the pristine package itself (unless the
10
# license for the pristine package is not an Open Source License, in which
11
# case the license is the MIT License). An "Open Source License" is a
12
# license that conforms to the Open Source Definition (Version 1.9)
13
# published by the Open Source Initiative.
14
15
# Please submit bugfixes or comments via https://bugs.opensuse.org/
16
#
17
# needssslcertforbuild
18
19
20
%define skip_python2 1
21
%define ovs_lname libopenvswitch-3_1-0
22
%define ovn_lname libovn-23_03-0
23
%define ovs_version 3.1.0
24
%define ovn_version 23.03.0
25
%define ovs_dir ovs-%{ovs_version}
26
%define ovn_dir ovn-%{ovn_version}
27
%define rpmstate %{_rundir}/openvswitch-rpm-state-
28
# Add name_tag and _name to build a differently named package that can coexist with openvswitch
29
%define _name openvswitch
30
%define _dpdkv 22.11.1
31
%if 0%{?suse_version}
32
%define name_tag 3
33
%else
34
%define name_tag ${nil}
35
%endif
36
#Compat macro for new _fillupdir macro introduced in Nov 2017
37
%if ! %{defined _fillupdir}
38
%define _fillupdir %{_localstatedir}/adm/fillup-templates
39
%endif
40
%ifarch aarch64 x86_64 ppc64le
41
%if 0%{?suse_version}
42
# DPDK enabled only SUSE/openSUSE
43
%bcond_without dpdk
44
%else
45
# DPDK disabled elsewhere even if supported by the architecture.
46
%bcond_with dpdk
47
%endif
48
%else
49
# No DPDK support on these architectures
50
%bcond_with dpdk
51
%endif
52
# The testsuite is somewhat fragile for continuous testing in OBS
53
# but keep it here as an option
54
%bcond_with check
55
# Disable building the external kernel datapath by default
56
%bcond_with kmp
57
# Disable building with AF_XDP support, specify '--without afxdp' when building
58
%bcond_with afxdp
59
Name: openvswitch%{name_tag}
60
Version: %{ovs_version}
61
Release: 0
62
Summary: A multilayer virtual network switch
63
# All code is Apache-2.0 except
64
# - lib/sflow* which is SISSL
65
# - utilities/bugtool which is LGPL-2.1
66
License: Apache-2.0 AND LGPL-2.1-only AND SISSL
67
Group: Productivity/Networking/System
68
URL: http://openvswitch.org/
69
Source0: http://openvswitch.org/releases/openvswitch-%{version}.tar.gz
70
Source1: https://github.com/ovn-org/ovn/archive/v%{ovn_version}.tar.gz#/ovn-%{ovn_version}.tar.gz
71
Source2: preamble
72
Source89: Module.supported.updates
73
Source99: openvswitch-rpmlintrc
74
# OVS patches
75
# PATCH-FIX-OPENSUSE: Use-strongswan-for-openvswitch-ipsec-service.patch
76
Patch0: 0001-Use-strongswan-for-openvswitch-ipsec-service.patch
77
# PATCH-FIX-OPENSUSE: 0001-Run-openvswitch-as-openvswitch-openvswitch.patch
78
Patch1: 0001-Run-openvswitch-as-openvswitch-openvswitch.patch
79
# PATCH-FIX-OPENSUSE: 0001-Don-t-change-permissions-of-dev-hugepages.patch
80
Patch2: 0001-Don-t-change-permissions-of-dev-hugepages.patch
81
# PATCH-FIX-OPENSUSE: 0001-Use-double-hash-for-OVS_USER_ID-comment.patch
82
Patch3: 0001-Use-double-hash-for-OVS_USER_ID-comment.patch
83
# PATCH-FEATURE-UPSTREAM install-ovsdb-tools.patch -- Install some tools required for building OVN
84
Patch4: install-ovsdb-tools.patch
85
# PATCH-FIX-UPSTREAM CVE-2023-1668.patch
86
Patch5: CVE-2023-1668.patch
87
# PATCH-FIX-UPSTREAM CVE-2023-5366.patch
88
Patch6: CVE-2023-5366.patch
89
#OVN patches
90
# PATCH-FIX-OPENSUSE: 0001-Run-ovn-as-openvswitch-openvswitch.patch
91
Patch20: 0001-Run-ovn-as-openvswitch-openvswitch.patch
92
# PATCH-FIX-UPSTREAM CVE-2023-3153 [bsc#1212125] -- service monitor MAC flow is not rate limited
93
Patch21: CVE-2023-3153.patch
94
# CVE-2021-36980 [bsc#1188524], use-after-free in decode_NXAST_RAW_ENCAP
95
BuildRequires: autoconf
96
BuildRequires: automake
97
BuildRequires: fdupes
98
BuildRequires: graphviz
99
BuildRequires: libtool
100
BuildRequires: make
101
BuildRequires: pkgconfig
102
BuildRequires: python3
103
BuildRequires: python3-devel
104
BuildRequires: python3-Sphinx
105
BuildRequires: unbound-devel
106
BuildRequires: pkgconfig(libcap-ng)
107
BuildRequires: pkgconfig(openssl)
108
Requires: modutils
109
# ovs-ctl / ovs-pki use /usr/bin/uuidgen:
110
Requires: util-linux
111
%if 0%{?name_tag}
112
Conflicts: %{_name}
113
Provides: %{_name} = %{version}
114
%endif
115
Provides: openvswitch-common = %{version}
116
Obsoletes: openvswitch-common < 2.7.0
117
Provides: openvswitch-controller = %{version}
118
Obsoletes: openvswitch-controller < 2.7.0
119
# openvswitch-switch has been merged to the main package
120
# so we need to provide a migration path
121
%if 0%{?name_tag}
122
Conflicts: %{_name}-dpdk
123
Conflicts: %{_name}-dpdk-switch
124
Conflicts: %{_name}-switch
125
%endif
126
Provides: %{_name}-dpdk = %{version}
127
Provides: %{_name}-dpdk-switch = %{version}
128
Provides: %{_name}-switch = %{version}
129
Obsoletes: %{_name}-dpdk < 2.7.0
130
Obsoletes: %{_name}-dpdk-switch < 2.7.0
131
Obsoletes: %{_name}-switch < 2.7.0
132
%if 0%{?suse_version}
133
BuildRequires: python-rpm-macros
134
Requires(post): %fillup_prereq
135
Requires(pre): shadow
136
Suggests: logrotate
137
%{?systemd_ordering}
138
%else
139
BuildRequires: environment-modules
140
BuildRequires: python3-rpm-macros
141
BuildRequires: systemd-units
142
Requires(post): systemd-units
143
Requires(postun):systemd-units
144
Requires(pre): shadow-utils
145
Requires(preun):systemd-units
146
%endif
147
# Needed by the testsuite
148
%if %{with check}
149
BuildRequires: procps
150
%endif
151
%if %{with kmp}
152
Suggests: openvswitch-kmp
153
%endif
154
%if %{with dpdk}
155
# We need to be a bit strict with the dpdk version since
156
# it's very possible for DPDK to change it's API between
157
# releases.
158
BuildRequires: dpdk-devel >= %{_dpdkv}
159
BuildRequires: libmnl-devel
160
BuildRequires: libnuma-devel
161
BuildRequires: libpcap-devel
162
BuildRequires: rdma-core-devel
163
%endif
164
%if 0%{?suse_version} >= 1500
165
# TW: generate subpackages for every python3 flavor
166
%define python_subpackage_only 1
167
%python_subpackages
168
%else
169
%define python_sitelib %python3_sitelib
170
%define python_sitelib %{python3_sitelib}
171
%define python_files() -n python3-%{**}
172
%endif
173
174
%description
175
Open vSwitch is a multilayer virtual network Ethernet switch. It is
176
enables network automation through programmatic extension, and
177
supports standard management interfaces and protocols (e.g. NetFlow,
178
sFlow, RSPAN, ERSPAN, CLI, LACP, 802.1ag). In addition, it supports
179
distribution across multiple physical servers similar to VMware’s
180
vNetwork distributed vswitch or Cisco’s Nexus 1000V.
181
182
%if %{with kmp}
183
%package kmp
184
Summary: Open vSwitch kernel modules
185
License: GPL-2.0-or-later
186
Group: System/Kernel
187
BuildRequires: %{kernel_module_package_buildreqs}
188
%suse_kernel_module_package -p %{_sourcedir}/preamble ec2 xenpae vmi um
189
190
%description kmp
191
Kernel modules supporting the openvswitch datapath.
192
%endif
193
194
%package -n %{ovs_lname}
195
Summary: Open vSwitch core libraries
196
License: Apache-2.0
197
Group: System/Libraries
198
%if %{with dpdk}
199
Requires: dpdk >= %{_dpdkv}
200
Requires: libdpdk-23 >= %{_dpdkv}
201
%endif
202
203
%description -n %{ovs_lname}
204
Contains the shared libraries used by Open vSwitch and any eventual extensions.
205
206
%package doc
207
Summary: Open vSwitch Documentation
208
License: Apache-2.0
209
Group: System/Libraries
210
BuildArch: noarch
211
%if 0%{?name_tag}
212
Conflicts: %{_name}-doc
213
%endif
214
215
%description doc
216
Contains additional documentation for the Open vSwitch.
217
218
%package devel
219
Summary: Development files for Open vSwitch
220
License: Apache-2.0
221
Group: Development/Libraries/C and C++
222
Requires: %{ovs_lname} = %{version}
223
%if 0%{?name_tag}
224
Conflicts: %{_name}-devel
225
%endif
226
# Required for ovsdb-ildc
227
Requires: python3-ovs = %{version}
228
Provides: %{_name}-dpdk-devel = %{version}
229
Obsoletes: %{_name}-dpdk-devel < 2.7.0
230
231
%description devel
232
Devel libraries and headers for Open vSwitch.
233
234
%package pki
235
Summary: Open vSwitch public key infrastructure dependency package
236
License: Apache-2.0
237
Group: Productivity/Networking/System
238
Requires: %{_name} = %{version}
239
%if 0%{?name_tag}
240
Conflicts: %{_name}-pki
241
%endif
242
Requires: openssl(cli)
243
Provides: %{_name}-dpdk-pki = %{version}
244
Obsoletes: %{_name}-dpdk-pki < 2.7.0
245
246
%description pki
247
openvswitch-pki provides PKI (public key infrastructure) support for
248
Open vSwitch switches and controllers, reducing the risk of
249
man-in-the-middle attacks on the Open vSwitch network infrastructure.
250
251
Open vSwitch is a full-featured software-based Ethernet switch.
252
253
%package vtep
254
Summary: Open vSwitch VTEP emulator
255
License: Apache-2.0
256
Group: Productivity/Networking/System
257
Requires: %{_name} = %{version}
258
Requires: %{_name}-switch = %{version}
259
%if 0%{?name_tag}
260
Conflicts: %{_name}-vtep
261
%endif
262
# Since openvswitch/scripts/ovs-vtep requires various ovs python modules.
263
Requires: python3-ovs = %{version}
264
Provides: %{_name}-dpdk-vtep = %{version}
265
Obsoletes: %{_name}-dpdk-vtep < 2.7.0
266
267
%description vtep
268
A VTEP (VXLAN Tunnel EndPoint) emulator that uses Open vSwitch for
269
forwarding.
270
271
Open vSwitch is a full-featured software-based Ethernet switch.
272
273
%package ipsec
274
Summary: Open vSwitch IPsec tunneling support
275
License: Apache-2.0
276
Group: Productivity/Networking/System
277
Requires: %{_name} = %{version}
278
%if 0%{?name_tag}
279
Conflicts: %{_name}-ipsec
280
%endif
281
Provides: %{_name}-ipsec = %{version}
282
Requires: python3-ovs = %{version}
283
Requires: strongswan
284
285
%description ipsec
286
This package provides IPsec tunneling support for OVS tunnels.
287
288
%package test
289
Summary: Open vSwitch test package
290
License: Apache-2.0
291
Group: Productivity/Networking/System
292
Requires: %{_name} = %{version}
293
%if 0%{?name_tag}
294
Conflicts: %{_name}-test
295
%endif
296
Requires: python3
297
Requires: python3-Twisted
298
Requires: python3-ovs = %{version}
299
Conflicts: python3-%{_name}-test
300
Provides: python3-%{_name}-test = %{version}
301
Obsoletes: python3-%{_name}-test < 2.13.0
302
303
%description test
304
Open vSwitch is a software-based Ethernet switch.
305
306
This package contains utilities that are useful to diagnose
307
performance and connectivity issues in Open vSwitch setup.
308
309
%if 0%{?python_subpackage_only}
310
%package -n python-ovs%{name_tag}
311
Summary: Python bindings for Open vSwitch
312
License: Apache-2.0
313
Group: Productivity/Networking/System
314
Requires: %{ovs_lname} = %{version}
315
Requires: python3-sortedcontainers
316
Conflicts: python3-ovs
317
Provides: python3-ovs = %{version}
318
Conflicts: python3-%{_name}
319
Provides: python3-openvswitch = %{version}
320
Obsoletes: python3-%{_name} < 2.10.1
321
322
%description -n python-ovs%{name_tag}
323
This package contains the Python3 bindings for Open vSwitch database.
324
%else
325
326
%package -n python3-ovs%{name_tag}
327
Summary: Python bindings for Open vSwitch
328
License: Apache-2.0
329
Group: Productivity/Networking/System
330
Requires: %{ovs_lname} = %{version}
331
Requires: python3
332
Requires: python3-sortedcontainers
333
Conflicts: python3-ovs
334
Provides: python3-ovs = %{version}
335
Conflicts: python3-%{_name}
336
Provides: python3-openvswitch = %{version}
337
Obsoletes: python3-%{_name} < 2.10.1
338
339
%description -n python3-ovs%{name_tag}
340
This package contains the Python3 bindings for Open vSwitch database.
341
%endif
342
343
%package -n ovn%{name_tag}
344
Version: %{ovn_version}
345
Release: 0
346
Summary: Open Virtual Network diagnostic utilities
347
License: Apache-2.0
348
Group: Productivity/Networking/System
349
URL: http://ovn.org/
350
Requires: %{_name} = %{ovs_version}
351
%if 0%{?name_tag}
352
Conflicts: %{_name}-ovn
353
Provides: ovn = %{ovn_version}
354
%endif
355
# openvswitch-ovn has been split into openvswitch-ovn-{central,common,docker,host,vtep}
356
Provides: %{_name}-dpdk-ovn = %{ovn_version}
357
Provides: %{_name}-ovn = %{ovn_version}
358
Provides: %{_name}-ovn-common = %{ovn_version}
359
Obsoletes: %{_name}-dpdk-ovn < 2.7.0
360
Obsoletes: %{_name}-ovn < 2.7.0
361
Obsoletes: %{_name}-ovn-common < 2.13.0
362
%if 0%{?suse_version}
363
Suggests: logrotate
364
%endif
365
366
%description -n ovn%{name_tag}
367
OVN, the Open Virtual Network, is a system to support virtual network
368
abstraction. OVN complements the existing capabilities of OVS to add
369
native support for virtual network abstractions, such as virtual L2 and L3
370
overlays and security groups.
371
372
%package -n ovn%{name_tag}-central
373
Version: %{ovn_version}
374
Release: 0
375
Summary: Open Virtual Network support for Open vSwitch
376
License: Apache-2.0
377
Group: Productivity/Networking/System
378
URL: http://ovn.org/
379
Requires: %{_name} = %{ovs_version}
380
Requires: ovn%{name_tag} = %{ovn_version}
381
# openvswitch-ovn has been split into openvswitch-ovn-{central,common,docker,host,vtep}
382
%if 0%{?name_tag}
383
Conflicts: %{_name}-ovn-central
384
%endif
385
Provides: %{_name}-dpdk-ovn:%{_bindir}/ovn-northd
386
Provides: %{_name}-ovn-central = %{ovn_version}
387
Provides: %{_name}-ovn:%{_bindir}/ovn-northd
388
Obsoletes: %{_name}-ovn-central < 2.13.0
389
390
%description -n ovn%{name_tag}-central
391
This subpackage contains the OVN database and northbound daemon.
392
393
%package -n ovn%{name_tag}-host
394
Version: %{ovn_version}
395
Release: 0
396
Summary: Open Virtual Network support for Open vSwitch
397
License: Apache-2.0
398
Group: Productivity/Networking/System
399
URL: http://ovn.org/
400
Requires: %{_name} = %{ovs_version}
401
Requires: ovn%{name_tag} = %{ovn_version}
402
%if 0%{?name_tag}
403
Conflicts: %{_name}-ovn-host
404
%endif
405
# openvswitch-ovn has been split into openvswitch-ovn-{central,common,docker,host,vtep}
406
Provides: %{_name}-dpdk-ovn:%{_bindir}/ovn-controller
407
Provides: %{_name}-ovn-host = %{ovn_version}
408
Provides: %{_name}-ovn:%{_bindir}/ovn-controller
409
Obsoletes: %{_name}-ovn-host < 2.13.0
410
411
%description -n ovn%{name_tag}-host
412
This subpackage contains the OVN host controller.
413
414
%package -n ovn%{name_tag}-vtep
415
Version: %{ovn_version}
416
Release: 0
417
Summary: Open Virtual Network VTEP controller for Open vSwitch
418
License: Apache-2.0
419
Group: Productivity/Networking/System
420
URL: http://ovn.org/
421
Requires: %{_name} = %{ovs_version}
422
Requires: ovn%{name_tag} = %{ovn_version}
423
%if 0%{?name_tag}
424
Conflicts: %{_name}-ovn-vtep
425
%endif
426
# openvswitch-ovn has been split into openvswitch-ovn-{central,common,docker,host,vtep}
427
Provides: %{_name}-dpdk-ovn:%{_bindir}/ovn-controller-vtep
428
Provides: %{_name}-ovn-vtep = %{ovn_version}
429
Provides: %{_name}-ovn:%{_bindir}/ovn-controller-vtep
430
Obsoletes: %{_name}-ovn-vtep < 2.13.0
431
432
%description -n ovn%{name_tag}-vtep
433
This subpackage contains the OVN VTEP (VXLAN Tunnel Endpoint) controller.
434
435
%package -n ovn%{name_tag}-docker
436
Version: %{ovn_version}
437
Release: 0
438
Summary: Docker network plugins for OVN
439
License: Apache-2.0
440
Group: Productivity/Networking/System
441
URL: http://ovn.org/
442
Requires: %{_name} = %{ovs_version}
443
Requires: ovn%{name_tag} = %{ovn_version}
444
Requires: python3-openvswitch = %{ovs_version}
445
%if 0%{?name_tag}
446
Conflicts: %{_name}-ovn-docker
447
%endif
448
# openvswitch-ovn has been split into openvswitch-ovn-{central,common,docker,host,vtep}
449
Provides: %{_name}-dpdk-ovn:%{_bindir}/ovn-docker-overlay-driver
450
Provides: %{_name}-ovn-docker = %{ovn_version}
451
Provides: %{_name}-ovn:%{_bindir}/ovn-docker-overlay-driver
452
Obsoletes: %{_name}-ovn-docker < 2.13.0
453
454
%description -n ovn%{name_tag}-docker
455
This subpackage contains the OVN Docker network plugins.
456
457
%package -n ovn%{name_tag}-doc
458
Version: %{ovn_version}
459
Release: 0
460
Summary: Open Virtual Network Documentation
461
License: Apache-2.0
462
Group: System/Libraries
463
BuildArch: noarch
464
%if 0%{?name_tag}
465
Conflicts: ovn-doc
466
%endif
467
468
%description -n ovn%{name_tag}-doc
469
Contains additional documentation for OVN.
470
471
%package -n %{ovn_lname}
472
Version: %{ovn_version}
473
Release: 0
474
Summary: Open Virtual Network core libraries
475
License: Apache-2.0
476
Group: System/Libraries
477
478
%description -n %{ovn_lname}
479
iThis subpackage contains the OVN shared libraries.
480
481
%package -n ovn%{name_tag}-devel
482
Version: %{ovn_version}
483
Release: 0
484
Summary: Development files for Open Virtual Network
485
License: Apache-2.0
486
Group: Development/Libraries/C and C++
487
Requires: %{ovn_lname} = %{ovn_version}
488
# ovn-devel was split form openvswitch-devel
489
Provides: %{_name}-devel:%{_includedir}/ovn
490
%if 0%{?name_tag}
491
Conflicts: ovn-devel
492
%endif
493
494
%description -n ovn%{name_tag}-devel
495
Devel libraries and headers for Open Virtual Network.
496
497
%prep
498
%setup -q -n %{_name}-%{ovs_version} -a 1
499
%patch0 -p1
500
%patch1 -p1
501
%patch2 -p1
502
%patch3 -p1
503
%patch4 -p1
504
%patch5 -p1
505
%patch6 -p1
506
cd %{ovn_dir}
507
%patch20 -p1
508
%patch21 -p1
509
510
%build
511
mkdir %ovs_dir
512
# We build both OVS and OVN. OVN is already on its own subdir ovn_dir.
513
# Move OVS sources to ovs_dir
514
find $PWD -maxdepth 1 ! -path $PWD ! -name %ovs_dir -a ! -name %ovn_dir -exec mv -t %ovs_dir {} +
515
516
# Init OVS config.
517
pushd %ovs_dir
518
# only call boot.sh for distros with autoconf >= 2.64
519
bash -x boot.sh
520
popd
521
522
# Build kernel modules if needed.
523
%if %{with kmp}
524
mkdir kmp
525
export EXTRA_CFLAGS='-DVERSION=\"%{ovs_version}\"'
526
for flavor in %{flavors_to_build}; do
527
rm -rf kmp/$flavor
528
cp -r %ovs_dir kmp/$flavor
529
cp -a %{SOURCE89} kmp/$flavor/datapath/linux/Module.supported
530
pushd kmp/$flavor
531
%configure \
532
--with-logdir=%{_localstatedir}/log/openvswitch \
533
--with-rundir=%{_rundir}/openvswitch \
534
--with-linux=%{_prefix}/src/linux-obj/%{_target_cpu}/$flavor \
535
--with-linux-source=%{_prefix}/src/linux
536
cd datapath/linux
537
make %{?_smp_mflags}
538
popd
539
done
540
%endif
541
542
# Build OVS.
543
pushd %ovs_dir
544
545
# This currently has no effect as the @dpdk section has been patched out of the
546
# service file. Run it anyway, in case a new section that we need appears over
547
# time.
548
python3 build-aux/dpdkstrip.py \
549
%if %{with dpdk}
550
--dpdk \
551
%else
552
--nodpdk \
553
%endif
554
< rhel/usr_lib_systemd_system_ovs-vswitchd.service.in \
555
> rhel/usr_lib_systemd_system_ovs-vswitchd.service
556
557
%configure \
558
--disable-static \
559
--enable-shared \
560
--enable-libcapng \
561
--enable-ssl \
562
%if %{with dpdk}
563
--with-dpdk=shared \
564
%endif
565
%if %{with afxdp}
566
--enable-afxdp \
567
%else
568
--disable-afxdp \
569
%endif
570
--with-dbdir=%{_sharedstatedir}/openvswitch \
571
--with-rundir=%{_rundir}/openvswitch \
572
--with-logdir=%{_localstatedir}/log/openvswitch \
573
--with-pkidir=%{_sharedstatedir}/openvswitch/pki \
574
PYTHON3=%{_bindir}/python3
575
%make_build
576
popd
577
578
# Build OVN.
579
pushd %ovn_dir
580
581
bash -x boot.sh
582
%configure \
583
--with-ovs-source=../%{ovs_dir} \
584
--disable-static \
585
--enable-shared \
586
--enable-libcapng \
587
--enable-ssl \
588
--with-dbdir=%{_sharedstatedir}/ovn \
589
--with-rundir=%{_rundir}/ovn \
590
--with-logdir=%{_localstatedir}/log/ovn \
591
--with-pkidir=%{_sharedstatedir}/openvswitch/pki \
592
PYTHON3=%{_bindir}/python3 \
593
LDFLAGS=-L../%{ovs_dir}/lib/.libs
594
%make_build
595
596
%check
597
%if %{with check}
598
touch resolv.conf
599
export OVS_RESOLV_CONF=$(pwd)/resolv.conf
600
mv python/build python/pb
601
ln -s _build.tmp python/build
602
603
pushd %ovs_dir
604
# Recheck tests before we declare them broken. If that fails, dump
605
# the log and exit. >2.5.0 uses the RECHECK env variable so this
606
# needs to be taken into consideration for future releases.
607
if ! make check TESTSUITEFLAGS="%{?_smp_mflags}" &&
608
! make check RECHECK=yes; then
609
cat tests/testsuite.log
610
exit 1
611
fi
612
popd
613
614
pushd $ovn_dir
615
if ! make check TESTSUITEFLAGS="%{?_smp_mflags}" &&
616
! make check RECHECK=yes; then
617
cat tests/testsuite.log
618
exit 1
619
fi
620
popd
621
%endif
622
623
%install
624
625
# Intall kernel modules.
626
%if %{with kmp}
627
export NO_BRP_STALE_LINK_ERROR=yes
628
export INSTALL_MOD_PATH=%{buildroot}
629
export INSTALL_MOD_DIR=updates
630
export BRP_PESIGN_FILES="*.ko /lib/firmware"
631
for flavor in %{flavors_to_build}; do
632
pushd kmp/$flavor/datapath/linux
633
make -C %{_prefix}/src/linux-obj/%{_target_cpu}/$flavor modules_install M=$PWD
634
popd
635
done
636
%endif
637
638
# Install OVS dist files on temp buildroot.
639
mkdir -p buildroot/ovs
640
pushd %ovs_dir
641
%make_install DESTDIR=$(pwd)/../buildroot/ovs
642
popd
643
644
# Clean up OVS files
645
rm -f buildroot/ovs%{_libdir}/*.a
646
rm -f buildroot/ovs%{_libdir}/*.la
647
648
# Install OVN dist files on temp build root.
649
mkdir -p buildroot/ovn
650
pushd %ovn_dir
651
%make_install DESTDIR=$(pwd)/../buildroot/ovn
652
popd
653
654
# Clean up OVN files
655
rm -f buildroot/ovn%{_datadir}/ovn/scripts/ovs*
656
rm -rf buildroot/ovn%{_datadir}/ovn/bugtool-plugins
657
rm -f buildroot/ovn%{_libdir}/*.a
658
rm -f buildroot/ovn%{_libdir}/*.la
659
660
# Remove known OVS dupes from OVN.
661
rm -f buildroot/ovn%{_mandir}/man5/ovs*
662
rm -f buildroot/ovn%{_mandir}/man7/ovs*
663
664
# Verify no duplicates and move dist files to real buildroot
665
dupes=$(find buildroot -mindepth 2 -type f -printf '%p\n' | cut -d'/' -f3- | sort | uniq -c | grep -Ev "^ *1 " || true)
666
[ -n "$dupes" ] && exit 1
667
cp -an buildroot/ovn/* %{buildroot}/
668
cp -an buildroot/ovs/* %{buildroot}/
669
670
# Install OVS additional files
671
pushd %ovs_dir
672
673
# Install extra headers not included with 'make install'
674
copy_headers() {
675
src=$1
676
dst=%{buildroot}/$2
677
install -d -m 0755 $dst
678
install -m 0644 $src/*.h $dst
679
}
680
copy_headers include/sparse %{_includedir}/openvswitch/sparse
681
copy_headers include/sparse/arpa %{_includedir}/openvswitch/sparse/arpa
682
copy_headers include/sparse/netinet %{_includedir}/openvswitch/sparse/netinet
683
copy_headers include/sparse/sys %{_includedir}/openvswitch/sparse/sys
684
copy_headers lib %{_includedir}/openvswitch/lib
685
686
# Install systemd files
687
for service in openvswitch \
688
ovsdb-server \
689
ovs-vswitchd \
690
ovs-delete-transient-ports \
691
openvswitch-ipsec; do
692
install -D -m 644 rhel/usr_lib_systemd_system_${service}.service \
693
%{buildroot}%{_unitdir}/${service}.service
694
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc${service}
695
done
696
697
# This changes group ownership of any vfio device to 'hugetlbfs' through udev.
698
# That's probably not the most appropriate name for such a group and also
699
# should probably be coordinated system wide.
700
#%%if %%{with dpdk}
701
# install -p -D -m 0644 rhel/usr_lib_udev_rules.d_91-vfio.rules \
702
# %%{buildroot}%%{_prefix}/lib/udev/rules.d/91-vfio.rules
703
#%%endif
704
705
%if 0%{?suse_version}
706
install -D -m 644 rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
707
%{buildroot}%{_fillupdir}/sysconfig.openvswitch
708
709
# Fix installation path
710
mkdir -p %{buildroot}/%{_datadir}/bash-completion/completions/
711
mv %{buildroot}/%{_sysconfdir}/bash_completion.d/ovs-* %{buildroot}/%{_datadir}/bash-completion/completions/
712
chmod 0644 %{buildroot}/%{_datadir}/bash-completion/completions/*
713
714
# fixing W: # interpreter
715
find %{buildroot}/%{_datadir}/openvswitch/scripts/ -name "*.py" -exec sed -i 's|env python|python|' \{\} +
716
717
%else
718
install -D -m 644 rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
719
%{buildroot}%{_sysconfdir}/sysconfig/openvswitch
720
install -d -m 0755 %{buildroot}/%{_sysconfdir}/sysconfig/network-scripts/
721
install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \
722
%{buildroot}%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
723
install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \
724
%{buildroot}%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
725
%endif
726
727
install -d -m 0755 %{buildroot}/%{_rundir}/openvswitch
728
install -d -m 0755 %{buildroot}%{_sysconfdir}/logrotate.d
729
install -d -m 0755 %{buildroot}%{_localstatedir}/log/openvswitch
730
731
install -p -D -m 0644 rhel/etc_openvswitch_default.conf \
732
%{buildroot}/%{_sysconfdir}/openvswitch/default.conf
733
install -m 644 rhel/etc_logrotate.d_openvswitch \
734
%{buildroot}%{_sysconfdir}/logrotate.d/openvswitch
735
736
install -m 644 vswitchd/vswitch.ovsschema \
737
%{buildroot}%{_datadir}/openvswitch/vswitch.ovsschema
738
739
# Copy documentation.
740
mkdir -p %{buildroot}%{_docdir}/%{_name}
741
cp -r Documentation/* %{buildroot}%{_docdir}/%{_name}
742
rm -rf %{buildroot}%{_docdir}/%{_name}/_build
743
rm %{buildroot}%{_docdir}/%{_name}/automake.mk
744
rm %{buildroot}%{_docdir}/%{_name}/conf.py
745
popd
746
747
# Tests
748
mkdir -p %{buildroot}%{python3_sitelib}
749
cp -a %{buildroot}%{_datadir}/openvswitch/python/ovstest \
750
%{buildroot}%{python3_sitelib}
751
752
# Python subpackage
753
# Build on a temporary directory.
754
mkdir python3-ovs && pushd $_
755
# Some build files are in sources while others are generated directly on
756
# buildroot as part of make_install (dirs.py). Copy them first.
757
cp -an ../buildroot/ovs%{_datadir}/openvswitch/python/* $(pwd)/
758
cp -an ../%{ovs_dir}/python/* $(pwd)/
759
rm -rf %{buildroot}%{_datadir}/openvswitch/python
760
761
export LDFLAGS="${LDFLAGS} -L %{buildroot}%{_libdir}"
762
export CPPFLAGS="-I ../../include"
763
764
%if 0%{?suse_version}
765
# SLES
766
%{python_build}
767
%{python_install}
768
%else
769
# RHEL
770
%py3_build
771
%py3_install
772
%endif
773
774
# Done with OVS additional files.
775
popd
776
777
%python_expand %fdupes %{buildroot}%{$python_sitearch}
778
# Install OVN aditional files.
779
pushd %ovn_dir
780
781
for service in ovn-controller \
782
ovn-controller-vtep \
783
ovn-northd; do
784
install -D -m 644 rhel/usr_lib_systemd_system_${service}.service \
785
%{buildroot}%{_unitdir}/${service}.service
786
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc${service}
787
done
788
789
%if 0%{?suse_version}
790
install -D -m 644 rhel/usr_share_ovn_scripts_systemd_sysconfig.template \
791
%{buildroot}%{_fillupdir}/sysconfig.ovn
792
%else
793
install -D -m 644 rhel/usr_share_ovn_scripts_systemd_sysconfig.template \
794
%{buildroot}%{_sysconfdir}/sysconfig/ovn
795
%endif
796
797
# firewalld
798
install -d %{buildroot}%{_prefix}/lib/firewalld/services/
799
install -p -m 0644 rhel/usr_lib_firewalld_services_ovn-central-firewall-service.xml \
800
%{buildroot}%{_prefix}/lib/firewalld/services/ovn-central-firewall-service.xml
801
install -p -m 0644 rhel/usr_lib_firewalld_services_ovn-host-firewall-service.xml \
802
%{buildroot}%{_prefix}/lib/firewalld/services/ovn-host-firewall-service.xml
803
804
install -p -D -m 0644 rhel/etc_logrotate.d_ovn \
805
%{buildroot}%{_sysconfdir}/logrotate.d/ovn
806
install -d -m 0755 %{buildroot}%{_localstatedir}/log/ovn
807
808
# Copy documentation.
809
mkdir -p %{buildroot}%{_docdir}/ovn
810
cp -r Documentation/* %{buildroot}%{_docdir}/ovn
811
rm -rf %{buildroot}%{_docdir}/ovn/_build
812
rm %{buildroot}%{_docdir}/ovn/automake.mk
813
rm %{buildroot}%{_docdir}/ovn/conf.py
814
815
# Done with OVN additional files.
816
popd
817
818
%pre
819
%if 0%{?suse_version}
820
%service_add_pre ovsdb-server.service ovs-vswitchd.service openvswitch.service ovs-delete-transient-ports.service
821
%endif
822
if [ "$1" -ge 1 ]; then
823
# Save the "enabled" state across the transition of
824
# ownership of openvswitch.service from openvswitch-switch to
825
# openvswitch.
826
if [ x$(systemctl is-enabled openvswitch.service 2>/dev/null ||:) = "xenabled" ]; then
827
touch %{rpmstate}openvswitch
828
fi
829
fi
830
831
getent group openvswitch >/dev/null || groupadd -r openvswitch
832
getent passwd openvswitch >/dev/null || \
833
useradd -r -g openvswitch -d / -s /sbin/nologin \
834
-c "Open vSwitch Daemons" openvswitch
835
836
exit 0
837
838
%pre ipsec
839
%if 0%{?suse_version}
840
%service_add_pre openvswitch-ipsec.service
841
%endif
842
843
%preun
844
%if 0%{?suse_version}
845
%service_del_preun ovsdb-server.service ovs-vswitchd.service openvswitch.service ovs-delete-transient-ports.service
846
%else
847
%if 0%{?systemd_preun:1}
848
%systemd_preun %{_name}.service
849
%else
850
# Package install, not upgrade
851
if [ $1 -eq 0 ]; then
852
/bin/systemctl --no-reload disable %{_name}.service >/dev/null 2>&1 || :
853
/bin/systemctl stop %{_name}.service >/dev/null 2>&1 || :
854
fi
855
%endif
856
%endif
857
858
%preun ipsec
859
%if 0%{?suse_version}
860
%service_del_preun openvswitch-ipsec.service
861
%endif
862
863
%preun test
864
%if 0%{?suse_version}
865
%service_del_preun openvswitch-testcontroller
866
%else
867
%if 0%{?systemd_post:1}
868
%systemd_preun openvswitch-testcontroller.service
869
%else
870
# Package install, not upgrade
871
if [ $1 -eq 0 ]; then
872
/bin/systemctl --no-reload disable openvswitch-testcontroller.service >/dev/null 2>&1 || :
873
/bin/systemctl stop openvswitch-testcontroller.service >/dev/null 2>&1 || :
874
fi
875
%endif
876
%endif
877
878
%post
879
if [ $1 -eq 1 ]; then
880
# Follow the upstream strategy that no running openvswitch
881
# configuration is changed on upgrade so use fillup only for new installs.
882
%{?suse_version: %fillup_only -n openvswitch}
883
fi
884
885
%if 0%{?suse_version}
886
%service_add_post ovsdb-server.service ovs-vswitchd.service openvswitch.service ovs-delete-transient-ports.service
887
%else
888
%if 0%{?systemd_post:1}
889
%systemd_post openvswitch.service
890
%else
891
# Package install, not upgrade
892
if [ $1 -eq 1 ]; then
893
/bin/systemctl daemon-reload >dev/null || :
894
fi
895
%endif
896
%endif
897
898
%post ipsec
899
%if 0%{?suse_version}
900
%service_add_post openvswitch-ipsec.service
901
%endif
902
903
%post -n %{ovs_lname} -p /sbin/ldconfig
904
905
%postun
906
# Do not restart the openvswitch service on package updates.
907
# Restarting the service may break the existing network state.
908
# For example, openflow rules are not automatically re-installed
909
# after an OvS update if no SDN controller is used. Moreover, restaring
910
# the OvS can break remote administration during the update so let the
911
# admin decide when it's the best time for an OvS restart.
912
# 5771f476573445710834234a6a9f7bd999a027e7 ("fedora: do not restart the service on a pkg upgrade")
913
%if 0%{?suse_version}
914
%service_del_postun_without_restart ovsdb-server.service ovs-vswitchd.service openvswitch.service ovs-delete-transient-ports.service
915
%else
916
%if 0%{?systemd_postun:1}
917
%systemd_postun openvswitch.service
918
%else
919
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
920
%endif
921
%endif
922
923
%postun ipsec
924
%if 0%{?suse_version}
925
%service_del_postun_without_restart openvswitch-ipsec.service
926
%endif
927
928
%postun test
929
%if 0%{?suse_version}
930
%service_del_postun_without_restart openvswitch-testcontroller
931
%else
932
%if 0%{?systemd_postun:1}
933
%systemd_postun openvswitch-testcontroller.service
934
%else
935
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
936
%endif
937
%endif
938
939
%postun -n %{ovs_lname} -p /sbin/ldconfig
940
941
%posttrans
942
# Save the "enabled" state across the transition of ownership
943
# of openvswitch.service from openvswitch-switch to
944
# openvswitch.
945
if [ -e %{rpmstate}openvswitch ]; then
946
rm -f %{rpmstate}openvswitch
947
systemctl enable openvswitch.service
948
fi
949
950
ovsdbdir_regex="^[[:space:]]*OVS_DBDIR[[:space:]]*="
951
ovsuserid_regex="^[[:space:]]*OVS_USER_ID[[:space:]]*="
952
ovsvar_valueregex="[^=]*=[[:space:]]*["'"'"']{0,1}([^"'"'"']*)["'"'"']{0,1}[[:space:]]*$"
953
conf="%{_sysconfdir}/sysconfig/openvswitch"
954
ovsdbdir=$(grep -E "${ovsdbdir_regex}" "${conf}" | tail -1 | sed -E --posix 's|'"${ovsvar_valueregex}"'|\1|')
955
ovsuserid=$(grep -E "${ovsuserid_regex}" "${conf}" | tail -1 | sed -E --posix 's|'"${ovsvar_valueregex}"'|\1|')
956
957
# Default DB path changed from /etc/openvswitch to /var/lib/openvswitch.
958
# But try to keep the old path for upgraded users already making use of it.
959
if [ -z "$ovsdbdir" ]; then
960
ovsdbpid=$(systemctl is-active --quiet ovsdb-server && systemctl show -p MainPID --value ovsdb-server || echo 0)
961
if [ $ovsdbpid -gt 0 ] && [ -n "$(find /proc/$ovsdbpid/fd/ -type l -lname '%{_sysconfdir}/openvswitch/conf.db')" ]; then
962
# We have ovsdb-server pid from the unit file with DB open at the old path.
963
ovsdbdir="%{_sysconfdir}/openvswitch"
964
sed -i -e '1{r /dev/stdin' -e 'N}' "%{_sysconfdir}/sysconfig/openvswitch" << EOF
965
966
# OVS_DBDIR was automatically inserted here on openvswitch package upgrade to
967
# preserve the currently used /etc/openvswitch as the database directory.
968
# Note that new installs use /var/lib/openvswitch as the default database
969
# directory by omission.
970
OVS_DBDIR="%{_sysconfdir}/openvswitch"
971
972
EOF
973
fi
974
fi
975
976
# Default OVS user changed from root:root to openvswitch:openvswitch.
977
# But try to keep root:root for upgraded users already making use of it.
978
# Use .conf.db.~lock~ instead of conf.db as conf.db might have been moved
979
# to a backup on a previous run attempt.
980
if [ -z "$ovsuserid" -a -n "$ovsdbdir" -a -f "$ovsdbdir/.conf.db.~lock~" ]; then
981
ovsuserid=$(stat -c "%{U}:%G" "$ovsdbdir/.conf.db.~lock~")
982
if [ "$ovsuserid" = "root:root" ]; then
983
sed -i -e '1{r /dev/stdin' -e 'N}' "%{_sysconfdir}/sysconfig/openvswitch" << EOF
984
985
# OVS_USER_ID was automatically inserted here on openvswitch package upgrade to
986
# preserve the currently used root:root as the openvswitch running credentials.
987
# Note that new installs use openvswitch:openvswitch as the default openvswitch
988
# running credentials by omission.
989
OVS_USER_ID="root:root"
990
991
EOF
992
fi
993
fi
994
995
%pre -n ovn%{name_tag}-central
996
%if 0%{?suse_version}
997
%service_add_pre ovn-northd.service
998
%endif
999
# Save the "enabled" state across the transition of
1000
# ownership of ovn-northd.service from openvswitch-ovn-central to
1001
# ovn-central.
1002
if [ "$1" -ge 1 ]; then
1003
if [ x$(systemctl is-enabled ovn-northd.service 2>/dev/null ||:) = "xenabled" ]; then
1004
touch %{rpmstate}ovn-northd
1005
fi
1006
fi
1007
1008
%pre -n ovn%{name_tag}-host
1009
%if 0%{?suse_version}
1010
%service_add_pre ovn-controller.service
1011
%endif
1012
# Save the "enabled" state across the transition of
1013
# ownership of ovn-controller.service from openvswitch-ovn-host to
1014
# ovn-host.
1015
if [ "$1" -ge 1 ]; then
1016
if [ x$(systemctl is-enabled ovn-controller.service 2>/dev/null ||:) = "xenabled" ]; then
1017
touch %{rpmstate}ovn-controller
1018
fi
1019
fi
1020
1021
%pre -n ovn%{name_tag}-vtep
1022
%if 0%{?suse_version}
1023
%service_add_pre ovn-controller-vtep.service
1024
%endif
1025
# Save the "enabled" state across the transition of
1026
# ownership of ovn-controller-vtep.service from openvswitch-ovn-vtep to
1027
# ovn-vtep.
1028
if [ "$1" -ge 1 ]; then
1029
if [ x$(systemctl is-enabled ovn-controller-vtep.service 2>/dev/null ||:) = "xenabled" ]; then
1030
touch %{rpmstate}ovn-controller-vtep
1031
fi
1032
fi
1033
1034
%preun -n ovn%{name_tag}-central
1035
%if 0%{?suse_version}
1036
%service_del_preun ovn-northd.service
1037
%else
1038
%if 0%{?systemd_preun:1}
1039
%systemd_preun ovn-northd.service
1040
%else
1041
# Package install, not upgrade
1042
if [ $1 -eq 0 ]; then
1043
/bin/systemctl --no-reload disable ovn-northd.service >/dev/null 2>&1 || :
1044
/bin/systemctl stop ovn-northd.service >/dev/null 2>&1 || :
1045
fi
1046
%endif
1047
%endif
1048
1049
%preun -n ovn%{name_tag}-host
1050
%if 0%{?suse_version}
1051
%service_del_preun ovn-controller.service
1052
%else
1053
%if 0%{?systemd_preun:1}
1054
%systemd_preun ovn-controller.service
1055
%else
1056
# Package install, not upgrade
1057
if [ $1 -eq 0 ]; then
1058
/bin/systemctl --no-reload disable ovn-controller.service >/dev/null 2>&1 || :
1059
/bin/systemctl stop ovn-controller.service >/dev/null 2>&1 || :
1060
fi
1061
%endif
1062
%endif
1063
1064
%preun -n ovn%{name_tag}-vtep
1065
%if 0%{?suse_version}
1066
%service_del_preun ovn-controller-vtep.service
1067
%else
1068
%if 0%{?systemd_preun:1}
1069
%systemd_preun ovn-controller-vtep.service
1070
%else
1071
# Package install, not upgrade
1072
if [ $1 -eq 0 ]; then
1073
/bin/systemctl --no-reload disable ovn-controller-vtep.service >/dev/null 2>&1 || :
1074
/bin/systemctl stop ovn-controller-vtep.service >/dev/null 2>&1 || :
1075
fi
1076
%endif
1077
%endif
1078
1079
%post -n ovn%{name_tag}
1080
if [ $1 -eq 1 ]; then
1081
# Follow the upstream strategy that no running openvswitch
1082
# configuration is changed on upgrade so use fillup only for new installs.
1083
%{?suse_version: %fillup_only -n ovn}
1084
fi
1085
1086
%post -n ovn%{name_tag}-central
1087
%if 0%{?suse_version}
1088
%service_add_post ovn-northd.service
1089
%else
1090
%if 0%{?systemd_post:1}
1091
%systemd_post ovn-northd.service
1092
%else
1093
# Package install, not upgrade
1094
if [ $1 -eq 1 ]; then
1095
/bin/systemctl daemon-reload >dev/null || :
1096
fi
1097
%endif
1098
%endif
1099
1100
%post -n ovn%{name_tag}-host
1101
%if 0%{?suse_version}
1102
%service_add_post ovn-controller.service
1103
%else
1104
%if 0%{?systemd_post:1}
1105
%systemd_post ovn-controller.service
1106
%else
1107
# Package install, not upgrade
1108
if [ $1 -eq 1 ]; then
1109
/bin/systemctl daemon-reload >dev/null || :
1110
fi
1111
%endif
1112
%endif
1113
1114
%post -n ovn%{name_tag}-vtep
1115
%if 0%{?suse_version}
1116
%service_add_post ovn-controller-vtep.service
1117
%else
1118
%if 0%{?systemd_post:1}
1119
%systemd_post ovn-controller-vtep.service
1120
%else
1121
# Package install, not upgrade
1122
if [ $1 -eq 1 ]; then
1123
/bin/systemctl daemon-reload >dev/null || :
1124
fi
1125
%endif
1126
%endif
1127
1128
%post -n %{ovn_lname} -p /sbin/ldconfig
1129
1130
%postun -n ovn%{name_tag}-central
1131
%if 0%{?suse_version}
1132
%service_del_postun_without_restart ovn-northd.service
1133
%else
1134
%if 0%{?systemd_postun:1}
1135
%systemd_postun ovn-northd.service
1136
%else
1137
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
1138
%endif
1139
%endif
1140
1141
%postun -n ovn%{name_tag}-host
1142
%if 0%{?suse_version}
1143
%service_del_postun_without_restart ovn-controller.service
1144
%else
1145
%if 0%{?systemd_postun:1}
1146
%systemd_postun ovn-controller.service
1147
%else
1148
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
1149
%endif
1150
%endif
1151
1152
%postun -n ovn%{name_tag}-vtep
1153
%if 0%{?suse_version}
1154
%service_del_postun_without_restart ovn-controller-vtep.service
1155
%else
1156
%if 0%{?systemd_postun:1}
1157
%systemd_postun ovn-controller-vtep.service
1158
%else
1159
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
1160
%endif
1161
%endif
1162
1163
%postun -n %{ovn_lname} -p /sbin/ldconfig
1164
1165
%posttrans -n ovn%{name_tag}-central
1166
# Save the "enabled" state across the transition of
1167
# ownership of ovn-northd.service from openvswitch-ovn-central to
1168
# ovn-central.
1169
if [ -e %{rpmstate}ovn-northd ]; then
1170
rm %{rpmstate}ovn-northd
1171
systemctl enable ovn-northd.service
1172
fi
1173
1174
%posttrans -n ovn%{name_tag}-host
1175
# Save the "enabled" state across the transition of
1176
# ownership of ovn-northd.service from openvswitch-ovn-central to
1177
# ovn-central.
1178
if [ -e %{rpmstate}ovn-controller ]; then
1179
rm %{rpmstate}ovn-controller
1180
systemctl enable ovn-controller.service
1181
fi
1182
1183
%posttrans -n ovn%{name_tag}-vtep
1184
# Save the "enabled" state across the transition of
1185
# ownership of ovn-controller.service from openvswitch-ovn-host to
1186
# ovn-host.
1187
if [ -e %{rpmstate}ovn-controller-vtep ]; then
1188
rm %{rpmstate}ovn-controller-vtep
1189
systemctl enable ovn-controller-vtep.service
1190
fi
1191
1192
%files
1193
%defattr(-,root,openvswitch, 775)
1194
%dir %{_sysconfdir}/openvswitch
1195
%defattr(-,openvswitch,openvswitch)
1196
%dir %{_localstatedir}/log/openvswitch
1197
%config %ghost %{_sysconfdir}/openvswitch/system-id.conf
1198
# This is no longer the DB path for new installs but we still need this for
1199
# upgrades that preserve the old DB path.
1200
%ghost %{_sysconfdir}/openvswitch/.conf.db.~lock~
1201
%defattr(-,root,root)
1202
%config(noreplace) %{_sysconfdir}/openvswitch/default.conf
1203
%{_bindir}/ovs-appctl
1204
%{_bindir}/ovs-docker
1205
%{_bindir}/ovs-dpctl
1206
%{_bindir}/ovs-dpctl-top
1207
%{_bindir}/ovs-ofctl
1208
%{_bindir}/ovs-parse-backtrace
1209
%{_bindir}/ovs-vsctl
1210
%{_bindir}/ovsdb-client
1211
%{_bindir}/ovsdb-tool
1212
%{_sbindir}/ovs-bugtool
1213
%{_sbindir}/ovs-vswitchd
1214
%{_sbindir}/ovsdb-server
1215
%dir %{_datadir}/openvswitch
1216
%dir %{_datadir}/openvswitch/scripts
1217
%dir %{_datadir}/openvswitch/scripts/usdt
1218
%{_datadir}/openvswitch/bugtool-plugins
1219
%{_datadir}/openvswitch/scripts/ovs-bugtool-*
1220
%{_datadir}/openvswitch/scripts/ovs-check-dead-ifs
1221
%{_datadir}/openvswitch/scripts/ovs-ctl
1222
%{_datadir}/openvswitch/scripts/ovs-kmod-ctl
1223
%{_datadir}/openvswitch/scripts/ovs-lib
1224
%{_datadir}/openvswitch/scripts/ovs-save
1225
%{_datadir}/openvswitch/scripts/usdt/*
1226
%{_datadir}/openvswitch/vswitch.ovsschema
1227
%{_datadir}/openvswitch/local-config.ovsschema
1228
%{_mandir}/man1/ovsdb-client.1%{?ext_man}
1229
%{_mandir}/man1/ovsdb-server.1%{?ext_man}
1230
%{_mandir}/man1/ovsdb-tool.1%{?ext_man}
1231
%{_mandir}/man5/ovs-vswitchd.conf.db.5%{?ext_man}
1232
%{_mandir}/man5/ovsdb-server.5%{?ext_man}
1233
%{_mandir}/man5/ovsdb.5%{?ext_man}
1234
%{_mandir}/man7/ovs-actions.7%{?ext_man}
1235
%{_mandir}/man7/ovs-fields.7%{?ext_man}
1236
%{_mandir}/man7/ovsdb.7%{?ext_man}
1237
%{_mandir}/man7/ovsdb-server.7%{?ext_man}
1238
%{_mandir}/man8/ovs-appctl.8%{?ext_man}
1239
%{_mandir}/man8/ovs-bugtool.8%{?ext_man}
1240
%{_mandir}/man8/ovs-ctl.8%{?ext_man}
1241
%{_mandir}/man8/ovs-dpctl-top.8%{?ext_man}
1242
%{_mandir}/man8/ovs-dpctl.8%{?ext_man}
1243
%{_mandir}/man8/ovs-kmod-ctl.8%{?ext_man}
1244
%{_mandir}/man8/ovs-ofctl.8%{?ext_man}
1245
%{_mandir}/man8/ovs-parse-backtrace.8%{?ext_man}
1246
%{_mandir}/man8/ovs-vsctl.8%{?ext_man}
1247
%{_mandir}/man8/ovs-vswitchd.8%{?ext_man}
1248
%{_mandir}/man5/ovsdb.local-config.5.gz
1249
%config(noreplace) %{_sysconfdir}/logrotate.d/openvswitch
1250
%{_sbindir}/rcovsdb-server
1251
%{_sbindir}/rcovs-vswitchd
1252
%{_sbindir}/rcopenvswitch
1253
%{_sbindir}/rcovs-delete-transient-ports
1254
%{_unitdir}/openvswitch.service
1255
%{_unitdir}/ovs-vswitchd.service
1256
%{_unitdir}/ovsdb-server.service
1257
%{_unitdir}/ovs-delete-transient-ports.service
1258
%if 0%{?suse_version}
1259
%{_fillupdir}/sysconfig.openvswitch
1260
%{_datadir}/bash-completion/completions/ovs-appctl-bashcomp.bash
1261
%{_datadir}/bash-completion/completions/ovs-vsctl-bashcomp.bash
1262
%else
1263
%config(noreplace) %{_sysconfdir}/sysconfig/openvswitch
1264
%{_sysconfdir}/bash_completion.d/ovs-appctl-bashcomp.bash
1265
%{_sysconfdir}/bash_completion.d/ovs-vsctl-bashcomp.bash
1266
%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
1267
%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
1268
%endif
1269
%ghost %attr(755,root,root) %{_rundir}/openvswitch
1270
%ghost %attr(644,root,root) %{_rundir}/openvswitch.useropts
1271
%exclude %{_docdir}/%{_name}
1272
%doc %ovs_dir/AUTHORS.rst %ovs_dir/CONTRIBUTING.rst %ovs_dir/NEWS %ovs_dir/README.rst
1273
%license %ovs_dir/LICENSE %ovs_dir/NOTICE
1274
1275
%files doc
1276
%exclude %{_docdir}/%{name}/AUTHORS.rst
1277
%exclude %{_docdir}/%{name}/CONTRIBUTING.rst
1278
%exclude %{_docdir}/%{name}/NEWS
1279
%exclude %{_docdir}/%{name}/README.rst
1280
%{_docdir}/%{name}/
1281
1282
%files -n %{ovs_lname}
1283
%{_libdir}/libofproto-3*.so.*
1284
%{_libdir}/libopenvswitch-3*.so.*
1285
%{_libdir}/libovsdb-3*.so.*
1286
%{_libdir}/libsflow-3*.so.*
1287
%{_libdir}/libvtep-3*.so.*
1288
1289
%files pki
1290
%{_mandir}/man8/ovs-pki.8%{?ext_man}
1291
%{_bindir}/ovs-pki
1292
1293
%files vtep
1294
%{_bindir}/vtep-ctl
1295
%{_mandir}/man5/vtep.5%{?ext_man}
1296
%{_mandir}/man8/vtep-ctl.8%{?ext_man}
1297
%{_datadir}/openvswitch/scripts/ovs-vtep
1298
%{_datadir}/openvswitch/vtep.ovsschema
1299
1300
%files ipsec
1301
%{_datadir}/openvswitch/scripts/ovs-monitor-ipsec
1302
%{_sbindir}/rcopenvswitch-ipsec
1303
%{_unitdir}/openvswitch-ipsec.service
1304
1305
%files test
1306
%{_bindir}/ovs-l3ping
1307
%{_bindir}/ovs-pcap
1308
%{_bindir}/ovs-test
1309
%{_bindir}/ovs-testcontroller
1310
%{_bindir}/ovs-tcpdump
1311
%{_bindir}/ovs-tcpundump
1312
%{_bindir}/ovs-vlan-test
1313
%{_mandir}/man1/ovs-pcap.1%{?ext_man}
1314
%{_mandir}/man1/ovs-tcpundump.1%{?ext_man}
1315
%{_mandir}/man8/ovs-l3ping.8%{?ext_man}
1316
%{_mandir}/man8/ovs-tcpdump.8%{?ext_man}
1317
%{_mandir}/man8/ovs-testcontroller.8%{?ext_man}
1318
%{_mandir}/man8/ovs-test.8%{?ext_man}
1319
%{_mandir}/man8/ovs-vlan-test.8%{?ext_man}
1320
%{python3_sitelib}/ovstest/
1321
1322
%files devel
1323
%{_libdir}/libofproto.so
1324
%{_libdir}/libopenvswitch.so
1325
%{_libdir}/libovsdb.so
1326
%{_libdir}/libsflow.so
1327
%{_libdir}/libvtep.so
1328
%{_includedir}/openflow/
1329
%{_includedir}/openvswitch/
1330
%{_libdir}/pkgconfig/*.pc
1331
# Devel tools required for OVN
1332
%{_bindir}/ovsdb-idlc
1333
%{_mandir}/man1/ovsdb-idlc.1%{?ext_man}
1334
%dir %{_datadir}/openvswitch/ovsdb
1335
%{_datadir}/openvswitch/ovsdb/ovsdb-doc
1336
%{_datadir}/openvswitch/ovsdb/ovsdb-dot
1337
1338
%files %{python_files ovs%{name_tag}}
1339
%license %ovs_dir/LICENSE %ovs_dir/NOTICE
1340
%{python_sitearch}/ovs
1341
%{python_sitearch}/ovs-*.egg-info
1342
1343
%files -n ovn%{name_tag}
1344
%defattr(-,openvswitch,openvswitch)
1345
%dir %{_localstatedir}/log/ovn
1346
%defattr(-,root,root)
1347
%if 0%{?suse_version}
1348
%{_fillupdir}/sysconfig.ovn
1349
%else
1350
%config(noreplace) %{_sysconfdir}/sysconfig/ovn
1351
%endif
1352
%{_bindir}/ovn-nbctl
1353
%{_bindir}/ovn-sbctl
1354
%{_bindir}/ovn-trace
1355
%{_bindir}/ovn-detrace
1356
%{_bindir}/ovn_detrace.py
1357
%{_bindir}/ovn-appctl
1358
%{_bindir}/ovn-ic-nbctl
1359
%{_bindir}/ovn-ic-sbctl
1360
%dir %{_datadir}/ovn
1361
%dir %{_datadir}/ovn/scripts
1362
%{_datadir}/ovn/scripts/ovn-ctl
1363
%{_datadir}/ovn/scripts/ovn-lib
1364
%{_datadir}/ovn/scripts/ovndb-servers.ocf
1365
%{_datadir}/ovn/scripts/ovn-bugtool-nbctl-show
1366
%{_datadir}/ovn/scripts/ovn-bugtool-sbctl-lflow-list
1367
%{_datadir}/ovn/scripts/ovn-bugtool-sbctl-show
1368
%{_mandir}/man5/ovn-nb.5%{?ext_man}
1369
%{_mandir}/man5/ovn-sb.5%{?ext_man}
1370
%{_mandir}/man8/ovn-ic-nbctl.8%{?ext_man}
1371
%{_mandir}/man8/ovn-ic-sbctl.8%{?ext_man}
1372
%{_mandir}/man8/ovn-ic.8%{?ext_man}
1373
%{_mandir}/man5/ovn-ic-nb.5%{?ext_man}
1374
%{_mandir}/man5/ovn-ic-sb.5%{?ext_man}
1375
%{_mandir}/man1/ovn-detrace.1%{?ext_man}
1376
%{_mandir}/man8/ovn-appctl.8%{?ext_man}
1377
%{_mandir}/man7/ovn-architecture.7%{?ext_man}
1378
%{_mandir}/man8/ovn-ctl.8%{?ext_man}
1379
%{_mandir}/man8/ovn-nbctl.8%{?ext_man}
1380
%{_mandir}/man8/ovn-trace.8%{?ext_man}
1381
%{_mandir}/man8/ovn-sbctl.8%{?ext_man}
1382
%config(noreplace) %{_sysconfdir}/logrotate.d/ovn
1383
%doc %ovn_dir/AUTHORS.rst %ovn_dir/CONTRIBUTING.rst %ovn_dir/NEWS %ovn_dir/README.rst
1384
%license %ovn_dir/LICENSE %ovn_dir/NOTICE
1385
1386
%files -n ovn%{name_tag}-docker
1387
%{_bindir}/ovn-docker-overlay-driver
1388
%{_bindir}/ovn-docker-underlay-driver
1389
1390
%files -n ovn%{name_tag}-central
1391
# Can't use libexecdir because it differs between
1392
# RedHat and SUSE and firewalld expects things in /usr/lib
1393
%dir %{_prefix}/lib/firewalld
1394
%dir %{_prefix}/lib/firewalld/services
1395
%{_bindir}/ovn-northd
1396
%{_bindir}/ovn-ic
1397
%{_mandir}/man8/ovn-northd.8%{?ext_man}
1398
%{_datadir}/ovn/ovn-nb.ovsschema
1399
%{_datadir}/ovn/ovn-sb.ovsschema
1400
%{_datadir}/ovn/ovn-ic-nb.ovsschema
1401
%{_datadir}/ovn/ovn-ic-sb.ovsschema
1402
%{_unitdir}/ovn-northd.service
1403
%{_sbindir}/rcovn-northd
1404
%{_prefix}/lib/firewalld/services/ovn-central-firewall-service.xml
1405
1406
%files -n ovn%{name_tag}-host
1407
# Can't use libexecdir because it differs between
1408
# RedHat and SUSE and firewalld expects things in /usr/lib
1409
%dir %{_prefix}/lib/firewalld
1410
%dir %{_prefix}/lib/firewalld/services
1411
%{_bindir}/ovn-controller
1412
%{_mandir}/man8/ovn-controller.8%{?ext_man}
1413
%{_unitdir}/ovn-controller.service
1414
%{_sbindir}/rcovn-controller
1415
%{_prefix}/lib/firewalld/services/ovn-host-firewall-service.xml
1416
1417
%files -n ovn%{name_tag}-vtep
1418
%{_bindir}/ovn-controller-vtep
1419
%{_mandir}/man8/ovn-controller-vtep.8%{?ext_man}
1420
%{_unitdir}/ovn-controller-vtep.service
1421
%{_sbindir}/rcovn-controller-vtep
1422
1423
%files -n ovn%{name_tag}-doc
1424
%exclude %{_docdir}/ovn/AUTHORS.rst
1425
%exclude %{_docdir}/ovn/CONTRIBUTING.rst
1426
%exclude %{_docdir}/ovn/NEWS
1427
%exclude %{_docdir}/ovn/README.rst
1428
%{_docdir}/ovn/
1429
1430
%files -n %{ovn_lname}
1431
%{_libdir}/libovn-*.so.*
1432
1433
%files -n ovn%{name_tag}-devel
1434
%{_libdir}/libovn.so
1435
%{_includedir}/ovn/
1436
1437
%changelog
1438