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 Provides: %{name}-dpdk = %{version}-%{release}
60 Requires: openssl iproute module-init-tools
61 #Upstream kernel commit 4f647e0a3c37b8d5086214128614a136064110c3
62 #Requires: kernel >= 3.15.0-0
64 Requires(post): systemd-units
65 Requires(preun): systemd-units
66 Requires(postun): systemd-units
67 Obsoletes: openvswitch-controller <= 0:2.1.0-1
72 Open vSwitch provides standard network bridging functions and
73 support for the OpenFlow protocol for remote per-flow control of
76 %package selinux-policy
77 Summary: Open vSwitch SELinux policy
80 Requires: selinux-policy-targeted
82 %description selinux-policy
83 Tailored Open vSwitch SELinux policy
85 %package -n python-openvswitch
86 Summary: Open vSwitch python bindings
92 %description -n python-openvswitch
93 Python bindings for the Open vSwitch database
96 Summary: Open vSwitch testing utilities
99 Requires: python-openvswitch = %{version}-%{release}
100 Requires: python python-twisted-core python-twisted-web
103 Utilities that are useful to diagnose performance and connectivity
104 issues in Open vSwitch setup.
107 Summary: Open vSwitch OpenFlow development package (library, headers)
109 Provides: openvswitch-static = %{version}-%{release}
112 This provides static library, libopenswitch.a and the openvswitch header
113 files needed to build an external application.
116 Summary: Open vSwitch - Open Virtual Network support
118 Requires: openvswitch openvswitch-ovn-common
120 %description ovn-central
121 OVN, the Open Virtual Network, is a system to support virtual network
122 abstraction. OVN complements the existing capabilities of OVS to add
123 native support for virtual network abstractions, such as virtual L2 and L3
124 overlays and security groups.
127 Summary: Open vSwitch - Open Virtual Network support
129 Requires: openvswitch openvswitch-ovn-common
131 %description ovn-host
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-vtep
146 Summary: Open vSwitch - Open Virtual Network support
148 Requires: openvswitch
150 %description ovn-common
151 Utilities that are use to diagnose and manage the OVN components.
154 Summary: Open vSwitch - Open Virtual Network support
156 Requires: openvswitch openvswitch-ovn-common python-openvswitch
158 %description ovn-docker
159 Docker network plugins for OVN.
172 --with-dpdk=$(dirname %{_datadir}/dpdk/*/.config) \
175 --with-pkidir=%{_sharedstatedir}/openvswitch/pki
179 make -f %{_datadir}/selinux/devel/Makefile
182 rm -rf $RPM_BUILD_ROOT
183 make install DESTDIR=$RPM_BUILD_ROOT
185 install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch
187 install -p -D -m 0644 \
188 rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
189 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/openvswitch
190 for service in openvswitch openvswitch-nonetwork \
191 ovn-controller ovn-controller-vtep ovn-northd; do
192 install -p -D -m 0644 \
193 rhel/usr_lib_systemd_system_${service}.service \
194 $RPM_BUILD_ROOT%{_unitdir}/${service}.service
196 install -m 0755 rhel/etc_init.d_openvswitch \
197 $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init
199 install -p -D -m 0644 rhel/etc_logrotate.d_openvswitch \
200 $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/openvswitch
202 install -m 0644 vswitchd/vswitch.ovsschema \
203 $RPM_BUILD_ROOT/%{_datadir}/openvswitch/vswitch.ovsschema
205 install -d -m 0755 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/
206 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \
207 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
208 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \
209 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
211 install -d -m 0755 $RPM_BUILD_ROOT%{python_sitelib}
212 mv $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/* \
213 $RPM_BUILD_ROOT%{python_sitelib}
214 rmdir $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/
216 install -d -m 0755 $RPM_BUILD_ROOT/%{_sharedstatedir}/openvswitch
218 touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/conf.db
219 touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/system-id.conf
221 install -p -m 644 -D selinux/openvswitch-custom.pp \
222 $RPM_BUILD_ROOT%{_datadir}/selinux/packages/%{name}/openvswitch-custom.pp
224 # remove unpackaged files
225 rm -f $RPM_BUILD_ROOT%{_bindir}/ovs-parse-backtrace \
226 $RPM_BUILD_ROOT%{_bindir}/ovs-pcap \
227 $RPM_BUILD_ROOT%{_bindir}/ovs-tcpundump \
228 $RPM_BUILD_ROOT%{_sbindir}/ovs-vlan-bug-workaround \
229 $RPM_BUILD_ROOT%{_mandir}/man1/ovs-pcap.1 \
230 $RPM_BUILD_ROOT%{_mandir}/man1/ovs-tcpundump.1 \
231 $RPM_BUILD_ROOT%{_mandir}/man8/ovs-vlan-bug-workaround.8
235 if make check TESTSUITEFLAGS='%{_smp_mflags}' RECHECK=yes; then :;
237 cat tests/testsuite.log
243 rm -rf $RPM_BUILD_ROOT
246 %if 0%{?systemd_preun:1}
247 %systemd_preun %{name}.service
249 if [ $1 -eq 0 ] ; then
250 # Package removal, not upgrade
251 /bin/systemctl --no-reload disable %{name}.service >/dev/null 2>&1 || :
252 /bin/systemctl stop %{name}.service >/dev/null 2>&1 || :
257 %if 0%{?systemd_preun:1}
258 %systemd_preun ovn-northd.service
260 if [ $1 -eq 0 ] ; then
261 # Package removal, not upgrade
262 /bin/systemctl --no-reload disable ovn-northd.service >/dev/null 2>&1 || :
263 /bin/systemctl stop ovn-northd.service >/dev/null 2>&1 || :
268 %if 0%{?systemd_preun:1}
269 %systemd_preun ovn-controller.service
271 if [ $1 -eq 0 ] ; then
272 # Package removal, not upgrade
273 /bin/systemctl --no-reload disable ovn-controller.service >/dev/null 2>&1 || :
274 /bin/systemctl stop ovn-controller.service >/dev/null 2>&1 || :
279 %if 0%{?systemd_preun:1}
280 %systemd_preun ovn-controller-vtep.service
282 if [ $1 -eq 0 ] ; then
283 # Package removal, not upgrade
284 /bin/systemctl --no-reload disable ovn-controller-vtep.service >/dev/null 2>&1 || :
285 /bin/systemctl stop ovn-controller-vtep.service >/dev/null 2>&1 || :
290 %if 0%{?systemd_post:1}
291 %systemd_post %{name}.service
293 # Package install, not upgrade
294 if [ $1 -eq 1 ]; then
295 /bin/systemctl daemon-reload >dev/null || :
300 %if 0%{?systemd_post:1}
301 %systemd_post ovn-northd.service
303 # Package install, not upgrade
304 if [ $1 -eq 1 ]; then
305 /bin/systemctl daemon-reload >dev/null || :
310 %if 0%{?systemd_post:1}
311 %systemd_post ovn-controller.service
313 # Package install, not upgrade
314 if [ $1 -eq 1 ]; then
315 /bin/systemctl daemon-reload >dev/null || :
320 %if 0%{?systemd_post:1}
321 %systemd_post ovn-controller-vtep.service
323 # Package install, not upgrade
324 if [ $1 -eq 1 ]; then
325 /bin/systemctl daemon-reload >dev/null || :
330 /usr/sbin/semodule -i %{_datadir}/selinux/packages/%{name}/openvswitch-custom.pp &> /dev/null || :
333 %if 0%{?systemd_postun_with_restart:1}
334 %systemd_postun_with_restart %{name}.service
336 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
337 if [ "$1" -ge "1" ] ; then
338 # Package upgrade, not uninstall
339 /bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
344 %if 0%{?systemd_postun_with_restart:1}
345 %systemd_postun_with_restart ovn-northd.service
347 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
348 if [ "$1" -ge "1" ] ; then
349 # Package upgrade, not uninstall
350 /bin/systemctl try-restart ovn-northd.service >/dev/null 2>&1 || :
355 %if 0%{?systemd_postun_with_restart:1}
356 %systemd_postun_with_restart ovn-controller.service
358 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
359 if [ "$1" -ge "1" ] ; then
360 # Package upgrade, not uninstall
361 /bin/systemctl try-restart ovn-controller.service >/dev/null 2>&1 || :
366 %if 0%{?systemd_postun_with_restart:1}
367 %systemd_postun_with_restart ovn-controller-vtep.service
369 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
370 if [ "$1" -ge "1" ] ; then
371 # Package upgrade, not uninstall
372 /bin/systemctl try-restart ovn-controller-vtep.service >/dev/null 2>&1 || :
376 %postun selinux-policy
377 if [ $1 -eq 0 ] ; then
378 /usr/sbin/semodule -r openvswitch-custom &> /dev/null || :
381 %files selinux-policy
382 %defattr(-,root,root)
383 %{_datadir}/selinux/packages/%{name}/openvswitch-custom.pp
385 %files -n python-openvswitch
386 %{python_sitelib}/ovs
391 %{_bindir}/ovs-vlan-test
392 %{_bindir}/ovs-l3ping
393 %{_mandir}/man8/ovs-test.8*
394 %{_mandir}/man8/ovs-vlan-test.8*
395 %{_mandir}/man8/ovs-l3ping.8*
396 %{python_sitelib}/ovstest
401 %{_libdir}/pkgconfig/*.pc
402 %{_includedir}/openvswitch/*
403 %{_includedir}/openflow/*
406 %defattr(-,root,root)
407 %{_sysconfdir}/bash_completion.d/ovs-appctl-bashcomp.bash
408 %{_sysconfdir}/bash_completion.d/ovs-vsctl-bashcomp.bash
409 %dir %{_sysconfdir}/openvswitch
410 %config %ghost %{_sysconfdir}/openvswitch/conf.db
411 %config %ghost %{_sysconfdir}/openvswitch/system-id.conf
412 %config(noreplace) %{_sysconfdir}/sysconfig/openvswitch
413 %config(noreplace) %{_sysconfdir}/logrotate.d/openvswitch
414 %{_unitdir}/openvswitch.service
415 %{_unitdir}/openvswitch-nonetwork.service
416 %{_datadir}/openvswitch/scripts/openvswitch.init
417 %{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
418 %{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
419 %{_datadir}/openvswitch/bugtool-plugins/
420 %{_datadir}/openvswitch/scripts/ovs-bugtool-*
421 %{_datadir}/openvswitch/scripts/ovs-check-dead-ifs
422 %{_datadir}/openvswitch/scripts/ovs-lib
423 %{_datadir}/openvswitch/scripts/ovs-save
424 %{_datadir}/openvswitch/scripts/ovs-vtep
425 %{_datadir}/openvswitch/scripts/ovs-ctl
426 %config %{_datadir}/openvswitch/vswitch.ovsschema
427 %config %{_datadir}/openvswitch/vtep.ovsschema
428 %{_bindir}/ovs-appctl
429 %{_bindir}/ovs-docker
431 %{_bindir}/ovs-dpctl-top
434 %{_bindir}/ovsdb-client
435 %{_bindir}/ovsdb-tool
436 %{_bindir}/ovs-testcontroller
439 %{_sbindir}/ovs-bugtool
440 %{_sbindir}/ovs-vswitchd
441 %{_sbindir}/ovsdb-server
442 %{_mandir}/man1/ovsdb-client.1*
443 %{_mandir}/man1/ovsdb-server.1*
444 %{_mandir}/man1/ovsdb-tool.1*
445 %{_mandir}/man5/ovs-vswitchd.conf.db.5*
446 %{_mandir}/man5/vtep.5*
447 %{_mandir}/man8/vtep-ctl.8*
448 %{_mandir}/man8/ovs-appctl.8*
449 %{_mandir}/man8/ovs-bugtool.8*
450 %{_mandir}/man8/ovs-ctl.8*
451 %{_mandir}/man8/ovs-dpctl.8*
452 %{_mandir}/man8/ovs-dpctl-top.8*
453 %{_mandir}/man8/ovs-ofctl.8*
454 %{_mandir}/man8/ovs-pki.8*
455 %{_mandir}/man8/ovs-vsctl.8*
456 %{_mandir}/man8/ovs-vswitchd.8*
457 %{_mandir}/man8/ovs-parse-backtrace.8*
458 %{_mandir}/man8/ovs-testcontroller.8*
459 %doc COPYING DESIGN.md INSTALL.SSL.md NOTICE README.md WHY-OVS.md
460 %doc FAQ.md NEWS INSTALL.DPDK.md rhel/README.RHEL
463 %ghost %attr(755,root,root) %{_rundir}/openvswitch
466 %{_bindir}/ovn-docker-overlay-driver
467 %{_bindir}/ovn-docker-underlay-driver
472 %{_datadir}/openvswitch/scripts/ovn-ctl
473 %{_datadir}/openvswitch/scripts/ovn-bugtool-nbctl-show
474 %{_datadir}/openvswitch/scripts/ovn-bugtool-sbctl-lflow-list
475 %{_datadir}/openvswitch/scripts/ovn-bugtool-sbctl-show
476 %{_mandir}/man8/ovn-ctl.8*
477 %{_mandir}/man8/ovn-nbctl.8*
478 %{_mandir}/man7/ovn-architecture.7*
479 %{_mandir}/man8/ovn-sbctl.8*
480 %{_mandir}/man5/ovn-nb.5*
481 %{_mandir}/man5/ovn-sb.5*
484 %{_bindir}/ovn-northd
485 %{_mandir}/man8/ovn-northd.8*
486 %config %{_datadir}/openvswitch/ovn-nb.ovsschema
487 %config %{_datadir}/openvswitch/ovn-sb.ovsschema
488 %{_unitdir}/ovn-northd.service
491 %{_bindir}/ovn-controller
492 %{_mandir}/man8/ovn-controller.8*
493 %{_unitdir}/ovn-controller.service
496 %{_bindir}/ovn-controller-vtep
497 %{_mandir}/man8/ovn-controller-vtep.8*
498 %{_unitdir}/ovn-controller-vtep.service
501 * Wed Jan 12 2011 Ralf Spenneberg <ralf@os-s.net>