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
32 # Enable PIE, bz#955181
33 %global _hardened_build
1
35 # some distros (e.g: RHEL-7) don't define _rundir macro yet
36 # Fedora 15 onwards uses /run as _rundir
43 Group: System Environment
/Daemons
44 URL: http
://www.openvswitch.org
/
47 # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the
48 # lib/sflow*.[ch] files are SISSL
49 # datapath/ is GPLv2 (although not built into any of the binary packages)
50 License: ASL
2.0 and LGPLv2
+ and SISSL
52 Source: http
://openvswitch.org
/releases
/%{name}-%{version}.tar.gz
54 BuildRequires
: autoconf automake libtool
55 BuildRequires
: systemd
-units openssl openssl
-devel
56 BuildRequires
: python python
-twisted
-core python
-zope
-interface python
-six
57 BuildRequires
: desktop
-file
-utils
58 BuildRequires
: groff graphviz
59 BuildRequires
: checkpolicy
, selinux
-policy
-devel
60 # make check dependencies
61 BuildRequires
: procps
-ng
63 BuildRequires
: libcap
-ng libcap
-ng
-devel
66 BuildRequires
: dpdk
-devel
>= 2.2.0
67 Provides: %{name}-dpdk = %{version}-%{release}
70 Requires: openssl iproute module
-init
-tools
71 #Upstream kernel commit 4f647e0a3c37b8d5086214128614a136064110c3
72 #Requires: kernel >= 3.15.0-0
74 Requires(post
): systemd
-units
75 Requires(preun
): systemd
-units
76 Requires(postun
): systemd
-units
77 Obsoletes
: openvswitch
-controller
<= 0:2.1.0-1
80 %bcond_with check_datapath_kernel
83 Open vSwitch provides standard network bridging functions and
84 support
for the OpenFlow protocol
for remote per
-flow control of
87 %package selinux
-policy
88 Summary: Open vSwitch SELinux policy
91 Requires: selinux
-policy
-targeted
93 %description selinux
-policy
94 Tailored Open vSwitch SELinux policy
96 %package -n python
-openvswitch
97 Summary: Open vSwitch python bindings
103 %description -n python
-openvswitch
104 Python bindings
for the Open vSwitch database
107 Summary: Open vSwitch testing utilities
110 Requires: python
-openvswitch
= %{version}-%{release}
111 Requires: python python
-twisted
-core python
-twisted
-web
114 Utilities that are useful to diagnose performance and connectivity
115 issues
in Open vSwitch setup.
118 Summary: Open vSwitch OpenFlow development package
(library
, headers
)
120 Provides: openvswitch
-static
= %{version}-%{release}
123 This provides static library
, libopenswitch.a and the openvswitch header
124 files needed to build an external application.
127 Summary: Open vSwitch
- Open Virtual Network support
129 Requires: openvswitch openvswitch
-ovn
-common
131 %description ovn
-central
132 OVN
, the Open Virtual Network
, is a system to support virtual network
133 abstraction. OVN complements the existing capabilities of OVS to add
134 native support
for virtual network abstractions
, such as virtual L2 and L3
135 overlays and security groups.
138 Summary: Open vSwitch
- Open Virtual Network support
140 Requires: openvswitch openvswitch
-ovn
-common
142 %description ovn
-host
143 OVN
, the Open Virtual Network
, is a system to support virtual network
144 abstraction. OVN complements the existing capabilities of OVS to add
145 native support
for virtual network abstractions
, such as virtual L2 and L3
146 overlays and security groups.
149 Summary: Open vSwitch
- Open Virtual Network support
151 Requires: openvswitch openvswitch
-ovn
-common
153 %description ovn
-vtep
157 Summary: Open vSwitch
- Open Virtual Network support
159 Requires: openvswitch
161 %description ovn
-common
162 Utilities that are use to diagnose and manage the OVN components.
165 Summary: Open vSwitch
- Open Virtual Network support
167 Requires: openvswitch openvswitch
-ovn
-common python
-openvswitch
169 %description ovn
-docker
170 Docker network plugins
for OVN.
183 --with
-dpdk
=$
(dirname
%{_datadir}/dpdk
/*/.config
) \
186 --with
-pkidir
=%{_sharedstatedir}/openvswitch
/pki
190 make -f
%{_datadir}/selinux
/devel
/Makefile
193 rm -rf $RPM_BUILD_ROOT
194 make install DESTDIR
=$RPM_BUILD_ROOT
196 install -d
-m
0755 $RPM_BUILD_ROOT
%{_sysconfdir}/openvswitch
198 install -p
-D
-m
0644 \
199 rhel
/usr_share_openvswitch_scripts_systemd_sysconfig.template \
200 $RPM_BUILD_ROOT
/%{_sysconfdir}/sysconfig
/openvswitch
201 for service
in openvswitch ovsdb
-server ovs
-vswitchd \
202 ovn
-controller ovn
-controller
-vtep ovn
-northd
; do
203 install -p
-D
-m
0644 \
204 rhel
/usr_lib_systemd_system_$
{service
}.service \
205 $RPM_BUILD_ROOT
%{_unitdir}/${service}.service
207 install -m
0755 rhel
/etc_init.d_openvswitch \
208 $RPM_BUILD_ROOT
%{_datadir}/openvswitch
/scripts
/openvswitch.init
210 install -p
-D
-m
0644 rhel
/etc_logrotate.d_openvswitch \
211 $RPM_BUILD_ROOT
/%{_sysconfdir}/logrotate.d
/openvswitch
213 install -m
0644 vswitchd
/vswitch.ovsschema \
214 $RPM_BUILD_ROOT
/%{_datadir}/openvswitch
/vswitch.ovsschema
216 install -d
-m
0755 $RPM_BUILD_ROOT
/%{_sysconfdir}/sysconfig
/network
-scripts
/
217 install -p
-m
0755 rhel
/etc_sysconfig_network
-scripts_ifdown
-ovs \
218 $RPM_BUILD_ROOT
/%{_sysconfdir}/sysconfig
/network
-scripts
/ifdown
-ovs
219 install -p
-m
0755 rhel
/etc_sysconfig_network
-scripts_ifup
-ovs \
220 $RPM_BUILD_ROOT
/%{_sysconfdir}/sysconfig
/network
-scripts
/ifup
-ovs
222 install -d
-m
0755 $RPM_BUILD_ROOT
%{python_sitelib}
223 mv $RPM_BUILD_ROOT
/%{_datadir}/openvswitch
/python
/* \
224 $RPM_BUILD_ROOT
%{python_sitelib}
225 rmdir $RPM_BUILD_ROOT
/%{_datadir}/openvswitch
/python
/
227 install -d
-m
0755 $RPM_BUILD_ROOT
/%{_sharedstatedir}/openvswitch
229 touch $RPM_BUILD_ROOT
%{_sysconfdir}/openvswitch
/conf.db
230 touch $RPM_BUILD_ROOT
%{_sysconfdir}/openvswitch
/system
-id.conf
232 install -p
-m
644 -D selinux
/openvswitch
-custom.pp \
233 $RPM_BUILD_ROOT
%{_datadir}/selinux/packages/%{name}/openvswitch
-custom.pp
235 # remove unpackaged files
236 rm -f $RPM_BUILD_ROOT
%{_bindir}/ovs
-parse
-backtrace \
237 $RPM_BUILD_ROOT
%{_sbindir}/ovs
-vlan
-bug
-workaround \
238 $RPM_BUILD_ROOT
%{_mandir}/man8
/ovs
-vlan
-bug
-workaround
.8
242 if make check TESTSUITEFLAGS
='
%{_smp_mflags}' RECHECK
=yes
; then :;
244 cat tests
/testsuite.log
248 %if %{with check_datapath_kernel}
249 if make check
-kernel RECHECK
=yes
; then :;
251 cat tests
/system
-kmod
-testsuite.log
257 rm -rf $RPM_BUILD_ROOT
260 %if 0%{?systemd_preun:1}
261 %systemd_preun %{name}.service
263 if [ $
1 -eq
0 ] ; then
264 # Package removal, not upgrade
265 /bin
/systemctl
--no
-reload disable
%{name}.service
>/dev
/null
2>&1 ||
:
266 /bin
/systemctl stop
%{name}.service
>/dev
/null
2>&1 ||
:
271 %if 0%{?systemd_preun:1}
272 %systemd_preun ovn
-northd.service
274 if [ $
1 -eq
0 ] ; then
275 # Package removal, not upgrade
276 /bin
/systemctl
--no
-reload disable ovn
-northd.service
>/dev
/null
2>&1 ||
:
277 /bin
/systemctl stop ovn
-northd.service
>/dev
/null
2>&1 ||
:
282 %if 0%{?systemd_preun:1}
283 %systemd_preun ovn
-controller.service
285 if [ $
1 -eq
0 ] ; then
286 # Package removal, not upgrade
287 /bin
/systemctl
--no
-reload disable ovn
-controller.service
>/dev
/null
2>&1 ||
:
288 /bin
/systemctl stop ovn
-controller.service
>/dev
/null
2>&1 ||
:
293 %if 0%{?systemd_preun:1}
294 %systemd_preun ovn
-controller
-vtep.service
296 if [ $
1 -eq
0 ] ; then
297 # Package removal, not upgrade
298 /bin
/systemctl
--no
-reload disable ovn
-controller
-vtep.service
>/dev
/null
2>&1 ||
:
299 /bin
/systemctl stop ovn
-controller
-vtep.service
>/dev
/null
2>&1 ||
:
304 %if 0%{?systemd_post:1}
305 %systemd_post %{name}.service
307 # Package install, not upgrade
308 if [ $
1 -eq
1 ]; then
309 /bin
/systemctl daemon
-reload
>dev
/null ||
:
314 mkdir -p
/usr
/lib
/ocf
/resource.d
/ovn
315 ln
-sf
%{_datadir}/openvswitch
/scripts
/ovndb
-servers.ocf
/usr
/lib
/ocf
/resource.d
/ovn
/ovndb
-servers
318 %if 0%{?systemd_post:1}
319 %systemd_post ovn
-northd.service
321 # Package install, not upgrade
322 if [ $
1 -eq
1 ]; then
323 /bin
/systemctl daemon
-reload
>dev
/null ||
:
328 %if 0%{?systemd_post:1}
329 %systemd_post ovn
-controller.service
331 # Package install, not upgrade
332 if [ $
1 -eq
1 ]; then
333 /bin
/systemctl daemon
-reload
>dev
/null ||
:
338 %if 0%{?systemd_post:1}
339 %systemd_post ovn
-controller
-vtep.service
341 # Package install, not upgrade
342 if [ $
1 -eq
1 ]; then
343 /bin
/systemctl daemon
-reload
>dev
/null ||
:
348 /usr
/sbin
/semodule
-i
%{_datadir}/selinux/packages/%{name}/openvswitch
-custom.pp
&> /dev
/null ||
:
351 %if 0%{?systemd_postun:1}
352 %systemd_postun %{name}.service
354 /bin
/systemctl daemon
-reload
>/dev
/null
2>&1 ||
:
358 rm -rf
/usr
/lib
/ocf
/resource.d
/ovn
361 %if 0%{?systemd_postun_with_restart:1}
362 %systemd_postun_with_restart ovn
-northd.service
364 /bin
/systemctl daemon
-reload
>/dev
/null
2>&1 ||
:
365 if [ "$
1"
-ge "
1"
] ; then
366 # Package upgrade, not uninstall
367 /bin
/systemctl try
-restart ovn
-northd.service
>/dev
/null
2>&1 ||
:
372 %if 0%{?systemd_postun_with_restart:1}
373 %systemd_postun_with_restart ovn
-controller.service
375 /bin
/systemctl daemon
-reload
>/dev
/null
2>&1 ||
:
376 if [ "$
1"
-ge "
1"
] ; then
377 # Package upgrade, not uninstall
378 /bin
/systemctl try
-restart ovn
-controller.service
>/dev
/null
2>&1 ||
:
383 %if 0%{?systemd_postun_with_restart:1}
384 %systemd_postun_with_restart ovn
-controller
-vtep.service
386 /bin
/systemctl daemon
-reload
>/dev
/null
2>&1 ||
:
387 if [ "$
1"
-ge "
1"
] ; then
388 # Package upgrade, not uninstall
389 /bin
/systemctl try
-restart ovn
-controller
-vtep.service
>/dev
/null
2>&1 ||
:
393 %postun selinux
-policy
394 if [ $
1 -eq
0 ] ; then
395 /usr
/sbin
/semodule
-r openvswitch
-custom
&> /dev
/null ||
:
398 %files selinux
-policy
399 %defattr(-,root
,root
)
400 %{_datadir}/selinux/packages/%{name}/openvswitch
-custom.pp
402 %files -n python
-openvswitch
403 %{python_sitelib}/ovs
408 %{_bindir}/ovs
-vlan
-test
409 %{_bindir}/ovs
-l3ping
411 %{_bindir}/ovs
-tcpdump
412 %{_bindir}/ovs
-tcpundump
413 %{_mandir}/man8
/ovs
-test.8*
414 %{_mandir}/man8
/ovs
-vlan
-test.8*
415 %{_mandir}/man8
/ovs
-l3ping
.8*
416 %{_mandir}/man1
/ovs
-pcap
.1*
417 %{_mandir}/man8
/ovs
-tcpdump
.8*
418 %{_mandir}/man1
/ovs
-tcpundump
.1*
419 %{python_sitelib}/ovstest
424 %{_libdir}/pkgconfig
/*.pc
425 %{_includedir}/openvswitch
/*
426 %{_includedir}/openflow
/*
430 %defattr(-,root
,root
)
431 %{_sysconfdir}/bash_completion.d
/ovs
-appctl
-bashcomp.bash
432 %{_sysconfdir}/bash_completion.d
/ovs
-vsctl
-bashcomp.bash
433 %dir %{_sysconfdir}/openvswitch
434 %config %ghost %{_sysconfdir}/openvswitch
/conf.db
435 %config %ghost %{_sysconfdir}/openvswitch
/system
-id.conf
436 %config(noreplace
) %{_sysconfdir}/sysconfig
/openvswitch
437 %config(noreplace
) %{_sysconfdir}/logrotate.d
/openvswitch
438 %{_unitdir}/openvswitch.service
439 %{_unitdir}/ovsdb
-server.service
440 %{_unitdir}/ovs
-vswitchd.service
441 %{_datadir}/openvswitch
/scripts
/openvswitch.init
442 %{_sysconfdir}/sysconfig
/network
-scripts
/ifup
-ovs
443 %{_sysconfdir}/sysconfig
/network
-scripts
/ifdown
-ovs
444 %{_datadir}/openvswitch
/bugtool
-plugins
/
445 %{_datadir}/openvswitch
/scripts
/ovs
-bugtool
-*
446 %{_datadir}/openvswitch
/scripts
/ovs
-check
-dead
-ifs
447 %{_datadir}/openvswitch
/scripts
/ovs
-lib
448 %{_datadir}/openvswitch
/scripts
/ovs
-save
449 %{_datadir}/openvswitch
/scripts
/ovs
-vtep
450 %{_datadir}/openvswitch
/scripts
/ovs
-ctl
451 %config %{_datadir}/openvswitch
/vswitch.ovsschema
452 %config %{_datadir}/openvswitch
/vtep.ovsschema
453 %{_bindir}/ovs
-appctl
454 %{_bindir}/ovs
-docker
456 %{_bindir}/ovs
-dpctl
-top
459 %{_bindir}/ovsdb
-client
460 %{_bindir}/ovsdb
-tool
461 %{_bindir}/ovs
-testcontroller
464 %{_sbindir}/ovs
-bugtool
465 %{_sbindir}/ovs
-vswitchd
466 %{_sbindir}/ovsdb
-server
467 %{_mandir}/man1
/ovsdb
-client
.1*
468 %{_mandir}/man1
/ovsdb
-server
.1*
469 %{_mandir}/man1
/ovsdb
-tool
.1*
470 %{_mandir}/man5
/ovs
-vswitchd.conf.db
.5*
471 %{_mandir}/man5
/vtep
.5*
472 %{_mandir}/man8
/vtep
-ctl
.8*
473 %{_mandir}/man8
/ovs
-appctl
.8*
474 %{_mandir}/man8
/ovs
-bugtool
.8*
475 %{_mandir}/man8
/ovs
-ctl
.8*
476 %{_mandir}/man8
/ovs
-dpctl
.8*
477 %{_mandir}/man8
/ovs
-dpctl
-top
.8*
478 %{_mandir}/man8
/ovs
-ofctl
.8*
479 %{_mandir}/man8
/ovs
-pki
.8*
480 %{_mandir}/man8
/ovs
-vsctl
.8*
481 %{_mandir}/man8
/ovs
-vswitchd
.8*
482 %{_mandir}/man8
/ovs
-parse
-backtrace
.8*
483 %{_mandir}/man8
/ovs
-testcontroller
.8*
484 %doc COPYING NOTICE README.rst NEWS rhel
/README.RHEL.rst
487 %ghost %attr(755,root
,root
) %{_rundir}/openvswitch
490 %{_bindir}/ovn
-docker
-overlay
-driver
491 %{_bindir}/ovn
-docker
-underlay
-driver
497 %{_datadir}/openvswitch
/scripts
/ovn
-ctl
498 %{_datadir}/openvswitch
/scripts
/ovndb
-servers.ocf
499 %{_datadir}/openvswitch
/scripts
/ovn
-bugtool
-nbctl
-show
500 %{_datadir}/openvswitch
/scripts
/ovn
-bugtool
-sbctl
-lflow
-list
501 %{_datadir}/openvswitch
/scripts
/ovn
-bugtool
-sbctl
-show
502 %{_mandir}/man8
/ovn
-ctl
.8*
503 %{_mandir}/man8
/ovn
-nbctl
.8*
504 %{_mandir}/man8
/ovn
-trace
.8*
505 %{_mandir}/man7
/ovn
-architecture
.7*
506 %{_mandir}/man8
/ovn
-sbctl
.8*
507 %{_mandir}/man5
/ovn
-nb
.5*
508 %{_mandir}/man5
/ovn
-sb
.5*
511 %{_bindir}/ovn
-northd
512 %{_mandir}/man8
/ovn
-northd
.8*
513 %config %{_datadir}/openvswitch
/ovn
-nb.ovsschema
514 %config %{_datadir}/openvswitch
/ovn
-sb.ovsschema
515 %{_unitdir}/ovn
-northd.service
518 %{_bindir}/ovn
-controller
519 %{_mandir}/man8
/ovn
-controller
.8*
520 %{_unitdir}/ovn
-controller.service
523 %{_bindir}/ovn
-controller
-vtep
524 %{_mandir}/man8
/ovn
-controller
-vtep
.8*
525 %{_unitdir}/ovn
-controller
-vtep.service
528 * Wed Jan
12 2011 Ralf Spenneberg
<ralf@os
-s.net
>