ovn-controller: Document supported ovs-appctl commands.
[cascardo/ovs.git] / rhel / openvswitch-fedora.spec.in
1 # Spec file for Open vSwitch.
2
3 # Copyright (C) 2009, 2010, 2013, 2014, 2015 Nicira Networks, Inc.
4 #
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.
9 #
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
13
14 #%define kernel 2.6.40.4-5.fc15.x86_64
15
16 # Enable PIE, bz#955181
17 %global _hardened_build 1
18
19 # some distros (e.g: RHEL-7) don't define _rundir macro yet
20 # Fedora 15 onwards uses /run as _rundir
21 %if 0%{!?_rundir:1}
22 %define _rundir /run
23 %endif
24
25 Name: openvswitch
26 Summary: Open vSwitch
27 Group: System Environment/Daemons
28 URL: http://www.openvswitch.org/
29 Version: @VERSION@
30
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
35 Release: 1%{?dist}
36 Source: http://openvswitch.org/releases/%{name}-%{version}.tar.gz
37
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
45
46 Requires: openssl iproute module-init-tools
47 #Upstream kernel commit 4f647e0a3c37b8d5086214128614a136064110c3
48 #Requires: kernel >= 3.15.0-0
49
50 Requires(post): systemd-units
51 Requires(preun): systemd-units
52 Requires(postun): systemd-units
53 Obsoletes: openvswitch-controller <= 0:2.1.0-1
54
55 %bcond_without check
56
57 %description
58 Open vSwitch provides standard network bridging functions and
59 support for the OpenFlow protocol for remote per-flow control of
60 traffic.
61
62 %package -n python-openvswitch
63 Summary: Open vSwitch python bindings
64 License: ASL 2.0
65 BuildArch: noarch
66 Requires: python
67
68 %description -n python-openvswitch
69 Python bindings for the Open vSwitch database
70
71 %package test
72 Summary: Open vSwitch testing utilities
73 License: ASL 2.0
74 BuildArch: noarch
75 Requires: python-openvswitch = %{version}-%{release}
76 Requires: python python-twisted-core python-twisted-web
77
78 %description test
79 Utilities that are useful to diagnose performance and connectivity
80 issues in Open vSwitch setup.
81
82 %package devel
83 Summary: Open vSwitch OpenFlow development package (library, headers)
84 License: ASL 2.0
85 Provides: openvswitch-static = %{version}-%{release}
86
87 %description devel
88 This provides static library, libopenswitch.a and the openvswitch header
89 files needed to build an external application.
90
91 %package ovn
92 Summary: Open vSwitch - Open Virtual Network support
93 License: ASL 2.0
94 Requires: openvswitch
95
96 %description ovn
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.
101
102
103 %prep
104 %setup -q
105
106 %build
107 %configure --enable-ssl --with-pkidir=%{_sharedstatedir}/openvswitch/pki
108 make %{?_smp_mflags}
109
110 %install
111 rm -rf $RPM_BUILD_ROOT
112 make install DESTDIR=$RPM_BUILD_ROOT
113
114 install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch
115
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
123 done
124 install -m 0755 rhel/etc_init.d_openvswitch \
125         $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init
126
127 install -p -D -m 0644 rhel/etc_logrotate.d_openvswitch \
128         $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/openvswitch
129
130 install -m 0644 vswitchd/vswitch.ovsschema \
131         $RPM_BUILD_ROOT/%{_datadir}/openvswitch/vswitch.ovsschema
132
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
138
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/
143
144 install -d -m 0755 $RPM_BUILD_ROOT/%{_sharedstatedir}/openvswitch
145
146 touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/conf.db
147 touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/system-id.conf
148
149 %check
150 %if %{with check}
151     if make check TESTSUITEFLAGS='%{_smp_mflags}' ||
152        make check TESTSUITEFLAGS='--recheck'; then :;
153     else
154         cat tests/testsuite.log
155         exit 1
156     fi
157 %endif
158
159 %clean
160 rm -rf $RPM_BUILD_ROOT
161
162 %preun
163 %if 0%{?systemd_preun:1}
164     %systemd_preun %{name}.service
165 %else
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 || :
170     fi
171 %endif
172
173 %preun ovn
174 %if 0%{?systemd_preun:1}
175     %systemd_preun ovn-controller.service
176     %systemd_preun ovn-northd.service
177 %else
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 || :
184     fi
185 %endif
186
187 %post
188 %if 0%{?systemd_post:1}
189     %systemd_post %{name}.service
190 %else
191     # Package install, not upgrade
192     if [ $1 -eq 1 ]; then
193         /bin/systemctl daemon-reload >dev/null || :
194     fi
195 %endif
196
197 %post ovn
198 %if 0%{?systemd_post:1}
199     %systemd_post ovn-controller.service
200     %systemd_post ovn-northd.service
201 %else
202     # Package install, not upgrade
203     if [ $1 -eq 1 ]; then
204         /bin/systemctl daemon-reload >dev/null || :
205     fi
206 %endif
207
208 %postun
209 %if 0%{?systemd_postun_with_restart:1}
210     %systemd_postun_with_restart %{name}.service
211 %else
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 || :
216     fi
217 %endif
218
219 %postun ovn
220 %if 0%{?systemd_postun_with_restart:1}
221     %systemd_postun_with_restart ovn-controller.service
222     %systemd_postun_with_restart ovn-northd.service
223 %else
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 || :
229     fi
230 %endif
231
232 %files -n python-openvswitch
233 %{python_sitelib}/ovs
234 %doc COPYING
235
236 %files test
237 %{_bindir}/ovs-test
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
244
245 %files devel
246 %{_libdir}/*.a
247 %{_libdir}/*.la
248 %{_libdir}/pkgconfig/*.pc
249 %{_includedir}/openvswitch/*
250 %{_includedir}/openflow/*
251
252 %files
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
276 %{_bindir}/ovs-dpctl
277 %{_bindir}/ovs-dpctl-top
278 %{_bindir}/ovs-ofctl
279 %{_bindir}/ovs-vsctl
280 %{_bindir}/ovsdb-client
281 %{_bindir}/ovsdb-tool
282 %{_bindir}/ovs-testcontroller
283 %{_bindir}/ovs-pki
284 %{_bindir}/vtep-ctl
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
310 /var/lib/openvswitch
311 /var/log/openvswitch
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
323
324 %files ovn
325 %{_bindir}/ovn-controller
326 %{_bindir}/ovn-controller-vtep
327 %{_bindir}/ovn-nbctl
328 %{_bindir}/ovn-northd
329 %{_bindir}/ovn-sbctl
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
346
347 %changelog
348 * Wed Jan 12 2011 Ralf Spenneberg <ralf@os-s.net>
349 - First build on F14