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