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
18 Group: System Environment/Daemons
19 URL: http://www.openvswitch.org/
22 # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the
23 # lib/sflow*.[ch] files are SISSL
24 # datapath/ is GPLv2 (although not built into any of the binary packages)
25 # python/compat is Python (although not built into any of the binary packages)
26 License: ASL 2.0 and LGPLv2+ and SISSL
28 Source: http://openvswitch.org/releases/%{name}-%{version}.tar.gz
30 BuildRequires: autoconf
31 BuildRequires: systemd-units openssl openssl-devel
32 BuildRequires: python python-twisted-core python-zope-interface PyQt4
33 BuildRequires: desktop-file-utils
34 BuildRequires: groff graphviz
36 Requires: openssl iproute module-init-tools
37 #Upstream kernel commit 4f647e0a3c37b8d5086214128614a136064110c3
38 Requires: kernel >= 3.15.0-0
40 Requires(post): systemd-units
41 Requires(preun): systemd-units
42 Requires(postun): systemd-units
47 Open vSwitch provides standard network bridging functions and
48 support for the OpenFlow protocol for remote per-flow control of
51 %package -n python-openvswitch
52 Summary: Open vSwitch python bindings
57 %description -n python-openvswitch
58 Python bindings for the Open vSwitch database
61 Summary: Open vSwitch testing utilities
64 Requires: python-openvswitch = %{version}-%{release}
65 Requires: python python-twisted-core python-twisted-web
68 Utilities that are useful to diagnose performance and connectivity
69 issues in Open vSwitch setup.
72 Summary: Open vSwitch OpenFlow development package (library, headers)
74 Provides: openvswitch-static = %{version}-%{release}
77 This provides static library, libopenswitch.a and the openvswitch header
78 files needed to build an external application.
82 %setup -q -n openvswitch-%{version}
85 %configure --enable-ssl --with-pkidir=%{_sharedstatedir}/openvswitch/pki
89 rm -rf $RPM_BUILD_ROOT
90 make install DESTDIR=$RPM_BUILD_ROOT
91 install -d -m 755 $RPM_BUILD_ROOT/etc
92 install -d -m 755 $RPM_BUILD_ROOT/etc/openvswitch
93 install -p -D -m 0644 rhel/usr_lib_systemd_system_openvswitch.service \
94 $RPM_BUILD_ROOT%{_unitdir}/openvswitch.service
95 install -p -D -m 0644 rhel/usr_lib_systemd_system_openvswitch-nonetwork.service \
96 $RPM_BUILD_ROOT%{_unitdir}/openvswitch-nonetwork.service
97 install -m 755 rhel/etc_init.d_openvswitch \
98 $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init
99 install -d -m 755 $RPM_BUILD_ROOT/etc/sysconfig
100 install -d -m 755 $RPM_BUILD_ROOT/etc/logrotate.d
101 install -m 755 rhel/etc_logrotate.d_openvswitch \
102 $RPM_BUILD_ROOT/etc/logrotate.d/openvswitch
103 install -d -m 755 $RPM_BUILD_ROOT/etc/profile.d
104 install -m 644 vswitchd/vswitch.ovsschema \
105 $RPM_BUILD_ROOT/usr/share/openvswitch/vswitch.ovsschema
106 install -d -m 755 $RPM_BUILD_ROOT/usr/share/openvswitch/scripts
107 install -d -m 0755 $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/
108 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \
109 $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/ifdown-ovs
110 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \
111 $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/ifup-ovs
112 install -p -D -m 0644 rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
113 $RPM_BUILD_ROOT/etc/sysconfig/openvswitch
114 install -d -m 755 $RPM_BUILD_ROOT/usr/share/openvswitch/scripts
116 install -d -m 0755 $RPM_BUILD_ROOT%{python_sitelib}
117 mv $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/* $RPM_BUILD_ROOT%{python_sitelib}
118 rmdir $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/
120 install -d -m 755 $RPM_BUILD_ROOT/var/lib/openvswitch
122 install -d -m 0755 $RPM_BUILD_ROOT%{_includedir}/openvswitch
123 install -p -D -m 0644 include/openvswitch/*.h \
124 -t $RPM_BUILD_ROOT%{_includedir}/openvswitch
125 install -p -D -m 0644 config.h -t $RPM_BUILD_ROOT%{_includedir}/openvswitch
127 install -d -m 0755 $RPM_BUILD_ROOT%{_includedir}/openvswitch/lib
128 install -p -D -m 0644 lib/*.h \
129 -t $RPM_BUILD_ROOT%{_includedir}/openvswitch/lib
131 install -d -m 0755 $RPM_BUILD_ROOT%{_includedir}/openflow
132 install -p -D -m 0644 include/openflow/*.h \
133 -t $RPM_BUILD_ROOT%{_includedir}/openflow
137 if make check TESTSUITEFLAGS='%{_smp_mflags}' ||
138 make check TESTSUITEFLAGS='--recheck'; then :;
140 cat tests/testsuite.log
146 rm -rf $RPM_BUILD_ROOT
149 # Package removal, not upgrade
150 systemctl stop openvswitch.service
151 systemctl disable openvswitch.service
154 if test ! -e /etc/openvswitch/conf.db; then
155 install -d -m 755 -o root -g root /etc/openvswitch
157 # Create ovs-vswitchd config database
158 ovsdb-tool -vANY:console:emer create /etc/openvswitch/conf.db \
159 /usr/share/openvswitch/vswitch.ovsschema
161 # Create initial table in config database
162 ovsdb-tool -vANY:console:emer transact /etc/openvswitch/conf.db \
163 '[{"op": "insert", "table": "Open_vSwitch", "row": {}}]' \
166 # Initial installation
167 systemctl enable openvswitch.service
168 systemctl start openvswitch.service
172 %files -n python-openvswitch
173 %{python_sitelib}/ovs
178 %{_bindir}/ovs-vlan-test
179 %{_bindir}/ovs-l3ping
180 %{_mandir}/man8/ovs-test.8*
181 %{_mandir}/man8/ovs-vlan-test.8*
182 %{_mandir}/man8/ovs-l3ping.8*
183 %{python_sitelib}/ovstest
188 %{_includedir}/openvswitch/*
189 %{_includedir}/openflow/*
192 %defattr(-,root,root)
193 %config /etc/sysconfig/openvswitch
194 %config /etc/logrotate.d/openvswitch
195 %{_unitdir}/openvswitch.service
196 %{_unitdir}/openvswitch-nonetwork.service
197 %{_datadir}/openvswitch/scripts/openvswitch.init
198 %{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
199 %{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
200 /usr/share/openvswitch/bugtool-plugins/
201 /usr/share/openvswitch/scripts/ovs-bugtool-*
202 /usr/share/openvswitch/scripts/ovs-check-dead-ifs
203 /usr/share/openvswitch/scripts/ovs-lib
204 /usr/share/openvswitch/scripts/ovs-vtep
205 %config /usr/share/openvswitch/vswitch.ovsschema
206 %config /usr/share/openvswitch/vtep.ovsschema
207 /usr/sbin/ovs-bugtool
208 /usr/sbin/ovs-vswitchd
209 /usr/sbin/ovsdb-server
213 /usr/bin/ovs-dpctl-top
216 /usr/bin/ovsdb-client
218 /usr/bin/ovs-testcontroller
221 %doc /usr/share/man/man8/ovs-testcontroller.8.gz
222 %doc /usr/share/man/man8/ovs-pki.8.gz
223 %doc /usr/share/man/man1/ovsdb-client.1.gz
224 %doc /usr/share/man/man1/ovsdb-server.1.gz
225 %doc /usr/share/man/man1/ovsdb-tool.1.gz
226 %doc /usr/share/man/man5/ovs-vswitchd.conf.db.5.gz
227 %doc /usr/share/man/man5/vtep.5.gz
228 %doc /usr/share/man/man8/ovs-appctl.8.gz
229 %doc /usr/share/man/man8/ovs-bugtool.8.gz
230 %doc /usr/share/man/man8/ovs-ctl.8.gz
231 %doc /usr/share/man/man8/ovs-dpctl.8.gz
232 %doc /usr/share/man/man8/ovs-dpctl-top.8.gz
233 %doc /usr/share/man/man8/ovs-ofctl.8.gz
234 %doc /usr/share/man/man8/ovs-parse-backtrace.8.gz
235 %doc /usr/share/man/man8/ovs-vsctl.8.gz
236 %doc /usr/share/man/man8/ovs-vswitchd.8.gz
237 %doc /usr/share/man/man8/vtep-ctl.8.gz
238 %doc COPYING DESIGN.md INSTALL.SSL.md NOTICE README.md WHY-OVS.md FAQ.md NEWS INSTALL.DPDK.md
241 /usr/share/openvswitch/scripts/ovs-ctl
242 %exclude /etc/openvswitch
243 %exclude /usr/bin/ovs-benchmark
244 %exclude /usr/bin/ovs-parse-backtrace
245 %exclude /usr/bin/ovs-pcap
246 %exclude /usr/bin/ovs-tcpundump
247 %exclude /usr/sbin/ovs-vlan-bug-workaround
248 %exclude /usr/share/man/man1/ovs-benchmark.1.gz
249 %exclude /usr/share/man/man1/ovs-pcap.1.gz
250 %exclude /usr/share/man/man1/ovs-tcpundump.1.gz
251 %exclude /usr/share/man/man8/ovs-vlan-bug-workaround.8.gz
252 %exclude /usr/share/openvswitch/scripts/ovs-save
255 * Wed Jan 12 2011 Ralf Spenneberg <ralf@os-s.net>