1 # Spec file for Open vSwitch.
3 # Copyright (C) 2009, 2010, 2013, 2014, 2015, 2016 Nicira Networks, Inc.
5 # Copying and distribution of this file, with or without modification,
6 # are permitted in any medium without royalty provided the copyright
7 # notice and this notice are preserved. This file is offered as-is,
8 # without warranty of any kind.
10 # If tests have to be skipped while building, specify the '--without check'
11 # option. For example:
12 # rpmbuild -bb --without check rhel/openvswitch-fedora.spec
14 # Support for executing kernel data path tests under rpmbuild is
15 # provided, however this is intended for use only in test environments
16 # and should not be used otherwise (these tests require root privileges).
17 # These tests can be executed, for example, via:
18 # rpmbuild -rb --with check_datapath_kernel openvswitch-fedora.src.rpm
20 # These tests will use the currently installed OVS kernel modules, when
21 # testing out of tree kernel modules the appropriate openvswitch-kmod
22 # package should be installed first.
24 #%define kernel 2.6.40.4-5.fc15.x86_64
26 # If libcap-ng isn't available and there is no need for running OVS
27 # as regular user, specify the '--without libcapng'
28 %bcond_without libcapng
29 # To enable DPDK support, specify '--with dpdk' when building
31 # Enable Python 3 by specifying '--with build_python3'.
32 # This is enabled by default for versions of the distribution that
33 # have Python 3 by default (Fedora > 22).
34 %bcond_with build_python3
36 # Enable PIE, bz#955181
37 %global _hardened_build
1
39 # some distros (e.g: RHEL-7) don't define _rundir macro yet
40 # Fedora 15 onwards uses /run as _rundir
45 # define the python package prefix based on distribution version so that we can
46 # simultaneously support RHEL-based and later Fedora versions in this spec file.
51 %if 0%{?rhel} || 0%{?fedora} < 25
58 Group: System Environment
/Daemons
59 URL: http
://www.openvswitch.org
/
62 # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the
63 # lib/sflow*.[ch] files are SISSL
64 # datapath/ is GPLv2 (although not built into any of the binary packages)
65 License: ASL
2.0 and LGPLv2
+ and SISSL
67 Source: http
://openvswitch.org
/releases
/%{name}-%{version}.tar.gz
69 BuildRequires
: autoconf automake libtool
70 BuildRequires
: systemd
-units openssl openssl
-devel
71 BuildRequires
: %{_py2}-devel
72 %if 0%{?fedora} > 22 || %{with build_python3}
73 BuildRequires
: python3
-devel
75 BuildRequires
: desktop
-file
-utils
76 BuildRequires
: groff graphviz
77 BuildRequires
: checkpolicy
, selinux
-policy
-devel
78 BuildRequires
: python
-sphinx
79 # make check dependencies
80 BuildRequires
: %{_py2}-twisted%{?rhel:-core} %{_py2}-zope-interface %{_py2}-six
81 BuildRequires
: procps
-ng
83 BuildRequires
: libcap
-ng libcap
-ng
-devel
86 BuildRequires
: libpcap
-devel numactl
-devel
87 BuildRequires
: dpdk
-devel
>= 17.05.1
88 Provides: %{name}-dpdk = %{version}-%{release}
91 Requires: openssl hostname iproute module
-init
-tools
92 #Upstream kernel commit 4f647e0a3c37b8d5086214128614a136064110c3
93 #Requires: kernel >= 3.15.0-0
95 Requires(post
): systemd
-units
96 Requires(preun
): systemd
-units
97 Requires(postun
): systemd
-units
98 Obsoletes
: openvswitch
-controller
<= 0:2.1.0-1
100 # to skip running checks, pass --without check
102 %bcond_with check_datapath_kernel
105 Open vSwitch provides standard network bridging functions and
106 support
for the OpenFlow protocol
for remote per
-flow control of
109 %package selinux
-policy
110 Summary: Open vSwitch SELinux policy
113 Requires: selinux
-policy
-targeted
115 %description selinux
-policy
116 Tailored Open vSwitch SELinux policy
118 %package -n
%{_py2}-openvswitch
119 Summary: Open vSwitch python2 bindings
123 Requires: %{_py2}-six
124 %{?python_provide:%python_provide python2-openvswitch = %{version}-%{release}}
125 %description -n
%{_py2}-openvswitch
126 Python bindings
for the Open vSwitch database
128 %if 0%{?fedora} > 22 || %{with build_python3}
129 %package -n python3
-openvswitch
130 Summary: Open vSwitch python3 bindings
134 Requires: python3
-six
135 %{?python_provide:%python_provide python3-openvswitch = %{version}-%{release}}
137 %description -n python3
-openvswitch
138 Python bindings
for the Open vSwitch database
142 Summary: Open vSwitch testing utilities
145 Requires: %{_py2}-openvswitch = %{version}-%{release}
146 Requires: %{_py2} %{_py2}-twisted
149 Utilities that are useful to diagnose performance and connectivity
150 issues
in Open vSwitch setup.
153 Summary: Open vSwitch OpenFlow development package
(library
, headers
)
155 Provides: openvswitch
-static
= %{version}-%{release}
158 This provides static library
, libopenswitch.a and the openvswitch header
159 files needed to build an external application.
162 Summary: Open vSwitch
- Open Virtual Network support
164 Requires: openvswitch openvswitch
-ovn
-common
165 Requires: firewalld
-filesystem
167 %description ovn
-central
168 OVN
, the Open Virtual Network
, is a system to support virtual network
169 abstraction. OVN complements the existing capabilities of OVS to add
170 native support
for virtual network abstractions
, such as virtual L2 and L3
171 overlays and security groups.
174 Summary: Open vSwitch
- Open Virtual Network support
176 Requires: openvswitch openvswitch
-ovn
-common
177 Requires: firewalld
-filesystem
179 %description ovn
-host
180 OVN
, the Open Virtual Network
, is a system to support virtual network
181 abstraction. OVN complements the existing capabilities of OVS to add
182 native support
for virtual network abstractions
, such as virtual L2 and L3
183 overlays and security groups.
186 Summary: Open vSwitch
- Open Virtual Network support
188 Requires: openvswitch openvswitch
-ovn
-common
190 %description ovn
-vtep
194 Summary: Open vSwitch
- Open Virtual Network support
196 Requires: openvswitch
198 %description ovn
-common
199 Utilities that are use to diagnose and manage the OVN components.
202 Summary: Open vSwitch
- Open Virtual Network support
204 Requires: openvswitch openvswitch
-ovn
-common
%{_py2}-openvswitch
206 %description ovn
-docker
207 Docker network plugins
for OVN.
220 --with
-dpdk
=$
(dirname
%{_datadir}/dpdk
/*/.config
) \
223 --with
-pkidir
=%{_sharedstatedir}/openvswitch
/pki
227 make -f
%{_datadir}/selinux
/devel
/Makefile
230 rm -rf $RPM_BUILD_ROOT
231 make install DESTDIR
=$RPM_BUILD_ROOT
233 install -d
-m
0755 $RPM_BUILD_ROOT
%{_rundir}/openvswitch
234 install -d
-m
0750 $RPM_BUILD_ROOT
%{_localstatedir}/log
/openvswitch
235 install -d
-m
0755 $RPM_BUILD_ROOT
%{_sysconfdir}/openvswitch
237 install -p
-D
-m
0644 \
238 rhel
/usr_share_openvswitch_scripts_systemd_sysconfig.template \
239 $RPM_BUILD_ROOT
/%{_sysconfdir}/sysconfig
/openvswitch
240 for service
in openvswitch ovsdb
-server ovs
-vswitchd \
241 ovn
-controller ovn
-controller
-vtep ovn
-northd
; do
242 install -p
-D
-m
0644 \
243 rhel
/usr_lib_systemd_system_$
{service
}.service \
244 $RPM_BUILD_ROOT
%{_unitdir}/${service}.service
246 install -m
0755 rhel
/etc_init.d_openvswitch \
247 $RPM_BUILD_ROOT
%{_datadir}/openvswitch
/scripts
/openvswitch.init
249 install -p
-D
-m
0644 rhel
/etc_logrotate.d_openvswitch \
250 $RPM_BUILD_ROOT
/%{_sysconfdir}/logrotate.d
/openvswitch
252 install -m
0644 vswitchd
/vswitch.ovsschema \
253 $RPM_BUILD_ROOT
/%{_datadir}/openvswitch
/vswitch.ovsschema
255 install -d
-m
0755 $RPM_BUILD_ROOT
/%{_sysconfdir}/sysconfig
/network
-scripts
/
256 install -p
-m
0755 rhel
/etc_sysconfig_network
-scripts_ifdown
-ovs \
257 $RPM_BUILD_ROOT
/%{_sysconfdir}/sysconfig
/network
-scripts
/ifdown
-ovs
258 install -p
-m
0755 rhel
/etc_sysconfig_network
-scripts_ifup
-ovs \
259 $RPM_BUILD_ROOT
/%{_sysconfdir}/sysconfig
/network
-scripts
/ifup
-ovs
261 install -d
-m
0755 $RPM_BUILD_ROOT
%{python2_sitelib}
262 cp
-a $RPM_BUILD_ROOT
/%{_datadir}/openvswitch
/python
/* \
263 $RPM_BUILD_ROOT
%{python2_sitelib}
265 %if 0%{?fedora} > 22 || %{with build_python3}
266 install -d
-m
0755 $RPM_BUILD_ROOT
%{python3_sitelib}
267 cp
-a $RPM_BUILD_ROOT
/%{_datadir}/openvswitch
/python
/ovs \
268 $RPM_BUILD_ROOT
%{python3_sitelib}
271 rm -rf $RPM_BUILD_ROOT
/%{_datadir}/openvswitch
/python
/
273 install -d
-m
0755 $RPM_BUILD_ROOT
/%{_sharedstatedir}/openvswitch
275 touch $RPM_BUILD_ROOT
%{_sysconfdir}/openvswitch
/conf.db
276 touch $RPM_BUILD_ROOT
%{_sysconfdir}/openvswitch
/.conf.db.~lock~
277 touch $RPM_BUILD_ROOT
%{_sysconfdir}/openvswitch
/system
-id.conf
279 install -p
-m
644 -D selinux
/openvswitch
-custom.pp \
280 $RPM_BUILD_ROOT
%{_datadir}/selinux/packages/%{name}/openvswitch
-custom.pp
282 install -d $RPM_BUILD_ROOT
%{_prefix}/lib
/firewalld
/services
/
283 install -p
-m
0644 rhel
/usr_lib_firewalld_services_ovn
-central
-firewall
-service.xml \
284 $RPM_BUILD_ROOT
%{_prefix}/lib
/firewalld
/services
/ovn
-central
-firewall
-service.xml
285 install -p
-m
0644 rhel
/usr_lib_firewalld_services_ovn
-host
-firewall
-service.xml \
286 $RPM_BUILD_ROOT
%{_prefix}/lib
/firewalld
/services
/ovn
-host
-firewall
-service.xml
288 install -d
-m
0755 $RPM_BUILD_ROOT
%{_prefix}/lib
/ocf
/resource.d
/ovn
289 ln
-s
%{_datadir}/openvswitch
/scripts
/ovndb
-servers.ocf \
290 $RPM_BUILD_ROOT
%{_prefix}/lib
/ocf
/resource.d
/ovn
/ovndb
-servers
292 # remove unpackaged files
293 rm -f $RPM_BUILD_ROOT
%{_bindir}/ovs
-parse
-backtrace \
294 $RPM_BUILD_ROOT
%{_sbindir}/ovs
-vlan
-bug
-workaround \
295 $RPM_BUILD_ROOT
%{_mandir}/man8
/ovs
-vlan
-bug
-workaround
.8
299 if make check TESTSUITEFLAGS
='
%{_smp_mflags}' RECHECK
=yes
; then :;
301 cat tests
/testsuite.log
305 %if %{with check_datapath_kernel}
306 if make check
-kernel RECHECK
=yes
; then :;
308 cat tests
/system
-kmod
-testsuite.log
314 rm -rf $RPM_BUILD_ROOT
317 %if 0%{?systemd_preun:1}
318 %systemd_preun %{name}.service
320 if [ $
1 -eq
0 ] ; then
321 # Package removal, not upgrade
322 /bin
/systemctl
--no
-reload disable
%{name}.service
>/dev
/null
2>&1 ||
:
323 /bin
/systemctl stop
%{name}.service
>/dev
/null
2>&1 ||
:
328 %if 0%{?systemd_preun:1}
329 %systemd_preun ovn
-northd.service
331 if [ $
1 -eq
0 ] ; then
332 # Package removal, not upgrade
333 /bin
/systemctl
--no
-reload disable ovn
-northd.service
>/dev
/null
2>&1 ||
:
334 /bin
/systemctl stop ovn
-northd.service
>/dev
/null
2>&1 ||
:
339 %if 0%{?systemd_preun:1}
340 %systemd_preun ovn
-controller.service
342 if [ $
1 -eq
0 ] ; then
343 # Package removal, not upgrade
344 /bin
/systemctl
--no
-reload disable ovn
-controller.service
>/dev
/null
2>&1 ||
:
345 /bin
/systemctl stop ovn
-controller.service
>/dev
/null
2>&1 ||
:
350 %if 0%{?systemd_preun:1}
351 %systemd_preun ovn
-controller
-vtep.service
353 if [ $
1 -eq
0 ] ; then
354 # Package removal, not upgrade
355 /bin
/systemctl
--no
-reload disable ovn
-controller
-vtep.service
>/dev
/null
2>&1 ||
:
356 /bin
/systemctl stop ovn
-controller
-vtep.service
>/dev
/null
2>&1 ||
:
361 %if 0%{?systemd_post:1}
362 %systemd_post %{name}.service
364 # Package install, not upgrade
365 if [ $
1 -eq
1 ]; then
366 /bin
/systemctl daemon
-reload
>dev
/null ||
:
371 %if 0%{?systemd_post:1}
372 %systemd_post ovn
-northd.service
374 # Package install, not upgrade
375 if [ $
1 -eq
1 ]; then
376 /bin
/systemctl daemon
-reload
>dev
/null ||
:
381 %if 0%{?systemd_post:1}
382 %systemd_post ovn
-controller.service
384 # Package install, not upgrade
385 if [ $
1 -eq
1 ]; then
386 /bin
/systemctl daemon
-reload
>dev
/null ||
:
391 %if 0%{?systemd_post:1}
392 %systemd_post ovn
-controller
-vtep.service
394 # Package install, not upgrade
395 if [ $
1 -eq
1 ]; then
396 /bin
/systemctl daemon
-reload
>dev
/null ||
:
401 /usr
/sbin
/semodule
-i
%{_datadir}/selinux/packages/%{name}/openvswitch
-custom.pp
&> /dev
/null ||
:
404 %if 0%{?systemd_postun:1}
405 %systemd_postun %{name}.service
407 /bin
/systemctl daemon
-reload
>/dev
/null
2>&1 ||
:
411 %if 0%{?systemd_postun:1}
412 %systemd_postun ovn
-northd.service
414 /bin
/systemctl daemon
-reload
>/dev
/null
2>&1 ||
:
418 %if 0%{?systemd_postun:1}
419 %systemd_postun ovn
-controller.service
421 /bin
/systemctl daemon
-reload
>/dev
/null
2>&1 ||
:
425 %if 0%{?systemd_postun:1}
426 %systemd_postun ovn
-controller
-vtep.service
428 /bin
/systemctl daemon
-reload
>/dev
/null
2>&1 ||
:
431 %postun selinux
-policy
432 if [ $
1 -eq
0 ] ; then
433 /usr
/sbin
/semodule
-r openvswitch
-custom
&> /dev
/null ||
:
436 %files selinux
-policy
437 %defattr(-,root
,root
)
438 %{_datadir}/selinux/packages/%{name}/openvswitch
-custom.pp
440 %files -n
%{_py2}-openvswitch
441 %{python2_sitelib}/ovs
444 %if 0%{?fedora} > 22 || %{with build_python3}
445 %files -n python3
-openvswitch
446 %{python3_sitelib}/ovs
452 %{_bindir}/ovs
-vlan
-test
453 %{_bindir}/ovs
-l3ping
455 %{_bindir}/ovs
-tcpdump
456 %{_bindir}/ovs
-tcpundump
457 %{_mandir}/man8
/ovs
-test.8*
458 %{_mandir}/man8
/ovs
-vlan
-test.8*
459 %{_mandir}/man8
/ovs
-l3ping
.8*
460 %{_mandir}/man1
/ovs
-pcap
.1*
461 %{_mandir}/man8
/ovs
-tcpdump
.8*
462 %{_mandir}/man1
/ovs
-tcpundump
.1*
463 %{python2_sitelib}/ovstest
468 %{_libdir}/pkgconfig
/*.pc
469 %{_includedir}/openvswitch
/*
470 %{_includedir}/openflow
/*
474 %defattr(-,root
,root
)
475 %{_sysconfdir}/bash_completion.d
/ovs
-appctl
-bashcomp.bash
476 %{_sysconfdir}/bash_completion.d
/ovs
-vsctl
-bashcomp.bash
477 %dir %{_sysconfdir}/openvswitch
478 %config %ghost %{_sysconfdir}/openvswitch
/conf.db
479 %ghost %{_sysconfdir}/openvswitch
/.conf.db.~lock~
480 %config %ghost %{_sysconfdir}/openvswitch
/system
-id.conf
481 %config(noreplace
) %{_sysconfdir}/sysconfig
/openvswitch
482 %config(noreplace
) %{_sysconfdir}/logrotate.d
/openvswitch
483 %{_unitdir}/openvswitch.service
484 %{_unitdir}/ovsdb
-server.service
485 %{_unitdir}/ovs
-vswitchd.service
486 %{_datadir}/openvswitch
/scripts
/openvswitch.init
487 %{_sysconfdir}/sysconfig
/network
-scripts
/ifup
-ovs
488 %{_sysconfdir}/sysconfig
/network
-scripts
/ifdown
-ovs
489 %{_datadir}/openvswitch
/bugtool
-plugins
/
490 %{_datadir}/openvswitch
/scripts
/ovs
-bugtool
-*
491 %{_datadir}/openvswitch
/scripts
/ovs
-check
-dead
-ifs
492 %{_datadir}/openvswitch
/scripts
/ovs
-lib
493 %{_datadir}/openvswitch
/scripts
/ovs
-save
494 %{_datadir}/openvswitch
/scripts
/ovs
-vtep
495 %{_datadir}/openvswitch
/scripts
/ovs
-ctl
496 %config %{_datadir}/openvswitch
/vswitch.ovsschema
497 %config %{_datadir}/openvswitch
/vtep.ovsschema
498 %{_bindir}/ovs
-appctl
499 %{_bindir}/ovs
-docker
501 %{_bindir}/ovs
-dpctl
-top
504 %{_bindir}/ovsdb
-client
505 %{_bindir}/ovsdb
-tool
506 %{_bindir}/ovs
-testcontroller
509 %{_sbindir}/ovs
-bugtool
510 %{_sbindir}/ovs
-vswitchd
511 %{_sbindir}/ovsdb
-server
512 %{_mandir}/man1
/ovsdb
-client
.1*
513 %{_mandir}/man1
/ovsdb
-server
.1*
514 %{_mandir}/man1
/ovsdb
-tool
.1*
515 %{_mandir}/man5
/ovs
-vswitchd.conf.db
.5*
516 %{_mandir}/man5
/vtep
.5*
517 %{_mandir}/man7
/ovs
-fields
.7*
518 %{_mandir}/man8
/vtep
-ctl
.8*
519 %{_mandir}/man8
/ovs
-appctl
.8*
520 %{_mandir}/man8
/ovs
-bugtool
.8*
521 %{_mandir}/man8
/ovs
-ctl
.8*
522 %{_mandir}/man8
/ovs
-dpctl
.8*
523 %{_mandir}/man8
/ovs
-dpctl
-top
.8*
524 %{_mandir}/man8
/ovs
-ofctl
.8*
525 %{_mandir}/man8
/ovs
-pki
.8*
526 %{_mandir}/man8
/ovs
-vsctl
.8*
527 %{_mandir}/man8
/ovs
-vswitchd
.8*
528 %{_mandir}/man8
/ovs
-parse
-backtrace
.8*
529 %{_mandir}/man8
/ovs
-testcontroller
.8*
530 %doc COPYING NOTICE README.rst NEWS rhel
/README.RHEL.rst
533 %ghost %attr(755,root
,root
) %{_rundir}/openvswitch
536 %{_bindir}/ovn
-docker
-overlay
-driver
537 %{_bindir}/ovn
-docker
-underlay
-driver
543 %{_bindir}/ovn
-detrace
544 %{_datadir}/openvswitch
/scripts
/ovn
-ctl
545 %{_datadir}/openvswitch
/scripts
/ovndb
-servers.ocf
546 %{_datadir}/openvswitch
/scripts
/ovn
-bugtool
-nbctl
-show
547 %{_datadir}/openvswitch
/scripts
/ovn
-bugtool
-sbctl
-lflow
-list
548 %{_datadir}/openvswitch
/scripts
/ovn
-bugtool
-sbctl
-show
549 %{_mandir}/man8
/ovn
-ctl
.8*
550 %{_mandir}/man8
/ovn
-nbctl
.8*
551 %{_mandir}/man8
/ovn
-trace
.8*
552 %{_mandir}/man1
/ovn
-detrace
.1*
553 %{_mandir}/man7
/ovn
-architecture
.7*
554 %{_mandir}/man8
/ovn
-sbctl
.8*
555 %{_mandir}/man5
/ovn
-nb
.5*
556 %{_mandir}/man5
/ovn
-sb
.5*
557 %{_prefix}/lib
/ocf
/resource.d
/ovn
/ovndb
-servers
560 %{_bindir}/ovn
-northd
561 %{_mandir}/man8
/ovn
-northd
.8*
562 %config %{_datadir}/openvswitch
/ovn
-nb.ovsschema
563 %config %{_datadir}/openvswitch
/ovn
-sb.ovsschema
564 %{_unitdir}/ovn
-northd.service
565 %{_prefix}/lib
/firewalld
/services
/ovn
-central
-firewall
-service.xml
568 %{_bindir}/ovn
-controller
569 %{_mandir}/man8
/ovn
-controller
.8*
570 %{_unitdir}/ovn
-controller.service
571 %{_prefix}/lib
/firewalld
/services
/ovn
-host
-firewall
-service.xml
574 %{_bindir}/ovn
-controller
-vtep
575 %{_mandir}/man8
/ovn
-controller
-vtep
.8*
576 %{_unitdir}/ovn
-controller
-vtep.service
579 * Wed Jan
12 2011 Ralf Spenneberg
<ralf@os
-s.net
>