]> git.proxmox.com Git - mirror_ovs.git/blob - rhel/openvswitch-fedora.spec.in
doc: Populate 'faq' section
[mirror_ovs.git] / rhel / openvswitch-fedora.spec.in
1 # Spec file for Open vSwitch.
2
3 # Copyright (C) 2009, 2010, 2013, 2014, 2015, 2016 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 # Support for executing kernel data path tests under rpmbuild is
15 # provided, however this is intended for use only in test environments
16 # and should not be used otherwise (these tests require root privileges).
17 # These tests can be executed, for example, via:
18 # rpmbuild -rb --with check_datapath_kernel openvswitch-fedora.src.rpm
19 #
20 # These tests will use the currently installed OVS kernel modules, when
21 # testing out of tree kernel modules the appropriate openvswitch-kmod
22 # package should be installed first.
23
24 #%define kernel 2.6.40.4-5.fc15.x86_64
25
26 # If libcap-ng isn't available and there is no need for running OVS
27 # as regular user, specify the '--without libcapng'
28 %bcond_without libcapng
29 # To enable DPDK support, specify '--with dpdk' when building
30 %bcond_with dpdk
31
32 # Enable PIE, bz#955181
33 %global _hardened_build 1
34
35 # some distros (e.g: RHEL-7) don't define _rundir macro yet
36 # Fedora 15 onwards uses /run as _rundir
37 %if 0%{!?_rundir:1}
38 %define _rundir /run
39 %endif
40
41 Name: openvswitch
42 Summary: Open vSwitch
43 Group: System Environment/Daemons
44 URL: http://www.openvswitch.org/
45 Version: @VERSION@
46
47 # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the
48 # lib/sflow*.[ch] files are SISSL
49 # datapath/ is GPLv2 (although not built into any of the binary packages)
50 License: ASL 2.0 and LGPLv2+ and SISSL
51 Release: 1%{?dist}
52 Source: http://openvswitch.org/releases/%{name}-%{version}.tar.gz
53
54 BuildRequires: autoconf automake libtool
55 BuildRequires: systemd-units openssl openssl-devel
56 BuildRequires: python python-twisted-core python-zope-interface python-six
57 BuildRequires: desktop-file-utils
58 BuildRequires: groff graphviz
59 BuildRequires: checkpolicy, selinux-policy-devel
60 # make check dependencies
61 BuildRequires: procps-ng
62 %if %{with libcapng}
63 BuildRequires: libcap-ng libcap-ng-devel
64 %endif
65 %if %{with dpdk}
66 BuildRequires: dpdk-devel >= 2.2.0
67 Provides: %{name}-dpdk = %{version}-%{release}
68 %endif
69
70 Requires: openssl iproute module-init-tools
71 #Upstream kernel commit 4f647e0a3c37b8d5086214128614a136064110c3
72 #Requires: kernel >= 3.15.0-0
73
74 Requires(post): systemd-units
75 Requires(preun): systemd-units
76 Requires(postun): systemd-units
77 Obsoletes: openvswitch-controller <= 0:2.1.0-1
78
79 %bcond_without check
80 %bcond_with check_datapath_kernel
81
82 %description
83 Open vSwitch provides standard network bridging functions and
84 support for the OpenFlow protocol for remote per-flow control of
85 traffic.
86
87 %package selinux-policy
88 Summary: Open vSwitch SELinux policy
89 License: ASL 2.0
90 BuildArch: noarch
91 Requires: selinux-policy-targeted
92
93 %description selinux-policy
94 Tailored Open vSwitch SELinux policy
95
96 %package -n python-openvswitch
97 Summary: Open vSwitch python bindings
98 License: ASL 2.0
99 BuildArch: noarch
100 Requires: python
101 Requires: python-six
102
103 %description -n python-openvswitch
104 Python bindings for the Open vSwitch database
105
106 %package test
107 Summary: Open vSwitch testing utilities
108 License: ASL 2.0
109 BuildArch: noarch
110 Requires: python-openvswitch = %{version}-%{release}
111 Requires: python python-twisted-core python-twisted-web
112
113 %description test
114 Utilities that are useful to diagnose performance and connectivity
115 issues in Open vSwitch setup.
116
117 %package devel
118 Summary: Open vSwitch OpenFlow development package (library, headers)
119 License: ASL 2.0
120 Provides: openvswitch-static = %{version}-%{release}
121
122 %description devel
123 This provides static library, libopenswitch.a and the openvswitch header
124 files needed to build an external application.
125
126 %package ovn-central
127 Summary: Open vSwitch - Open Virtual Network support
128 License: ASL 2.0
129 Requires: openvswitch openvswitch-ovn-common
130
131 %description ovn-central
132 OVN, the Open Virtual Network, is a system to support virtual network
133 abstraction. OVN complements the existing capabilities of OVS to add
134 native support for virtual network abstractions, such as virtual L2 and L3
135 overlays and security groups.
136
137 %package ovn-host
138 Summary: Open vSwitch - Open Virtual Network support
139 License: ASL 2.0
140 Requires: openvswitch openvswitch-ovn-common
141
142 %description ovn-host
143 OVN, the Open Virtual Network, is a system to support virtual network
144 abstraction. OVN complements the existing capabilities of OVS to add
145 native support for virtual network abstractions, such as virtual L2 and L3
146 overlays and security groups.
147
148 %package ovn-vtep
149 Summary: Open vSwitch - Open Virtual Network support
150 License: ASL 2.0
151 Requires: openvswitch openvswitch-ovn-common
152
153 %description ovn-vtep
154 OVN vtep controller
155
156 %package ovn-common
157 Summary: Open vSwitch - Open Virtual Network support
158 License: ASL 2.0
159 Requires: openvswitch
160
161 %description ovn-common
162 Utilities that are use to diagnose and manage the OVN components.
163
164 %package ovn-docker
165 Summary: Open vSwitch - Open Virtual Network support
166 License: ASL 2.0
167 Requires: openvswitch openvswitch-ovn-common python-openvswitch
168
169 %description ovn-docker
170 Docker network plugins for OVN.
171
172 %prep
173 %setup -q
174
175 %build
176 %configure \
177 %if %{with libcapng}
178 --enable-libcapng \
179 %else
180 --disable-libcapng \
181 %endif
182 %if %{with dpdk}
183 --with-dpdk=$(dirname %{_datadir}/dpdk/*/.config) \
184 %endif
185 --enable-ssl \
186 --with-pkidir=%{_sharedstatedir}/openvswitch/pki
187
188 make %{?_smp_mflags}
189 cd selinux
190 make -f %{_datadir}/selinux/devel/Makefile
191
192 %install
193 rm -rf $RPM_BUILD_ROOT
194 make install DESTDIR=$RPM_BUILD_ROOT
195
196 install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch
197
198 install -p -D -m 0644 \
199 rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
200 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/openvswitch
201 for service in openvswitch ovsdb-server ovs-vswitchd \
202 ovn-controller ovn-controller-vtep ovn-northd; do
203 install -p -D -m 0644 \
204 rhel/usr_lib_systemd_system_${service}.service \
205 $RPM_BUILD_ROOT%{_unitdir}/${service}.service
206 done
207 install -m 0755 rhel/etc_init.d_openvswitch \
208 $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init
209
210 install -p -D -m 0644 rhel/etc_logrotate.d_openvswitch \
211 $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/openvswitch
212
213 install -m 0644 vswitchd/vswitch.ovsschema \
214 $RPM_BUILD_ROOT/%{_datadir}/openvswitch/vswitch.ovsschema
215
216 install -d -m 0755 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/
217 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \
218 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
219 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \
220 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
221
222 install -d -m 0755 $RPM_BUILD_ROOT%{python_sitelib}
223 mv $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/* \
224 $RPM_BUILD_ROOT%{python_sitelib}
225 rmdir $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/
226
227 install -d -m 0755 $RPM_BUILD_ROOT/%{_sharedstatedir}/openvswitch
228
229 touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/conf.db
230 touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/system-id.conf
231
232 install -p -m 644 -D selinux/openvswitch-custom.pp \
233 $RPM_BUILD_ROOT%{_datadir}/selinux/packages/%{name}/openvswitch-custom.pp
234
235 # remove unpackaged files
236 rm -f $RPM_BUILD_ROOT%{_bindir}/ovs-parse-backtrace \
237 $RPM_BUILD_ROOT%{_sbindir}/ovs-vlan-bug-workaround \
238 $RPM_BUILD_ROOT%{_mandir}/man8/ovs-vlan-bug-workaround.8
239
240 %check
241 %if %{with check}
242 if make check TESTSUITEFLAGS='%{_smp_mflags}' RECHECK=yes; then :;
243 else
244 cat tests/testsuite.log
245 exit 1
246 fi
247 %endif
248 %if %{with check_datapath_kernel}
249 if make check-kernel RECHECK=yes; then :;
250 else
251 cat tests/system-kmod-testsuite.log
252 exit 1
253 fi
254 %endif
255
256 %clean
257 rm -rf $RPM_BUILD_ROOT
258
259 %preun
260 %if 0%{?systemd_preun:1}
261 %systemd_preun %{name}.service
262 %else
263 if [ $1 -eq 0 ] ; then
264 # Package removal, not upgrade
265 /bin/systemctl --no-reload disable %{name}.service >/dev/null 2>&1 || :
266 /bin/systemctl stop %{name}.service >/dev/null 2>&1 || :
267 fi
268 %endif
269
270 %preun ovn-central
271 %if 0%{?systemd_preun:1}
272 %systemd_preun ovn-northd.service
273 %else
274 if [ $1 -eq 0 ] ; then
275 # Package removal, not upgrade
276 /bin/systemctl --no-reload disable ovn-northd.service >/dev/null 2>&1 || :
277 /bin/systemctl stop ovn-northd.service >/dev/null 2>&1 || :
278 fi
279 %endif
280
281 %preun ovn-host
282 %if 0%{?systemd_preun:1}
283 %systemd_preun ovn-controller.service
284 %else
285 if [ $1 -eq 0 ] ; then
286 # Package removal, not upgrade
287 /bin/systemctl --no-reload disable ovn-controller.service >/dev/null 2>&1 || :
288 /bin/systemctl stop ovn-controller.service >/dev/null 2>&1 || :
289 fi
290 %endif
291
292 %preun ovn-vtep
293 %if 0%{?systemd_preun:1}
294 %systemd_preun ovn-controller-vtep.service
295 %else
296 if [ $1 -eq 0 ] ; then
297 # Package removal, not upgrade
298 /bin/systemctl --no-reload disable ovn-controller-vtep.service >/dev/null 2>&1 || :
299 /bin/systemctl stop ovn-controller-vtep.service >/dev/null 2>&1 || :
300 fi
301 %endif
302
303 %post
304 %if 0%{?systemd_post:1}
305 %systemd_post %{name}.service
306 %else
307 # Package install, not upgrade
308 if [ $1 -eq 1 ]; then
309 /bin/systemctl daemon-reload >dev/null || :
310 fi
311 %endif
312
313 %post ovn-common
314 mkdir -p /usr/lib/ocf/resource.d/ovn
315 ln -sf %{_datadir}/openvswitch/scripts/ovndb-servers.ocf /usr/lib/ocf/resource.d/ovn/ovndb-servers
316
317 %post ovn-central
318 %if 0%{?systemd_post:1}
319 %systemd_post ovn-northd.service
320 %else
321 # Package install, not upgrade
322 if [ $1 -eq 1 ]; then
323 /bin/systemctl daemon-reload >dev/null || :
324 fi
325 %endif
326
327 %post ovn-host
328 %if 0%{?systemd_post:1}
329 %systemd_post ovn-controller.service
330 %else
331 # Package install, not upgrade
332 if [ $1 -eq 1 ]; then
333 /bin/systemctl daemon-reload >dev/null || :
334 fi
335 %endif
336
337 %post ovn-vtep
338 %if 0%{?systemd_post:1}
339 %systemd_post ovn-controller-vtep.service
340 %else
341 # Package install, not upgrade
342 if [ $1 -eq 1 ]; then
343 /bin/systemctl daemon-reload >dev/null || :
344 fi
345 %endif
346
347 %post selinux-policy
348 /usr/sbin/semodule -i %{_datadir}/selinux/packages/%{name}/openvswitch-custom.pp &> /dev/null || :
349
350 %postun
351 %if 0%{?systemd_postun:1}
352 %systemd_postun %{name}.service
353 %else
354 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
355 %endif
356
357 %postun ovn-common
358 rm -rf /usr/lib/ocf/resource.d/ovn
359
360 %postun ovn-central
361 %if 0%{?systemd_postun_with_restart:1}
362 %systemd_postun_with_restart ovn-northd.service
363 %else
364 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
365 if [ "$1" -ge "1" ] ; then
366 # Package upgrade, not uninstall
367 /bin/systemctl try-restart ovn-northd.service >/dev/null 2>&1 || :
368 fi
369 %endif
370
371 %postun ovn-host
372 %if 0%{?systemd_postun_with_restart:1}
373 %systemd_postun_with_restart ovn-controller.service
374 %else
375 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
376 if [ "$1" -ge "1" ] ; then
377 # Package upgrade, not uninstall
378 /bin/systemctl try-restart ovn-controller.service >/dev/null 2>&1 || :
379 fi
380 %endif
381
382 %postun ovn-vtep
383 %if 0%{?systemd_postun_with_restart:1}
384 %systemd_postun_with_restart ovn-controller-vtep.service
385 %else
386 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
387 if [ "$1" -ge "1" ] ; then
388 # Package upgrade, not uninstall
389 /bin/systemctl try-restart ovn-controller-vtep.service >/dev/null 2>&1 || :
390 fi
391 %endif
392
393 %postun selinux-policy
394 if [ $1 -eq 0 ] ; then
395 /usr/sbin/semodule -r openvswitch-custom &> /dev/null || :
396 fi
397
398 %files selinux-policy
399 %defattr(-,root,root)
400 %{_datadir}/selinux/packages/%{name}/openvswitch-custom.pp
401
402 %files -n python-openvswitch
403 %{python_sitelib}/ovs
404 %doc COPYING
405
406 %files test
407 %{_bindir}/ovs-test
408 %{_bindir}/ovs-vlan-test
409 %{_bindir}/ovs-l3ping
410 %{_bindir}/ovs-pcap
411 %{_bindir}/ovs-tcpdump
412 %{_bindir}/ovs-tcpundump
413 %{_mandir}/man8/ovs-test.8*
414 %{_mandir}/man8/ovs-vlan-test.8*
415 %{_mandir}/man8/ovs-l3ping.8*
416 %{_mandir}/man1/ovs-pcap.1*
417 %{_mandir}/man8/ovs-tcpdump.8*
418 %{_mandir}/man1/ovs-tcpundump.1*
419 %{python_sitelib}/ovstest
420
421 %files devel
422 %{_libdir}/*.a
423 %{_libdir}/*.la
424 %{_libdir}/pkgconfig/*.pc
425 %{_includedir}/openvswitch/*
426 %{_includedir}/openflow/*
427 %{_includedir}/ovn/*
428
429 %files
430 %defattr(-,root,root)
431 %{_sysconfdir}/bash_completion.d/ovs-appctl-bashcomp.bash
432 %{_sysconfdir}/bash_completion.d/ovs-vsctl-bashcomp.bash
433 %dir %{_sysconfdir}/openvswitch
434 %config %ghost %{_sysconfdir}/openvswitch/conf.db
435 %config %ghost %{_sysconfdir}/openvswitch/system-id.conf
436 %config(noreplace) %{_sysconfdir}/sysconfig/openvswitch
437 %config(noreplace) %{_sysconfdir}/logrotate.d/openvswitch
438 %{_unitdir}/openvswitch.service
439 %{_unitdir}/ovsdb-server.service
440 %{_unitdir}/ovs-vswitchd.service
441 %{_datadir}/openvswitch/scripts/openvswitch.init
442 %{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
443 %{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
444 %{_datadir}/openvswitch/bugtool-plugins/
445 %{_datadir}/openvswitch/scripts/ovs-bugtool-*
446 %{_datadir}/openvswitch/scripts/ovs-check-dead-ifs
447 %{_datadir}/openvswitch/scripts/ovs-lib
448 %{_datadir}/openvswitch/scripts/ovs-save
449 %{_datadir}/openvswitch/scripts/ovs-vtep
450 %{_datadir}/openvswitch/scripts/ovs-ctl
451 %config %{_datadir}/openvswitch/vswitch.ovsschema
452 %config %{_datadir}/openvswitch/vtep.ovsschema
453 %{_bindir}/ovs-appctl
454 %{_bindir}/ovs-docker
455 %{_bindir}/ovs-dpctl
456 %{_bindir}/ovs-dpctl-top
457 %{_bindir}/ovs-ofctl
458 %{_bindir}/ovs-vsctl
459 %{_bindir}/ovsdb-client
460 %{_bindir}/ovsdb-tool
461 %{_bindir}/ovs-testcontroller
462 %{_bindir}/ovs-pki
463 %{_bindir}/vtep-ctl
464 %{_sbindir}/ovs-bugtool
465 %{_sbindir}/ovs-vswitchd
466 %{_sbindir}/ovsdb-server
467 %{_mandir}/man1/ovsdb-client.1*
468 %{_mandir}/man1/ovsdb-server.1*
469 %{_mandir}/man1/ovsdb-tool.1*
470 %{_mandir}/man5/ovs-vswitchd.conf.db.5*
471 %{_mandir}/man5/vtep.5*
472 %{_mandir}/man8/vtep-ctl.8*
473 %{_mandir}/man8/ovs-appctl.8*
474 %{_mandir}/man8/ovs-bugtool.8*
475 %{_mandir}/man8/ovs-ctl.8*
476 %{_mandir}/man8/ovs-dpctl.8*
477 %{_mandir}/man8/ovs-dpctl-top.8*
478 %{_mandir}/man8/ovs-ofctl.8*
479 %{_mandir}/man8/ovs-pki.8*
480 %{_mandir}/man8/ovs-vsctl.8*
481 %{_mandir}/man8/ovs-vswitchd.8*
482 %{_mandir}/man8/ovs-parse-backtrace.8*
483 %{_mandir}/man8/ovs-testcontroller.8*
484 %doc COPYING NOTICE README.rst NEWS rhel/README.RHEL.rst
485 /var/lib/openvswitch
486 /var/log/openvswitch
487 %ghost %attr(755,root,root) %{_rundir}/openvswitch
488
489 %files ovn-docker
490 %{_bindir}/ovn-docker-overlay-driver
491 %{_bindir}/ovn-docker-underlay-driver
492
493 %files ovn-common
494 %{_bindir}/ovn-nbctl
495 %{_bindir}/ovn-sbctl
496 %{_bindir}/ovn-trace
497 %{_datadir}/openvswitch/scripts/ovn-ctl
498 %{_datadir}/openvswitch/scripts/ovndb-servers.ocf
499 %{_datadir}/openvswitch/scripts/ovn-bugtool-nbctl-show
500 %{_datadir}/openvswitch/scripts/ovn-bugtool-sbctl-lflow-list
501 %{_datadir}/openvswitch/scripts/ovn-bugtool-sbctl-show
502 %{_mandir}/man8/ovn-ctl.8*
503 %{_mandir}/man8/ovn-nbctl.8*
504 %{_mandir}/man8/ovn-trace.8*
505 %{_mandir}/man7/ovn-architecture.7*
506 %{_mandir}/man8/ovn-sbctl.8*
507 %{_mandir}/man5/ovn-nb.5*
508 %{_mandir}/man5/ovn-sb.5*
509
510 %files ovn-central
511 %{_bindir}/ovn-northd
512 %{_mandir}/man8/ovn-northd.8*
513 %config %{_datadir}/openvswitch/ovn-nb.ovsschema
514 %config %{_datadir}/openvswitch/ovn-sb.ovsschema
515 %{_unitdir}/ovn-northd.service
516
517 %files ovn-host
518 %{_bindir}/ovn-controller
519 %{_mandir}/man8/ovn-controller.8*
520 %{_unitdir}/ovn-controller.service
521
522 %files ovn-vtep
523 %{_bindir}/ovn-controller-vtep
524 %{_mandir}/man8/ovn-controller-vtep.8*
525 %{_unitdir}/ovn-controller-vtep.service
526
527 %changelog
528 * Wed Jan 12 2011 Ralf Spenneberg <ralf@os-s.net>
529 - First build on F14