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 ovn-controller ovn-northd; do
120 install -p -D -m 0644 \
121 rhel/usr_lib_systemd_system_${service}.service \
122 $RPM_BUILD_ROOT%{_unitdir}/${service}.service
124 install -m 0755 rhel/etc_init.d_openvswitch \
125 $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init
127 install -p -D -m 0644 rhel/etc_logrotate.d_openvswitch \
128 $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/openvswitch
130 install -m 0644 vswitchd/vswitch.ovsschema \
131 $RPM_BUILD_ROOT/%{_datadir}/openvswitch/vswitch.ovsschema
133 install -d -m 0755 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/
134 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \
135 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
136 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \
137 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
139 install -d -m 0755 $RPM_BUILD_ROOT%{python_sitelib}
140 mv $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/* \
141 $RPM_BUILD_ROOT%{python_sitelib}
142 rmdir $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/
144 install -d -m 0755 $RPM_BUILD_ROOT/%{_sharedstatedir}/openvswitch
146 touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/conf.db
147 touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/system-id.conf
151 if make check TESTSUITEFLAGS='%{_smp_mflags}' ||
152 make check TESTSUITEFLAGS='--recheck'; then :;
154 cat tests/testsuite.log
160 rm -rf $RPM_BUILD_ROOT
163 %if 0%{?systemd_preun:1}
164 %systemd_preun %{name}.service
166 if [ $1 -eq 0 ] ; then
167 # Package removal, not upgrade
168 /bin/systemctl --no-reload disable %{name}.service >/dev/null 2>&1 || :
169 /bin/systemctl stop %{name}.service >/dev/null 2>&1 || :
174 %if 0%{?systemd_preun:1}
175 %systemd_preun ovn-controller.service
176 %systemd_preun ovn-northd.service
178 if [ $1 -eq 0 ] ; then
179 # Package removal, not upgrade
180 /bin/systemctl --no-reload disable ovn-controller.service >/dev/null 2>&1 || :
181 /bin/systemctl stop ovn-controller.service >/dev/null 2>&1 || :
182 /bin/systemctl --no-reload disable ovn-northd.service >/dev/null 2>&1 || :
183 /bin/systemctl stop ovn-northd.service >/dev/null 2>&1 || :
188 %if 0%{?systemd_post:1}
189 %systemd_post %{name}.service
191 # Package install, not upgrade
192 if [ $1 -eq 1 ]; then
193 /bin/systemctl daemon-reload >dev/null || :
198 %if 0%{?systemd_post:1}
199 %systemd_post ovn-controller.service
200 %systemd_post ovn-northd.service
202 # Package install, not upgrade
203 if [ $1 -eq 1 ]; then
204 /bin/systemctl daemon-reload >dev/null || :
209 %if 0%{?systemd_postun_with_restart:1}
210 %systemd_postun_with_restart %{name}.service
212 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
213 if [ "$1" -ge "1" ] ; then
214 # Package upgrade, not uninstall
215 /bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
220 %if 0%{?systemd_postun_with_restart:1}
221 %systemd_postun_with_restart ovn-controller.service
222 %systemd_postun_with_restart ovn-northd.service
224 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
225 if [ "$1" -ge "1" ] ; then
226 # Package upgrade, not uninstall
227 /bin/systemctl try-restart ovn-controller.service >/dev/null 2>&1 || :
228 /bin/systemctl try-restart ovn-northd.service >/dev/null 2>&1 || :
232 %files -n python-openvswitch
233 %{python_sitelib}/ovs
238 %{_bindir}/ovs-vlan-test
239 %{_bindir}/ovs-l3ping
240 %{_mandir}/man8/ovs-test.8*
241 %{_mandir}/man8/ovs-vlan-test.8*
242 %{_mandir}/man8/ovs-l3ping.8*
243 %{python_sitelib}/ovstest
248 %{_libdir}/pkgconfig/*.pc
249 %{_includedir}/openvswitch/*
250 %{_includedir}/openflow/*
253 %defattr(-,root,root)
254 %{_sysconfdir}/bash_completion.d/ovs-appctl-bashcomp.bash
255 %{_sysconfdir}/bash_completion.d/ovs-vsctl-bashcomp.bash
256 %dir %{_sysconfdir}/openvswitch
257 %config %ghost %{_sysconfdir}/openvswitch/conf.db
258 %config %ghost %{_sysconfdir}/openvswitch/system-id.conf
259 %config(noreplace) %{_sysconfdir}/sysconfig/openvswitch
260 %config(noreplace) %{_sysconfdir}/logrotate.d/openvswitch
261 %{_unitdir}/openvswitch.service
262 %{_unitdir}/openvswitch-nonetwork.service
263 %{_datadir}/openvswitch/scripts/openvswitch.init
264 %{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
265 %{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
266 %{_datadir}/openvswitch/bugtool-plugins/
267 %{_datadir}/openvswitch/scripts/ovs-bugtool-*
268 %{_datadir}/openvswitch/scripts/ovs-check-dead-ifs
269 %{_datadir}/openvswitch/scripts/ovs-lib
270 %{_datadir}/openvswitch/scripts/ovs-vtep
271 %{_datadir}/openvswitch/scripts/ovs-ctl
272 %config %{_datadir}/openvswitch/vswitch.ovsschema
273 %config %{_datadir}/openvswitch/vtep.ovsschema
274 %{_bindir}/ovs-appctl
275 %{_bindir}/ovs-docker
277 %{_bindir}/ovs-dpctl-top
280 %{_bindir}/ovsdb-client
281 %{_bindir}/ovsdb-tool
282 %{_bindir}/ovs-testcontroller
285 %{_sbindir}/ovs-bugtool
286 %{_sbindir}/ovs-vswitchd
287 %{_sbindir}/ovsdb-server
288 %{_mandir}/man1/ovs-benchmark.1*
289 %{_mandir}/man1/ovs-pcap.1*
290 %{_mandir}/man1/ovs-tcpundump.1*
291 %{_mandir}/man1/ovsdb-client.1*
292 %{_mandir}/man1/ovsdb-server.1*
293 %{_mandir}/man1/ovsdb-tool.1*
294 %{_mandir}/man5/ovs-vswitchd.conf.db.5*
295 %{_mandir}/man5/vtep.5*
296 %{_mandir}/man8/vtep-ctl.8*
297 %{_mandir}/man8/ovs-appctl.8*
298 %{_mandir}/man8/ovs-bugtool.8*
299 %{_mandir}/man8/ovs-ctl.8*
300 %{_mandir}/man8/ovs-dpctl.8*
301 %{_mandir}/man8/ovs-dpctl-top.8*
302 %{_mandir}/man8/ovs-ofctl.8*
303 %{_mandir}/man8/ovs-pki.8*
304 %{_mandir}/man8/ovs-vsctl.8*
305 %{_mandir}/man8/ovs-vswitchd.8*
306 %{_mandir}/man8/ovs-parse-backtrace.8*
307 %{_mandir}/man8/ovs-testcontroller.8*
308 %doc COPYING DESIGN.md INSTALL.SSL.md NOTICE README.md WHY-OVS.md
309 %doc FAQ.md NEWS INSTALL.DPDK.md rhel/README.RHEL
312 %ghost %attr(755,root,root) %{_rundir}/openvswitch
313 %exclude %{_bindir}/ovs-benchmark
314 %exclude %{_bindir}/ovs-parse-backtrace
315 %exclude %{_bindir}/ovs-pcap
316 %exclude %{_bindir}/ovs-tcpundump
317 %exclude %{_sbindir}/ovs-vlan-bug-workaround
318 %exclude %{_mandir}/man1/ovs-benchmark.1.gz
319 %exclude %{_mandir}/man1/ovs-pcap.1.gz
320 %exclude %{_mandir}/man1/ovs-tcpundump.1.gz
321 %exclude %{_mandir}/man8/ovs-vlan-bug-workaround.8.gz
322 %exclude %{_datadir}/openvswitch/scripts/ovs-save
325 %{_bindir}/ovn-controller
326 %{_bindir}/ovn-controller-vtep
328 %{_bindir}/ovn-northd
330 %{_datadir}/openvswitch/scripts/ovn-ctl
331 %{_mandir}/man8/ovs-testcontroller.8*
332 %{_mandir}/man5/ovn-nb.5*
333 %{_mandir}/man5/ovn-sb.5*
334 %{_mandir}/man7/ovn-architecture.7*
335 %{_mandir}/man8/ovn-controller.8*
336 %{_mandir}/man8/ovn-controller-vtep.8*
337 %{_mandir}/man8/ovn-ctl.8*
338 %{_mandir}/man8/ovn-nbctl.8*
339 %{_mandir}/man8/ovn-sbctl.8*
340 %config %{_datadir}/openvswitch/ovn-nb.ovsschema
341 %config %{_datadir}/openvswitch/ovn-sb.ovsschema
342 %{_unitdir}/ovn-controller.service
343 %{_unitdir}/ovn-northd.service
344 %ghost %attr(755,root,root) %{_rundir}/ovn-controller
345 %ghost %attr(755,root,root) %{_rundir}/ovn-northd
348 * Wed Jan 12 2011 Ralf Spenneberg <ralf@os-s.net>