1 # Spec file for Open vSwitch.
3 # Copyright (C) 2009, 2010, 2013, 2014, 2015 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 # Enable PIE, bz#955181
17 %global _hardened_build 1
19 # some distros (e.g: RHEL-7) don't define _rundir macro yet
20 # Fedora 15 onwards uses /run as _rundir
27 Group: System Environment/Daemons
28 URL: http://www.openvswitch.org/
31 # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the
32 # lib/sflow*.[ch] files are SISSL
33 # datapath/ is GPLv2 (although not built into any of the binary packages)
34 License: ASL 2.0 and LGPLv2+ and SISSL
36 Source: http://openvswitch.org/releases/%{name}-%{version}.tar.gz
38 BuildRequires: autoconf automake libtool
39 BuildRequires: systemd-units openssl openssl-devel
40 BuildRequires: python python-twisted-core python-zope-interface PyQt4
41 BuildRequires: desktop-file-utils
42 BuildRequires: groff graphviz
43 # make check dependencies
44 BuildRequires: procps-ng
46 Requires: openssl iproute module-init-tools
47 #Upstream kernel commit 4f647e0a3c37b8d5086214128614a136064110c3
48 #Requires: kernel >= 3.15.0-0
50 Requires(post): systemd-units
51 Requires(preun): systemd-units
52 Requires(postun): systemd-units
53 Obsoletes: openvswitch-controller <= 0:2.1.0-1
58 Open vSwitch provides standard network bridging functions and
59 support for the OpenFlow protocol for remote per-flow control of
62 %package -n python-openvswitch
63 Summary: Open vSwitch python bindings
68 %description -n python-openvswitch
69 Python bindings for the Open vSwitch database
72 Summary: Open vSwitch testing utilities
75 Requires: python-openvswitch = %{version}-%{release}
76 Requires: python python-twisted-core python-twisted-web
79 Utilities that are useful to diagnose performance and connectivity
80 issues in Open vSwitch setup.
83 Summary: Open vSwitch OpenFlow development package (library, headers)
85 Provides: openvswitch-static = %{version}-%{release}
88 This provides static library, libopenswitch.a and the openvswitch header
89 files needed to build an external application.
92 Summary: Open vSwitch - Open Virtual Network support
97 OVN, the Open Virtual Network, is a system to support virtual network
98 abstraction. OVN complements the existing capabilities of OVS to add
99 native support for virtual network abstractions, such as virtual L2 and L3
100 overlays and security groups.
107 %configure --enable-ssl --with-pkidir=%{_sharedstatedir}/openvswitch/pki
111 rm -rf $RPM_BUILD_ROOT
112 make install DESTDIR=$RPM_BUILD_ROOT
114 install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch
116 install -p -D -m 0644 \
117 rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
118 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/openvswitch
119 for service in openvswitch openvswitch-nonetwork \
120 ovn-controller ovn-controller-vtep ovn-northd; do
121 install -p -D -m 0644 \
122 rhel/usr_lib_systemd_system_${service}.service \
123 $RPM_BUILD_ROOT%{_unitdir}/${service}.service
125 install -m 0755 rhel/etc_init.d_openvswitch \
126 $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init
128 install -p -D -m 0644 rhel/etc_logrotate.d_openvswitch \
129 $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/openvswitch
131 install -m 0644 vswitchd/vswitch.ovsschema \
132 $RPM_BUILD_ROOT/%{_datadir}/openvswitch/vswitch.ovsschema
134 install -d -m 0755 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/
135 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \
136 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
137 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \
138 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
140 install -d -m 0755 $RPM_BUILD_ROOT%{python_sitelib}
141 mv $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/* \
142 $RPM_BUILD_ROOT%{python_sitelib}
143 rmdir $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/
145 install -d -m 0755 $RPM_BUILD_ROOT/%{_sharedstatedir}/openvswitch
147 touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/conf.db
148 touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/system-id.conf
152 if make check TESTSUITEFLAGS='%{_smp_mflags}' ||
153 make check TESTSUITEFLAGS='--recheck'; then :;
155 cat tests/testsuite.log
161 rm -rf $RPM_BUILD_ROOT
164 %if 0%{?systemd_preun:1}
165 %systemd_preun %{name}.service
167 if [ $1 -eq 0 ] ; then
168 # Package removal, not upgrade
169 /bin/systemctl --no-reload disable %{name}.service >/dev/null 2>&1 || :
170 /bin/systemctl stop %{name}.service >/dev/null 2>&1 || :
175 %if 0%{?systemd_preun:1}
176 %systemd_preun ovn-controller.service
177 %systemd_preun ovn-controller-vtep.service
178 %systemd_preun ovn-northd.service
180 if [ $1 -eq 0 ] ; then
181 # Package removal, not upgrade
182 /bin/systemctl --no-reload disable ovn-controller.service >/dev/null 2>&1 || :
183 /bin/systemctl stop ovn-controller.service >/dev/null 2>&1 || :
184 /bin/systemctl --no-reload disable ovn-controller-vtep.service >/dev/null 2>&1 || :
185 /bin/systemctl stop ovn-controller-vtep.service >/dev/null 2>&1 || :
186 /bin/systemctl --no-reload disable ovn-northd.service >/dev/null 2>&1 || :
187 /bin/systemctl stop ovn-northd.service >/dev/null 2>&1 || :
192 %if 0%{?systemd_post:1}
193 %systemd_post %{name}.service
195 # Package install, not upgrade
196 if [ $1 -eq 1 ]; then
197 /bin/systemctl daemon-reload >dev/null || :
202 %if 0%{?systemd_post:1}
203 %systemd_post ovn-controller.service
204 %systemd_post ovn-controller-vtep.service
205 %systemd_post ovn-northd.service
207 # Package install, not upgrade
208 if [ $1 -eq 1 ]; then
209 /bin/systemctl daemon-reload >dev/null || :
214 %if 0%{?systemd_postun_with_restart:1}
215 %systemd_postun_with_restart %{name}.service
217 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
218 if [ "$1" -ge "1" ] ; then
219 # Package upgrade, not uninstall
220 /bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
225 %if 0%{?systemd_postun_with_restart:1}
226 %systemd_postun_with_restart ovn-controller.service
227 %systemd_postun_with_restart ovn-controller-vtep.service
228 %systemd_postun_with_restart ovn-northd.service
230 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
231 if [ "$1" -ge "1" ] ; then
232 # Package upgrade, not uninstall
233 /bin/systemctl try-restart ovn-controller.service >/dev/null 2>&1 || :
234 /bin/systemctl try-restart ovn-controller-vtep.service >/dev/null 2>&1 || :
235 /bin/systemctl try-restart ovn-northd.service >/dev/null 2>&1 || :
239 %files -n python-openvswitch
240 %{python_sitelib}/ovs
245 %{_bindir}/ovs-vlan-test
246 %{_bindir}/ovs-l3ping
247 %{_mandir}/man8/ovs-test.8*
248 %{_mandir}/man8/ovs-vlan-test.8*
249 %{_mandir}/man8/ovs-l3ping.8*
250 %{python_sitelib}/ovstest
255 %{_libdir}/pkgconfig/*.pc
256 %{_includedir}/openvswitch/*
257 %{_includedir}/openflow/*
260 %defattr(-,root,root)
261 %{_sysconfdir}/bash_completion.d/ovs-appctl-bashcomp.bash
262 %{_sysconfdir}/bash_completion.d/ovs-vsctl-bashcomp.bash
263 %dir %{_sysconfdir}/openvswitch
264 %config %ghost %{_sysconfdir}/openvswitch/conf.db
265 %config %ghost %{_sysconfdir}/openvswitch/system-id.conf
266 %config(noreplace) %{_sysconfdir}/sysconfig/openvswitch
267 %config(noreplace) %{_sysconfdir}/logrotate.d/openvswitch
268 %{_unitdir}/openvswitch.service
269 %{_unitdir}/openvswitch-nonetwork.service
270 %{_datadir}/openvswitch/scripts/openvswitch.init
271 %{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
272 %{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
273 %{_datadir}/openvswitch/bugtool-plugins/
274 %{_datadir}/openvswitch/scripts/ovs-bugtool-*
275 %{_datadir}/openvswitch/scripts/ovs-check-dead-ifs
276 %{_datadir}/openvswitch/scripts/ovs-lib
277 %{_datadir}/openvswitch/scripts/ovs-vtep
278 %{_datadir}/openvswitch/scripts/ovs-ctl
279 %config %{_datadir}/openvswitch/vswitch.ovsschema
280 %config %{_datadir}/openvswitch/vtep.ovsschema
281 %{_bindir}/ovs-appctl
282 %{_bindir}/ovs-docker
284 %{_bindir}/ovs-dpctl-top
287 %{_bindir}/ovsdb-client
288 %{_bindir}/ovsdb-tool
289 %{_bindir}/ovs-testcontroller
292 %{_sbindir}/ovs-bugtool
293 %{_sbindir}/ovs-vswitchd
294 %{_sbindir}/ovsdb-server
295 %{_mandir}/man1/ovs-benchmark.1*
296 %{_mandir}/man1/ovs-pcap.1*
297 %{_mandir}/man1/ovs-tcpundump.1*
298 %{_mandir}/man1/ovsdb-client.1*
299 %{_mandir}/man1/ovsdb-server.1*
300 %{_mandir}/man1/ovsdb-tool.1*
301 %{_mandir}/man5/ovs-vswitchd.conf.db.5*
302 %{_mandir}/man5/vtep.5*
303 %{_mandir}/man8/vtep-ctl.8*
304 %{_mandir}/man8/ovs-appctl.8*
305 %{_mandir}/man8/ovs-bugtool.8*
306 %{_mandir}/man8/ovs-ctl.8*
307 %{_mandir}/man8/ovs-dpctl.8*
308 %{_mandir}/man8/ovs-dpctl-top.8*
309 %{_mandir}/man8/ovs-ofctl.8*
310 %{_mandir}/man8/ovs-pki.8*
311 %{_mandir}/man8/ovs-vsctl.8*
312 %{_mandir}/man8/ovs-vswitchd.8*
313 %{_mandir}/man8/ovs-parse-backtrace.8*
314 %{_mandir}/man8/ovs-testcontroller.8*
315 %doc COPYING DESIGN.md INSTALL.SSL.md NOTICE README.md WHY-OVS.md
316 %doc FAQ.md NEWS INSTALL.DPDK.md rhel/README.RHEL
319 %ghost %attr(755,root,root) %{_rundir}/openvswitch
320 %exclude %{_bindir}/ovs-benchmark
321 %exclude %{_bindir}/ovs-parse-backtrace
322 %exclude %{_bindir}/ovs-pcap
323 %exclude %{_bindir}/ovs-tcpundump
324 %exclude %{_sbindir}/ovs-vlan-bug-workaround
325 %exclude %{_mandir}/man1/ovs-benchmark.1.gz
326 %exclude %{_mandir}/man1/ovs-pcap.1.gz
327 %exclude %{_mandir}/man1/ovs-tcpundump.1.gz
328 %exclude %{_mandir}/man8/ovs-vlan-bug-workaround.8.gz
329 %exclude %{_datadir}/openvswitch/scripts/ovs-save
332 %{_bindir}/ovn-controller
333 %{_bindir}/ovn-controller-vtep
335 %{_bindir}/ovn-northd
337 %{_datadir}/openvswitch/scripts/ovn-ctl
338 %{_mandir}/man8/ovs-testcontroller.8*
339 %{_mandir}/man5/ovn-nb.5*
340 %{_mandir}/man5/ovn-sb.5*
341 %{_mandir}/man7/ovn-architecture.7*
342 %{_mandir}/man8/ovn-controller.8*
343 %{_mandir}/man8/ovn-controller-vtep.8*
344 %{_mandir}/man8/ovn-ctl.8*
345 %{_mandir}/man8/ovn-nbctl.8*
346 %{_mandir}/man8/ovn-northd.8*
347 %{_mandir}/man8/ovn-sbctl.8*
348 %config %{_datadir}/openvswitch/ovn-nb.ovsschema
349 %config %{_datadir}/openvswitch/ovn-sb.ovsschema
350 %{_unitdir}/ovn-controller.service
351 %{_unitdir}/ovn-controller-vtep.service
352 %{_unitdir}/ovn-northd.service
355 * Wed Jan 12 2011 Ralf Spenneberg <ralf@os-s.net>