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