1 # Spec file for Open vSwitch.
3 # Copyright (C) 2009, 2010, 2013, 2014 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 # python/compat is Python (although not built into any of the binary packages)
29 License: ASL 2.0 and LGPLv2+ and SISSL
31 Source: http://openvswitch.org/releases/%{name}-%{version}.tar.gz
33 BuildRequires: autoconf
34 BuildRequires: systemd-units openssl openssl-devel
35 BuildRequires: python python-twisted-core python-zope-interface PyQt4
36 BuildRequires: desktop-file-utils
37 BuildRequires: groff graphviz
38 # make check dependencies
39 BuildRequires: procps-ng
41 Requires: openssl iproute module-init-tools
42 #Upstream kernel commit 4f647e0a3c37b8d5086214128614a136064110c3
43 #Requires: kernel >= 3.15.0-0
45 Requires(post): systemd-units
46 Requires(preun): systemd-units
47 Requires(postun): systemd-units
48 Obsoletes: openvswitch-controller <= 0:2.1.0-1
53 Open vSwitch provides standard network bridging functions and
54 support for the OpenFlow protocol for remote per-flow control of
57 %package -n python-openvswitch
58 Summary: Open vSwitch python bindings
63 %description -n python-openvswitch
64 Python bindings for the Open vSwitch database
67 Summary: Open vSwitch testing utilities
70 Requires: python-openvswitch = %{version}-%{release}
71 Requires: python python-twisted-core python-twisted-web
74 Utilities that are useful to diagnose performance and connectivity
75 issues in Open vSwitch setup.
78 Summary: Open vSwitch OpenFlow development package (library, headers)
80 Provides: openvswitch-static = %{version}-%{release}
83 This provides static library, libopenswitch.a and the openvswitch header
84 files needed to build an external application.
87 Summary: Open vSwitch - Open Virtual Network support
92 OVN, the Open Virtual Network, is a system to support virtual network
93 abstraction. OVN complements the existing capabilities of OVS to add
94 native support for virtual network abstractions, such as virtual L2 and L3
95 overlays and security groups.
102 %configure --enable-ssl --with-pkidir=%{_sharedstatedir}/openvswitch/pki
106 rm -rf $RPM_BUILD_ROOT
107 make install DESTDIR=$RPM_BUILD_ROOT
109 install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch
111 install -p -D -m 0644 \
112 rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
113 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/openvswitch
114 for service in openvswitch openvswitch-nonetwork ovn-controller ovn-northd; do
115 install -p -D -m 0644 \
116 rhel/usr_lib_systemd_system_${service}.service \
117 $RPM_BUILD_ROOT%{_unitdir}/${service}.service
119 install -m 0755 rhel/etc_init.d_openvswitch \
120 $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init
122 install -p -D -m 0644 rhel/etc_logrotate.d_openvswitch \
123 $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/openvswitch
125 install -m 0644 vswitchd/vswitch.ovsschema \
126 $RPM_BUILD_ROOT/%{_datadir}/openvswitch/vswitch.ovsschema
128 install -d -m 0755 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/
129 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \
130 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
131 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \
132 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
134 install -d -m 0755 $RPM_BUILD_ROOT%{python_sitelib}
135 mv $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/* \
136 $RPM_BUILD_ROOT%{python_sitelib}
137 rmdir $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/
139 install -d -m 0755 $RPM_BUILD_ROOT/%{_sharedstatedir}/openvswitch
141 touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/conf.db
142 touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/system-id.conf
146 if make check TESTSUITEFLAGS='%{_smp_mflags}' ||
147 make check TESTSUITEFLAGS='--recheck'; then :;
149 cat tests/testsuite.log
155 rm -rf $RPM_BUILD_ROOT
158 %if 0%{?systemd_preun:1}
159 %systemd_preun %{name}.service
161 if [ $1 -eq 0 ] ; then
162 # Package removal, not upgrade
163 /bin/systemctl --no-reload disable %{name}.service >/dev/null 2>&1 || :
164 /bin/systemctl stop %{name}.service >/dev/null 2>&1 || :
169 %if 0%{?systemd_preun:1}
170 %systemd_preun ovn-controller.service
171 %systemd_preun ovn-northd.service
173 if [ $1 -eq 0 ] ; then
174 # Package removal, not upgrade
175 /bin/systemctl --no-reload disable ovn-controller.service >/dev/null 2>&1 || :
176 /bin/systemctl stop ovn-controller.service >/dev/null 2>&1 || :
177 /bin/systemctl --no-reload disable ovn-northd.service >/dev/null 2>&1 || :
178 /bin/systemctl stop ovn-northd.service >/dev/null 2>&1 || :
183 %if 0%{?systemd_post:1}
184 %systemd_post %{name}.service
186 # Package install, not upgrade
187 if [ $1 -eq 1 ]; then
188 /bin/systemctl daemon-reload >dev/null || :
193 %if 0%{?systemd_post:1}
194 %systemd_post ovn-controller.service
195 %systemd_post ovn-northd.service
197 # Package install, not upgrade
198 if [ $1 -eq 1 ]; then
199 /bin/systemctl daemon-reload >dev/null || :
204 %if 0%{?systemd_postun_with_restart:1}
205 %systemd_postun_with_restart %{name}.service
207 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
208 if [ "$1" -ge "1" ] ; then
209 # Package upgrade, not uninstall
210 /bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
215 %if 0%{?systemd_postun_with_restart:1}
216 %systemd_postun_with_restart ovn-controller.service
217 %systemd_postun_with_restart ovn-northd.service
219 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
220 if [ "$1" -ge "1" ] ; then
221 # Package upgrade, not uninstall
222 /bin/systemctl try-restart ovn-controller.service >/dev/null 2>&1 || :
223 /bin/systemctl try-restart ovn-northd.service >/dev/null 2>&1 || :
227 %files -n python-openvswitch
228 %{python_sitelib}/ovs
233 %{_bindir}/ovs-vlan-test
234 %{_bindir}/ovs-l3ping
235 %{_mandir}/man8/ovs-test.8*
236 %{_mandir}/man8/ovs-vlan-test.8*
237 %{_mandir}/man8/ovs-l3ping.8*
238 %{python_sitelib}/ovstest
243 %{_libdir}/pkgconfig/*.pc
244 %{_includedir}/openvswitch/*
245 %{_includedir}/openflow/*
248 %defattr(-,root,root)
249 %{_sysconfdir}/bash_completion.d/ovs-appctl-bashcomp.bash
250 %{_sysconfdir}/bash_completion.d/ovs-vsctl-bashcomp.bash
251 %dir %{_sysconfdir}/openvswitch
252 %config %ghost %{_sysconfdir}/openvswitch/conf.db
253 %config %ghost %{_sysconfdir}/openvswitch/system-id.conf
254 %config(noreplace) %{_sysconfdir}/sysconfig/openvswitch
255 %config(noreplace) %{_sysconfdir}/logrotate.d/openvswitch
256 %{_unitdir}/openvswitch.service
257 %{_unitdir}/openvswitch-nonetwork.service
258 %{_datadir}/openvswitch/scripts/openvswitch.init
259 %{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
260 %{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
261 %{_datadir}/openvswitch/bugtool-plugins/
262 %{_datadir}/openvswitch/scripts/ovs-bugtool-*
263 %{_datadir}/openvswitch/scripts/ovs-check-dead-ifs
264 %{_datadir}/openvswitch/scripts/ovs-lib
265 %{_datadir}/openvswitch/scripts/ovs-vtep
266 %{_datadir}/openvswitch/scripts/ovs-ctl
267 %config %{_datadir}/openvswitch/vswitch.ovsschema
268 %config %{_datadir}/openvswitch/vtep.ovsschema
269 %{_bindir}/ovs-appctl
270 %{_bindir}/ovs-docker
272 %{_bindir}/ovs-dpctl-top
275 %{_bindir}/ovsdb-client
276 %{_bindir}/ovsdb-tool
277 %{_bindir}/ovs-testcontroller
280 %{_sbindir}/ovs-bugtool
281 %{_sbindir}/ovs-vswitchd
282 %{_sbindir}/ovsdb-server
283 %{_mandir}/man1/ovs-benchmark.1*
284 %{_mandir}/man1/ovs-pcap.1*
285 %{_mandir}/man1/ovs-tcpundump.1*
286 %{_mandir}/man1/ovsdb-client.1*
287 %{_mandir}/man1/ovsdb-server.1*
288 %{_mandir}/man1/ovsdb-tool.1*
289 %{_mandir}/man5/ovs-vswitchd.conf.db.5*
290 %{_mandir}/man5/vtep.5*
291 %{_mandir}/man8/vtep-ctl.8*
292 %{_mandir}/man8/ovs-appctl.8*
293 %{_mandir}/man8/ovs-bugtool.8*
294 %{_mandir}/man8/ovs-ctl.8*
295 %{_mandir}/man8/ovs-dpctl.8*
296 %{_mandir}/man8/ovs-dpctl-top.8*
297 %{_mandir}/man8/ovs-ofctl.8*
298 %{_mandir}/man8/ovs-pki.8*
299 %{_mandir}/man8/ovs-vsctl.8*
300 %{_mandir}/man8/ovs-vswitchd.8*
301 %{_mandir}/man8/ovs-parse-backtrace.8*
302 %{_mandir}/man8/ovs-testcontroller.8*
303 %doc COPYING DESIGN.md INSTALL.SSL.md NOTICE README.md WHY-OVS.md
304 %doc FAQ.md NEWS INSTALL.DPDK.md rhel/README.RHEL
307 %ghost %attr(755,root,root) %{_rundir}/openvswitch
308 %exclude %{_bindir}/ovs-benchmark
309 %exclude %{_bindir}/ovs-parse-backtrace
310 %exclude %{_bindir}/ovs-pcap
311 %exclude %{_bindir}/ovs-tcpundump
312 %exclude %{_sbindir}/ovs-vlan-bug-workaround
313 %exclude %{_mandir}/man1/ovs-benchmark.1.gz
314 %exclude %{_mandir}/man1/ovs-pcap.1.gz
315 %exclude %{_mandir}/man1/ovs-tcpundump.1.gz
316 %exclude %{_mandir}/man8/ovs-vlan-bug-workaround.8.gz
317 %exclude %{_datadir}/openvswitch/scripts/ovs-save
320 %{_bindir}/ovn-controller
322 %{_bindir}/ovn-northd
323 %{_datadir}/openvswitch/scripts/ovn-ctl
324 %{_mandir}/man8/ovs-testcontroller.8*
325 %{_mandir}/man5/ovn-nb.5*
326 %{_mandir}/man5/ovn-sb.5*
327 %{_mandir}/man7/ovn-architecture.7*
328 %{_mandir}/man8/ovn-controller.8*
329 %{_mandir}/man8/ovn-ctl.8*
330 %{_mandir}/man8/ovn-nbctl.8*
331 %config %{_datadir}/openvswitch/ovn-nb.ovsschema
332 %config %{_datadir}/openvswitch/ovn-sb.ovsschema
333 %{_unitdir}/ovn-controller.service
334 %{_unitdir}/ovn-northd.service
335 %ghost %attr(755,root,root) %{_rundir}/ovn-controller
336 %ghost %attr(755,root,root) %{_rundir}/ovn-northd
339 * Wed Jan 12 2011 Ralf Spenneberg <ralf@os-s.net>