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
21 Group: System Environment/Daemons
22 URL: http://www.openvswitch.org/
25 # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the
26 # lib/sflow*.[ch] files are SISSL
27 # datapath/ is GPLv2 (although not built into any of the binary packages)
28 License: ASL 2.0 and LGPLv2+ and SISSL
30 Source: http://openvswitch.org/releases/%{name}-%{version}.tar.gz
32 BuildRequires: autoconf
33 BuildRequires: systemd-units openssl openssl-devel
34 BuildRequires: python python-twisted-core python-zope-interface PyQt4
35 BuildRequires: desktop-file-utils
36 BuildRequires: groff graphviz
37 # make check dependencies
38 BuildRequires: procps-ng
40 Requires: openssl iproute module-init-tools
41 #Upstream kernel commit 4f647e0a3c37b8d5086214128614a136064110c3
42 #Requires: kernel >= 3.15.0-0
44 Requires(post): systemd-units
45 Requires(preun): systemd-units
46 Requires(postun): systemd-units
47 Obsoletes: openvswitch-controller <= 0:2.1.0-1
52 Open vSwitch provides standard network bridging functions and
53 support for the OpenFlow protocol for remote per-flow control of
56 %package -n python-openvswitch
57 Summary: Open vSwitch python bindings
62 %description -n python-openvswitch
63 Python bindings for the Open vSwitch database
66 Summary: Open vSwitch testing utilities
69 Requires: python-openvswitch = %{version}-%{release}
70 Requires: python python-twisted-core python-twisted-web
73 Utilities that are useful to diagnose performance and connectivity
74 issues in Open vSwitch setup.
77 Summary: Open vSwitch OpenFlow development package (library, headers)
79 Provides: openvswitch-static = %{version}-%{release}
82 This provides static library, libopenswitch.a and the openvswitch header
83 files needed to build an external application.
86 Summary: Open vSwitch - Open Virtual Network support
91 OVN, the Open Virtual Network, is a system to support virtual network
92 abstraction. OVN complements the existing capabilities of OVS to add
93 native support for virtual network abstractions, such as virtual L2 and L3
94 overlays and security groups.
101 %configure --enable-ssl --with-pkidir=%{_sharedstatedir}/openvswitch/pki
105 rm -rf $RPM_BUILD_ROOT
106 make install DESTDIR=$RPM_BUILD_ROOT
108 install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch
110 install -p -D -m 0644 \
111 rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
112 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/openvswitch
113 for service in openvswitch openvswitch-nonetwork ovn-controller ovn-northd; do
114 install -p -D -m 0644 \
115 rhel/usr_lib_systemd_system_${service}.service \
116 $RPM_BUILD_ROOT%{_unitdir}/${service}.service
118 install -m 0755 rhel/etc_init.d_openvswitch \
119 $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init
121 install -p -D -m 0644 rhel/etc_logrotate.d_openvswitch \
122 $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/openvswitch
124 install -m 0644 vswitchd/vswitch.ovsschema \
125 $RPM_BUILD_ROOT/%{_datadir}/openvswitch/vswitch.ovsschema
127 install -d -m 0755 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/
128 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \
129 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
130 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \
131 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
133 install -d -m 0755 $RPM_BUILD_ROOT%{python_sitelib}
134 mv $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/* \
135 $RPM_BUILD_ROOT%{python_sitelib}
136 rmdir $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/
138 install -d -m 0755 $RPM_BUILD_ROOT/%{_sharedstatedir}/openvswitch
140 touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/conf.db
141 touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/system-id.conf
145 if make check TESTSUITEFLAGS='%{_smp_mflags}' ||
146 make check TESTSUITEFLAGS='--recheck'; then :;
148 cat tests/testsuite.log
154 rm -rf $RPM_BUILD_ROOT
157 %if 0%{?systemd_preun:1}
158 %systemd_preun %{name}.service
160 if [ $1 -eq 0 ] ; then
161 # Package removal, not upgrade
162 /bin/systemctl --no-reload disable %{name}.service >/dev/null 2>&1 || :
163 /bin/systemctl stop %{name}.service >/dev/null 2>&1 || :
168 %if 0%{?systemd_preun:1}
169 %systemd_preun ovn-controller.service
170 %systemd_preun ovn-northd.service
172 if [ $1 -eq 0 ] ; then
173 # Package removal, not upgrade
174 /bin/systemctl --no-reload disable ovn-controller.service >/dev/null 2>&1 || :
175 /bin/systemctl stop ovn-controller.service >/dev/null 2>&1 || :
176 /bin/systemctl --no-reload disable ovn-northd.service >/dev/null 2>&1 || :
177 /bin/systemctl stop ovn-northd.service >/dev/null 2>&1 || :
182 %if 0%{?systemd_post:1}
183 %systemd_post %{name}.service
185 # Package install, not upgrade
186 if [ $1 -eq 1 ]; then
187 /bin/systemctl daemon-reload >dev/null || :
192 %if 0%{?systemd_post:1}
193 %systemd_post ovn-controller.service
194 %systemd_post ovn-northd.service
196 # Package install, not upgrade
197 if [ $1 -eq 1 ]; then
198 /bin/systemctl daemon-reload >dev/null || :
203 %if 0%{?systemd_postun_with_restart:1}
204 %systemd_postun_with_restart %{name}.service
206 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
207 if [ "$1" -ge "1" ] ; then
208 # Package upgrade, not uninstall
209 /bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
214 %if 0%{?systemd_postun_with_restart:1}
215 %systemd_postun_with_restart ovn-controller.service
216 %systemd_postun_with_restart ovn-northd.service
218 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
219 if [ "$1" -ge "1" ] ; then
220 # Package upgrade, not uninstall
221 /bin/systemctl try-restart ovn-controller.service >/dev/null 2>&1 || :
222 /bin/systemctl try-restart ovn-northd.service >/dev/null 2>&1 || :
226 %files -n python-openvswitch
227 %{python_sitelib}/ovs
232 %{_bindir}/ovs-vlan-test
233 %{_bindir}/ovs-l3ping
234 %{_mandir}/man8/ovs-test.8*
235 %{_mandir}/man8/ovs-vlan-test.8*
236 %{_mandir}/man8/ovs-l3ping.8*
237 %{python_sitelib}/ovstest
242 %{_libdir}/pkgconfig/*.pc
243 %{_includedir}/openvswitch/*
244 %{_includedir}/openflow/*
247 %defattr(-,root,root)
248 %{_sysconfdir}/bash_completion.d/ovs-appctl-bashcomp.bash
249 %{_sysconfdir}/bash_completion.d/ovs-vsctl-bashcomp.bash
250 %dir %{_sysconfdir}/openvswitch
251 %config %ghost %{_sysconfdir}/openvswitch/conf.db
252 %config %ghost %{_sysconfdir}/openvswitch/system-id.conf
253 %config(noreplace) %{_sysconfdir}/sysconfig/openvswitch
254 %config(noreplace) %{_sysconfdir}/logrotate.d/openvswitch
255 %{_unitdir}/openvswitch.service
256 %{_unitdir}/openvswitch-nonetwork.service
257 %{_datadir}/openvswitch/scripts/openvswitch.init
258 %{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
259 %{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
260 %{_datadir}/openvswitch/bugtool-plugins/
261 %{_datadir}/openvswitch/scripts/ovs-bugtool-*
262 %{_datadir}/openvswitch/scripts/ovs-check-dead-ifs
263 %{_datadir}/openvswitch/scripts/ovs-lib
264 %{_datadir}/openvswitch/scripts/ovs-vtep
265 %{_datadir}/openvswitch/scripts/ovs-ctl
266 %config %{_datadir}/openvswitch/vswitch.ovsschema
267 %config %{_datadir}/openvswitch/vtep.ovsschema
268 %{_bindir}/ovs-appctl
269 %{_bindir}/ovs-docker
271 %{_bindir}/ovs-dpctl-top
274 %{_bindir}/ovsdb-client
275 %{_bindir}/ovsdb-tool
276 %{_bindir}/ovs-testcontroller
279 %{_sbindir}/ovs-bugtool
280 %{_sbindir}/ovs-vswitchd
281 %{_sbindir}/ovsdb-server
282 %{_mandir}/man1/ovs-benchmark.1*
283 %{_mandir}/man1/ovs-pcap.1*
284 %{_mandir}/man1/ovs-tcpundump.1*
285 %{_mandir}/man1/ovsdb-client.1*
286 %{_mandir}/man1/ovsdb-server.1*
287 %{_mandir}/man1/ovsdb-tool.1*
288 %{_mandir}/man5/ovs-vswitchd.conf.db.5*
289 %{_mandir}/man5/vtep.5*
290 %{_mandir}/man8/vtep-ctl.8*
291 %{_mandir}/man8/ovs-appctl.8*
292 %{_mandir}/man8/ovs-bugtool.8*
293 %{_mandir}/man8/ovs-ctl.8*
294 %{_mandir}/man8/ovs-dpctl.8*
295 %{_mandir}/man8/ovs-dpctl-top.8*
296 %{_mandir}/man8/ovs-ofctl.8*
297 %{_mandir}/man8/ovs-pki.8*
298 %{_mandir}/man8/ovs-vsctl.8*
299 %{_mandir}/man8/ovs-vswitchd.8*
300 %{_mandir}/man8/ovs-parse-backtrace.8*
301 %{_mandir}/man8/ovs-testcontroller.8*
302 %doc COPYING DESIGN.md INSTALL.SSL.md NOTICE README.md WHY-OVS.md
303 %doc FAQ.md NEWS INSTALL.DPDK.md rhel/README.RHEL
306 %ghost %attr(755,root,root) %{_rundir}/openvswitch
307 %exclude %{_bindir}/ovs-benchmark
308 %exclude %{_bindir}/ovs-parse-backtrace
309 %exclude %{_bindir}/ovs-pcap
310 %exclude %{_bindir}/ovs-tcpundump
311 %exclude %{_sbindir}/ovs-vlan-bug-workaround
312 %exclude %{_mandir}/man1/ovs-benchmark.1.gz
313 %exclude %{_mandir}/man1/ovs-pcap.1.gz
314 %exclude %{_mandir}/man1/ovs-tcpundump.1.gz
315 %exclude %{_mandir}/man8/ovs-vlan-bug-workaround.8.gz
316 %exclude %{_datadir}/openvswitch/scripts/ovs-save
319 %{_bindir}/ovn-controller
321 %{_bindir}/ovn-northd
322 %{_datadir}/openvswitch/scripts/ovn-ctl
323 %{_mandir}/man8/ovs-testcontroller.8*
324 %{_mandir}/man5/ovn-nb.5*
325 %{_mandir}/man5/ovn-sb.5*
326 %{_mandir}/man7/ovn-architecture.7*
327 %{_mandir}/man8/ovn-controller.8*
328 %{_mandir}/man8/ovn-ctl.8*
329 %{_mandir}/man8/ovn-nbctl.8*
330 %config %{_datadir}/openvswitch/ovn-nb.ovsschema
331 %config %{_datadir}/openvswitch/ovn-sb.ovsschema
332 %{_unitdir}/ovn-controller.service
333 %{_unitdir}/ovn-northd.service
334 %ghost %attr(755,root,root) %{_rundir}/ovn-controller
335 %ghost %attr(755,root,root) %{_rundir}/ovn-northd
338 * Wed Jan 12 2011 Ralf Spenneberg <ralf@os-s.net>