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 #%define kernel 2.6.40.4-5.fc15.x86_64
16 # If libcap-ng isn't available and there is no need for running OVS
17 # as regular user, specify the '--without libcapng'
18 %bcond_without libcapng
19 # To enable DPDK support, specify '--with dpdk' when building
22 # Enable PIE, bz#955181
23 %global _hardened_build 1
25 # some distros (e.g: RHEL-7) don't define _rundir macro yet
26 # Fedora 15 onwards uses /run as _rundir
33 Group: System Environment/Daemons
34 URL: http://www.openvswitch.org/
37 # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the
38 # lib/sflow*.[ch] files are SISSL
39 # datapath/ is GPLv2 (although not built into any of the binary packages)
40 License: ASL 2.0 and LGPLv2+ and SISSL
42 Source: http://openvswitch.org/releases/%{name}-%{version}.tar.gz
44 BuildRequires: autoconf automake libtool
45 BuildRequires: systemd-units openssl openssl-devel
46 BuildRequires: python python-twisted-core python-zope-interface PyQt4 python-six
47 BuildRequires: desktop-file-utils
48 BuildRequires: groff graphviz
49 BuildRequires: checkpolicy, selinux-policy-devel
50 # make check dependencies
51 BuildRequires: procps-ng
53 BuildRequires: libcap-ng libcap-ng-devel
56 BuildRequires: dpdk-devel >= 2.2.0
57 BuildRequires: numactl-devel
58 Requires: numactl-libs
59 Provides: %{name}-dpdk = %{version}-%{release}
62 Requires: openssl iproute module-init-tools
63 #Upstream kernel commit 4f647e0a3c37b8d5086214128614a136064110c3
64 #Requires: kernel >= 3.15.0-0
66 Requires(post): systemd-units
67 Requires(preun): systemd-units
68 Requires(postun): systemd-units
69 Obsoletes: openvswitch-controller <= 0:2.1.0-1
74 Open vSwitch provides standard network bridging functions and
75 support for the OpenFlow protocol for remote per-flow control of
78 %package selinux-policy
79 Summary: Open vSwitch SELinux policy
82 Requires: selinux-policy-targeted
84 %description selinux-policy
85 Tailored Open vSwitch SELinux policy
87 %package -n python-openvswitch
88 Summary: Open vSwitch python bindings
94 %description -n python-openvswitch
95 Python bindings for the Open vSwitch database
98 Summary: Open vSwitch testing utilities
101 Requires: python-openvswitch = %{version}-%{release}
102 Requires: python python-twisted-core python-twisted-web
105 Utilities that are useful to diagnose performance and connectivity
106 issues in Open vSwitch setup.
109 Summary: Open vSwitch OpenFlow development package (library, headers)
111 Provides: openvswitch-static = %{version}-%{release}
114 This provides static library, libopenswitch.a and the openvswitch header
115 files needed to build an external application.
118 Summary: Open vSwitch - Open Virtual Network support
120 Requires: openvswitch openvswitch-ovn-common
122 %description ovn-central
123 OVN, the Open Virtual Network, is a system to support virtual network
124 abstraction. OVN complements the existing capabilities of OVS to add
125 native support for virtual network abstractions, such as virtual L2 and L3
126 overlays and security groups.
129 Summary: Open vSwitch - Open Virtual Network support
131 Requires: openvswitch openvswitch-ovn-common
133 %description ovn-host
134 OVN, the Open Virtual Network, is a system to support virtual network
135 abstraction. OVN complements the existing capabilities of OVS to add
136 native support for virtual network abstractions, such as virtual L2 and L3
137 overlays and security groups.
140 Summary: Open vSwitch - Open Virtual Network support
142 Requires: openvswitch openvswitch-ovn-common
144 %description ovn-vtep
148 Summary: Open vSwitch - Open Virtual Network support
150 Requires: openvswitch
152 %description ovn-common
153 Utilities that are use to diagnose and manage the OVN components.
156 Summary: Open vSwitch - Open Virtual Network support
158 Requires: openvswitch openvswitch-ovn-common python-openvswitch
160 %description ovn-docker
161 Docker network plugins for OVN.
174 --with-dpdk=$(dirname %{_datadir}/dpdk/*/.config) \
177 --with-pkidir=%{_sharedstatedir}/openvswitch/pki
181 make -f %{_datadir}/selinux/devel/Makefile
184 rm -rf $RPM_BUILD_ROOT
185 make install DESTDIR=$RPM_BUILD_ROOT
187 install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch
189 install -p -D -m 0644 \
190 rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
191 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/openvswitch
192 for service in openvswitch openvswitch-nonetwork \
193 ovn-controller ovn-controller-vtep ovn-northd; do
194 install -p -D -m 0644 \
195 rhel/usr_lib_systemd_system_${service}.service \
196 $RPM_BUILD_ROOT%{_unitdir}/${service}.service
198 install -m 0755 rhel/etc_init.d_openvswitch \
199 $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init
201 install -p -D -m 0644 rhel/etc_logrotate.d_openvswitch \
202 $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/openvswitch
204 install -m 0644 vswitchd/vswitch.ovsschema \
205 $RPM_BUILD_ROOT/%{_datadir}/openvswitch/vswitch.ovsschema
207 install -d -m 0755 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/
208 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \
209 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
210 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \
211 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
213 install -d -m 0755 $RPM_BUILD_ROOT%{python_sitelib}
214 mv $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/* \
215 $RPM_BUILD_ROOT%{python_sitelib}
216 rmdir $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/
218 install -d -m 0755 $RPM_BUILD_ROOT/%{_sharedstatedir}/openvswitch
220 touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/conf.db
221 touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/system-id.conf
223 install -p -m 644 -D selinux/openvswitch-custom.pp \
224 $RPM_BUILD_ROOT%{_datadir}/selinux/packages/%{name}/openvswitch-custom.pp
226 # remove unpackaged files
227 rm -f $RPM_BUILD_ROOT%{_bindir}/ovs-parse-backtrace \
228 $RPM_BUILD_ROOT%{_bindir}/ovs-pcap \
229 $RPM_BUILD_ROOT%{_bindir}/ovs-tcpundump \
230 $RPM_BUILD_ROOT%{_sbindir}/ovs-vlan-bug-workaround \
231 $RPM_BUILD_ROOT%{_mandir}/man1/ovs-pcap.1 \
232 $RPM_BUILD_ROOT%{_mandir}/man1/ovs-tcpundump.1 \
233 $RPM_BUILD_ROOT%{_mandir}/man8/ovs-vlan-bug-workaround.8
237 if make check TESTSUITEFLAGS='%{_smp_mflags}' RECHECK=yes; then :;
239 cat tests/testsuite.log
245 rm -rf $RPM_BUILD_ROOT
248 %if 0%{?systemd_preun:1}
249 %systemd_preun %{name}.service
251 if [ $1 -eq 0 ] ; then
252 # Package removal, not upgrade
253 /bin/systemctl --no-reload disable %{name}.service >/dev/null 2>&1 || :
254 /bin/systemctl stop %{name}.service >/dev/null 2>&1 || :
259 %if 0%{?systemd_preun:1}
260 %systemd_preun ovn-northd.service
262 if [ $1 -eq 0 ] ; then
263 # Package removal, not upgrade
264 /bin/systemctl --no-reload disable ovn-northd.service >/dev/null 2>&1 || :
265 /bin/systemctl stop ovn-northd.service >/dev/null 2>&1 || :
270 %if 0%{?systemd_preun:1}
271 %systemd_preun ovn-controller.service
273 if [ $1 -eq 0 ] ; then
274 # Package removal, not upgrade
275 /bin/systemctl --no-reload disable ovn-controller.service >/dev/null 2>&1 || :
276 /bin/systemctl stop ovn-controller.service >/dev/null 2>&1 || :
281 %if 0%{?systemd_preun:1}
282 %systemd_preun ovn-controller-vtep.service
284 if [ $1 -eq 0 ] ; then
285 # Package removal, not upgrade
286 /bin/systemctl --no-reload disable ovn-controller-vtep.service >/dev/null 2>&1 || :
287 /bin/systemctl stop ovn-controller-vtep.service >/dev/null 2>&1 || :
292 %if 0%{?systemd_post:1}
293 %systemd_post %{name}.service
295 # Package install, not upgrade
296 if [ $1 -eq 1 ]; then
297 /bin/systemctl daemon-reload >dev/null || :
302 %if 0%{?systemd_post:1}
303 %systemd_post ovn-northd.service
305 # Package install, not upgrade
306 if [ $1 -eq 1 ]; then
307 /bin/systemctl daemon-reload >dev/null || :
312 %if 0%{?systemd_post:1}
313 %systemd_post ovn-controller.service
315 # Package install, not upgrade
316 if [ $1 -eq 1 ]; then
317 /bin/systemctl daemon-reload >dev/null || :
322 %if 0%{?systemd_post:1}
323 %systemd_post ovn-controller-vtep.service
325 # Package install, not upgrade
326 if [ $1 -eq 1 ]; then
327 /bin/systemctl daemon-reload >dev/null || :
332 /usr/sbin/semodule -i %{_datadir}/selinux/packages/%{name}/openvswitch-custom.pp &> /dev/null || :
335 %if 0%{?systemd_postun_with_restart:1}
336 %systemd_postun_with_restart %{name}.service
338 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
339 if [ "$1" -ge "1" ] ; then
340 # Package upgrade, not uninstall
341 /bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
346 %if 0%{?systemd_postun_with_restart:1}
347 %systemd_postun_with_restart ovn-northd.service
349 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
350 if [ "$1" -ge "1" ] ; then
351 # Package upgrade, not uninstall
352 /bin/systemctl try-restart ovn-northd.service >/dev/null 2>&1 || :
357 %if 0%{?systemd_postun_with_restart:1}
358 %systemd_postun_with_restart ovn-controller.service
360 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
361 if [ "$1" -ge "1" ] ; then
362 # Package upgrade, not uninstall
363 /bin/systemctl try-restart ovn-controller.service >/dev/null 2>&1 || :
368 %if 0%{?systemd_postun_with_restart:1}
369 %systemd_postun_with_restart ovn-controller-vtep.service
371 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
372 if [ "$1" -ge "1" ] ; then
373 # Package upgrade, not uninstall
374 /bin/systemctl try-restart ovn-controller-vtep.service >/dev/null 2>&1 || :
378 %postun selinux-policy
379 if [ $1 -eq 0 ] ; then
380 /usr/sbin/semodule -r openvswitch-custom &> /dev/null || :
383 %files selinux-policy
384 %defattr(-,root,root)
385 %{_datadir}/selinux/packages/%{name}/openvswitch-custom.pp
387 %files -n python-openvswitch
388 %{python_sitelib}/ovs
393 %{_bindir}/ovs-vlan-test
394 %{_bindir}/ovs-l3ping
395 %{_mandir}/man8/ovs-test.8*
396 %{_mandir}/man8/ovs-vlan-test.8*
397 %{_mandir}/man8/ovs-l3ping.8*
398 %{python_sitelib}/ovstest
403 %{_libdir}/pkgconfig/*.pc
404 %{_includedir}/openvswitch/*
405 %{_includedir}/openflow/*
408 %defattr(-,root,root)
409 %{_sysconfdir}/bash_completion.d/ovs-appctl-bashcomp.bash
410 %{_sysconfdir}/bash_completion.d/ovs-vsctl-bashcomp.bash
411 %dir %{_sysconfdir}/openvswitch
412 %config %ghost %{_sysconfdir}/openvswitch/conf.db
413 %config %ghost %{_sysconfdir}/openvswitch/system-id.conf
414 %config(noreplace) %{_sysconfdir}/sysconfig/openvswitch
415 %config(noreplace) %{_sysconfdir}/logrotate.d/openvswitch
416 %{_unitdir}/openvswitch.service
417 %{_unitdir}/openvswitch-nonetwork.service
418 %{_datadir}/openvswitch/scripts/openvswitch.init
419 %{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
420 %{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
421 %{_datadir}/openvswitch/bugtool-plugins/
422 %{_datadir}/openvswitch/scripts/ovs-bugtool-*
423 %{_datadir}/openvswitch/scripts/ovs-check-dead-ifs
424 %{_datadir}/openvswitch/scripts/ovs-lib
425 %{_datadir}/openvswitch/scripts/ovs-save
426 %{_datadir}/openvswitch/scripts/ovs-vtep
427 %{_datadir}/openvswitch/scripts/ovs-ctl
428 %config %{_datadir}/openvswitch/vswitch.ovsschema
429 %config %{_datadir}/openvswitch/vtep.ovsschema
430 %{_bindir}/ovs-appctl
431 %{_bindir}/ovs-docker
433 %{_bindir}/ovs-dpctl-top
436 %{_bindir}/ovsdb-client
437 %{_bindir}/ovsdb-tool
438 %{_bindir}/ovs-testcontroller
441 %{_sbindir}/ovs-bugtool
442 %{_sbindir}/ovs-vswitchd
443 %{_sbindir}/ovsdb-server
444 %{_mandir}/man1/ovsdb-client.1*
445 %{_mandir}/man1/ovsdb-server.1*
446 %{_mandir}/man1/ovsdb-tool.1*
447 %{_mandir}/man5/ovs-vswitchd.conf.db.5*
448 %{_mandir}/man5/vtep.5*
449 %{_mandir}/man8/vtep-ctl.8*
450 %{_mandir}/man8/ovs-appctl.8*
451 %{_mandir}/man8/ovs-bugtool.8*
452 %{_mandir}/man8/ovs-ctl.8*
453 %{_mandir}/man8/ovs-dpctl.8*
454 %{_mandir}/man8/ovs-dpctl-top.8*
455 %{_mandir}/man8/ovs-ofctl.8*
456 %{_mandir}/man8/ovs-pki.8*
457 %{_mandir}/man8/ovs-vsctl.8*
458 %{_mandir}/man8/ovs-vswitchd.8*
459 %{_mandir}/man8/ovs-parse-backtrace.8*
460 %{_mandir}/man8/ovs-testcontroller.8*
461 %doc COPYING DESIGN.md INSTALL.SSL.md NOTICE README.md WHY-OVS.md
462 %doc FAQ.md NEWS INSTALL.DPDK.md rhel/README.RHEL
465 %ghost %attr(755,root,root) %{_rundir}/openvswitch
468 %{_bindir}/ovn-docker-overlay-driver
469 %{_bindir}/ovn-docker-underlay-driver
474 %{_datadir}/openvswitch/scripts/ovn-ctl
475 %{_datadir}/openvswitch/scripts/ovn-bugtool-nbctl-show
476 %{_datadir}/openvswitch/scripts/ovn-bugtool-sbctl-lflow-list
477 %{_datadir}/openvswitch/scripts/ovn-bugtool-sbctl-show
478 %{_mandir}/man8/ovn-ctl.8*
479 %{_mandir}/man8/ovn-nbctl.8*
480 %{_mandir}/man7/ovn-architecture.7*
481 %{_mandir}/man8/ovn-sbctl.8*
482 %{_mandir}/man5/ovn-nb.5*
483 %{_mandir}/man5/ovn-sb.5*
486 %{_bindir}/ovn-northd
487 %{_mandir}/man8/ovn-northd.8*
488 %config %{_datadir}/openvswitch/ovn-nb.ovsschema
489 %config %{_datadir}/openvswitch/ovn-sb.ovsschema
490 %{_unitdir}/ovn-northd.service
493 %{_bindir}/ovn-controller
494 %{_mandir}/man8/ovn-controller.8*
495 %{_unitdir}/ovn-controller.service
498 %{_bindir}/ovn-controller-vtep
499 %{_mandir}/man8/ovn-controller-vtep.8*
500 %{_unitdir}/ovn-controller-vtep.service
503 * Wed Jan 12 2011 Ralf Spenneberg <ralf@os-s.net>