]>
Commit | Line | Data |
---|---|---|
d8fe0a6a RS |
1 | # Spec file for Open vSwitch. |
2 | ||
e7529141 | 3 | # Copyright (C) 2009, 2010, 2013, 2014, 2015, 2016 Nicira Networks, Inc. |
d8fe0a6a RS |
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. | |
329cf232 GS |
9 | # |
10 | # If tests have to be skipped while building, specify the '--without check' | |
11 | # option. For example: | |
8ef22bb1 LR |
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. | |
d8fe0a6a RS |
23 | |
24 | #%define kernel 2.6.40.4-5.fc15.x86_64 | |
25 | ||
2ff63ae0 FL |
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 | |
eea0cdb5 PM |
29 | # To enable DPDK support, specify '--with dpdk' when building |
30 | %bcond_with dpdk | |
db8dcbaf LM |
31 | # Enable Python 3 by specifying '--with build_python3'. |
32 | # This is enabled by default for versions of the distribution that | |
33 | # have Python 3 by default (Fedora > 22). | |
34 | %bcond_with build_python3 | |
2ff63ae0 | 35 | |
da11d088 FL |
36 | # Enable PIE, bz#955181 |
37 | %global _hardened_build 1 | |
38 | ||
b4366682 FL |
39 | # some distros (e.g: RHEL-7) don't define _rundir macro yet |
40 | # Fedora 15 onwards uses /run as _rundir | |
41 | %if 0%{!?_rundir:1} | |
42 | %define _rundir /run | |
43 | %endif | |
44 | ||
db8dcbaf LM |
45 | # define the python package prefix based on distribution version so that we can |
46 | # simultaneously support RHEL-based and later Fedora versions in this spec file. | |
47 | %if 0%{?fedora} >= 25 | |
48 | %define _py2 python2 | |
49 | %endif | |
50 | ||
51 | %if 0%{?rhel} || 0%{?fedora} < 25 | |
52 | %define _py2 python | |
53 | %endif | |
54 | ||
55 | ||
d8fe0a6a RS |
56 | Name: openvswitch |
57 | Summary: Open vSwitch | |
58 | Group: System Environment/Daemons | |
59 | URL: http://www.openvswitch.org/ | |
60 | Version: @VERSION@ | |
61 | ||
362d45b7 FL |
62 | # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the |
63 | # lib/sflow*.[ch] files are SISSL | |
64 | # datapath/ is GPLv2 (although not built into any of the binary packages) | |
362d45b7 | 65 | License: ASL 2.0 and LGPLv2+ and SISSL |
d8fe0a6a | 66 | Release: 1%{?dist} |
d09dbe62 | 67 | Source: http://openvswitch.org/releases/%{name}-%{version}.tar.gz |
d8fe0a6a | 68 | |
fc38b9e2 | 69 | BuildRequires: gcc gcc-c++ |
d2ed89bc | 70 | BuildRequires: autoconf automake libtool |
21ea8738 | 71 | BuildRequires: systemd-units openssl openssl-devel |
db8dcbaf LM |
72 | BuildRequires: %{_py2}-devel |
73 | %if 0%{?fedora} > 22 || %{with build_python3} | |
bb1a7ca2 | 74 | BuildRequires: python3-devel |
db8dcbaf | 75 | %endif |
21ea8738 FL |
76 | BuildRequires: desktop-file-utils |
77 | BuildRequires: groff graphviz | |
9b897c91 | 78 | BuildRequires: checkpolicy, selinux-policy-devel |
fa90cc39 | 79 | BuildRequires: %{_py2}-sphinx |
3b4099b4 | 80 | # make check dependencies |
db8dcbaf | 81 | BuildRequires: %{_py2}-twisted%{?rhel:-core} %{_py2}-zope-interface %{_py2}-six |
3b4099b4 | 82 | BuildRequires: procps-ng |
2ff63ae0 FL |
83 | %if %{with libcapng} |
84 | BuildRequires: libcap-ng libcap-ng-devel | |
85 | %endif | |
eea0cdb5 | 86 | %if %{with dpdk} |
e6932e5d | 87 | BuildRequires: libpcap-devel numactl-devel |
f3e7ec25 | 88 | BuildRequires: dpdk-devel >= 17.05.1 |
eea0cdb5 PM |
89 | Provides: %{name}-dpdk = %{version}-%{release} |
90 | %endif | |
771680d9 | 91 | BuildRequires: unbound unbound-devel |
21ea8738 | 92 | |
771680d9 | 93 | Requires: openssl hostname iproute module-init-tools unbound |
ab725f42 | 94 | #Upstream kernel commit 4f647e0a3c37b8d5086214128614a136064110c3 |
c1ddf091 | 95 | #Requires: kernel >= 3.15.0-0 |
ab725f42 | 96 | |
f624bf23 | 97 | Requires(pre): shadow-utils |
108bcd6a | 98 | Requires(post): /bin/sed |
b33c6dca | 99 | Requires(post): systemd-units |
d8fe0a6a RS |
100 | Requires(preun): systemd-units |
101 | Requires(postun): systemd-units | |
f1b476c3 | 102 | Obsoletes: openvswitch-controller <= 0:2.1.0-1 |
d8fe0a6a | 103 | |
db8dcbaf | 104 | # to skip running checks, pass --without check |
329cf232 | 105 | %bcond_without check |
8ef22bb1 | 106 | %bcond_with check_datapath_kernel |
329cf232 | 107 | |
d8fe0a6a | 108 | %description |
6fcc7a7a | 109 | Open vSwitch provides standard network bridging functions and |
d8fe0a6a RS |
110 | support for the OpenFlow protocol for remote per-flow control of |
111 | traffic. | |
112 | ||
9b897c91 AA |
113 | %package selinux-policy |
114 | Summary: Open vSwitch SELinux policy | |
115 | License: ASL 2.0 | |
116 | BuildArch: noarch | |
117 | Requires: selinux-policy-targeted | |
118 | ||
119 | %description selinux-policy | |
120 | Tailored Open vSwitch SELinux policy | |
121 | ||
db8dcbaf | 122 | %package -n %{_py2}-openvswitch |
bb1a7ca2 | 123 | Summary: Open vSwitch python2 bindings |
9136f9bd FL |
124 | License: ASL 2.0 |
125 | BuildArch: noarch | |
db8dcbaf LM |
126 | Requires: %{_py2} |
127 | Requires: %{_py2}-six | |
128 | %{?python_provide:%python_provide python2-openvswitch = %{version}-%{release}} | |
129 | %description -n %{_py2}-openvswitch | |
bb1a7ca2 TR |
130 | Python bindings for the Open vSwitch database |
131 | ||
db8dcbaf | 132 | %if 0%{?fedora} > 22 || %{with build_python3} |
bb1a7ca2 TR |
133 | %package -n python3-openvswitch |
134 | Summary: Open vSwitch python3 bindings | |
135 | License: ASL 2.0 | |
136 | BuildArch: noarch | |
137 | Requires: python3 | |
138 | Requires: python3-six | |
db8dcbaf | 139 | %{?python_provide:%python_provide python3-openvswitch = %{version}-%{release}} |
bb1a7ca2 TR |
140 | |
141 | %description -n python3-openvswitch | |
9136f9bd | 142 | Python bindings for the Open vSwitch database |
db8dcbaf | 143 | %endif |
9136f9bd | 144 | |
f305420a FL |
145 | %package test |
146 | Summary: Open vSwitch testing utilities | |
147 | License: ASL 2.0 | |
148 | BuildArch: noarch | |
db8dcbaf | 149 | Requires: %{_py2}-openvswitch = %{version}-%{release} |
8e89f48b | 150 | Requires: %{_py2} %{_py2}-netifaces %{_py2}-twisted |
f305420a FL |
151 | |
152 | %description test | |
153 | Utilities that are useful to diagnose performance and connectivity | |
154 | issues in Open vSwitch setup. | |
155 | ||
3519fa08 FL |
156 | %package devel |
157 | Summary: Open vSwitch OpenFlow development package (library, headers) | |
158 | License: ASL 2.0 | |
159 | Provides: openvswitch-static = %{version}-%{release} | |
160 | ||
161 | %description devel | |
162 | This provides static library, libopenswitch.a and the openvswitch header | |
163 | files needed to build an external application. | |
164 | ||
fa72c536 TR |
165 | %if 0%{?rhel} > 7 || 0%{?fedora} > 28 |
166 | %package -n network-scripts-%{name} | |
167 | Summary: Open vSwitch legacy network service support | |
168 | License: ASL 2.0 | |
169 | Requires: network-scripts | |
170 | Supplements: (%{name} and network-scripts) | |
171 | ||
172 | %description -n network-scripts-%{name} | |
173 | This provides the ifup and ifdown scripts for use with the legacy network | |
174 | service. | |
175 | %endif | |
176 | ||
0e12c2a4 | 177 | %package ovn-central |
c05ea879 RB |
178 | Summary: Open vSwitch - Open Virtual Network support |
179 | License: ASL 2.0 | |
0e12c2a4 | 180 | Requires: openvswitch openvswitch-ovn-common |
55f36be5 | 181 | Requires: firewalld-filesystem |
c05ea879 | 182 | |
0e12c2a4 | 183 | %description ovn-central |
c05ea879 RB |
184 | OVN, the Open Virtual Network, is a system to support virtual network |
185 | abstraction. OVN complements the existing capabilities of OVS to add | |
186 | native support for virtual network abstractions, such as virtual L2 and L3 | |
187 | overlays and security groups. | |
188 | ||
0e12c2a4 BS |
189 | %package ovn-host |
190 | Summary: Open vSwitch - Open Virtual Network support | |
191 | License: ASL 2.0 | |
192 | Requires: openvswitch openvswitch-ovn-common | |
55f36be5 | 193 | Requires: firewalld-filesystem |
0e12c2a4 BS |
194 | |
195 | %description ovn-host | |
196 | OVN, the Open Virtual Network, is a system to support virtual network | |
197 | abstraction. OVN complements the existing capabilities of OVS to add | |
198 | native support for virtual network abstractions, such as virtual L2 and L3 | |
199 | overlays and security groups. | |
200 | ||
201 | %package ovn-vtep | |
202 | Summary: Open vSwitch - Open Virtual Network support | |
203 | License: ASL 2.0 | |
204 | Requires: openvswitch openvswitch-ovn-common | |
205 | ||
206 | %description ovn-vtep | |
207 | OVN vtep controller | |
208 | ||
209 | %package ovn-common | |
210 | Summary: Open vSwitch - Open Virtual Network support | |
211 | License: ASL 2.0 | |
212 | Requires: openvswitch | |
213 | ||
214 | %description ovn-common | |
215 | Utilities that are use to diagnose and manage the OVN components. | |
216 | ||
217 | %package ovn-docker | |
218 | Summary: Open vSwitch - Open Virtual Network support | |
219 | License: ASL 2.0 | |
db8dcbaf | 220 | Requires: openvswitch openvswitch-ovn-common %{_py2}-openvswitch |
0e12c2a4 BS |
221 | |
222 | %description ovn-docker | |
223 | Docker network plugins for OVN. | |
3519fa08 | 224 | |
51639025 | 225 | %package ipsec |
bdddc715 QX |
226 | Summary: Open vSwitch IPsec tunneling support |
227 | License: ASL 2.0 | |
228 | Requires: openvswitch %{_py2}-openvswitch libreswan | |
229 | ||
51639025 | 230 | %description ipsec |
bdddc715 QX |
231 | This package provides IPsec tunneling support for OVS tunnels. |
232 | ||
d8fe0a6a | 233 | %prep |
c1aadf4a | 234 | %setup -q |
d8fe0a6a RS |
235 | |
236 | %build | |
2ff63ae0 FL |
237 | %configure \ |
238 | %if %{with libcapng} | |
5a0e4aec | 239 | --enable-libcapng \ |
2ff63ae0 | 240 | %else |
5a0e4aec | 241 | --disable-libcapng \ |
eea0cdb5 PM |
242 | %endif |
243 | %if %{with dpdk} | |
5a0e4aec | 244 | --with-dpdk=$(dirname %{_datadir}/dpdk/*/.config) \ |
2ff63ae0 | 245 | %endif |
5a0e4aec | 246 | --enable-ssl \ |
bc4fd439 | 247 | --enable-shared \ |
5a0e4aec | 248 | --with-pkidir=%{_sharedstatedir}/openvswitch/pki \ |
72e6cd99 | 249 | %if 0%{?fedora} > 22 || %{with build_python3} |
5a0e4aec BP |
250 | PYTHON3=%{__python3} \ |
251 | PYTHON=%{__python2} | |
72e6cd99 | 252 | %else |
5a0e4aec | 253 | PYTHON=%{__python} |
72e6cd99 | 254 | %endif |
2ff63ae0 | 255 | |
dd6f26a9 | 256 | build-aux/dpdkstrip.py \ |
491a9d3b | 257 | %if %{with dpdk} |
5a0e4aec | 258 | --dpdk \ |
491a9d3b | 259 | %else |
5a0e4aec | 260 | --nodpdk \ |
491a9d3b | 261 | %endif |
5a0e4aec BP |
262 | < rhel/usr_lib_systemd_system_ovs-vswitchd.service.in \ |
263 | > rhel/usr_lib_systemd_system_ovs-vswitchd.service | |
491a9d3b | 264 | |
6238c95d | 265 | make %{?_smp_mflags} |
ee29e9fe | 266 | make selinux-policy |
d8fe0a6a RS |
267 | |
268 | %install | |
269 | rm -rf $RPM_BUILD_ROOT | |
270 | make install DESTDIR=$RPM_BUILD_ROOT | |
95ca408c | 271 | |
2f4f43bf | 272 | install -d -m 0755 $RPM_BUILD_ROOT%{_rundir}/openvswitch |
03736a67 | 273 | install -d -m 0750 $RPM_BUILD_ROOT%{_localstatedir}/log/openvswitch |
1c9564eb | 274 | install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch |
95ca408c | 275 | |
ea5dbd79 | 276 | %if %{with dpdk} |
277 | install -p -D -m 0644 rhel/usr_lib_udev_rules.d_91-vfio.rules \ | |
278 | $RPM_BUILD_ROOT%{_prefix}/lib/udev/rules.d/91-vfio.rules | |
279 | %endif | |
280 | ||
c846a5b2 FL |
281 | install -p -D -m 0644 \ |
282 | rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \ | |
283 | $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/openvswitch | |
a694ead1 | 284 | for service in openvswitch ovsdb-server ovs-vswitchd ovs-delete-transient-ports \ |
bdddc715 QX |
285 | ovn-controller ovn-controller-vtep ovn-northd \ |
286 | openvswitch-ipsec; do | |
5a0e4aec BP |
287 | install -p -D -m 0644 \ |
288 | rhel/usr_lib_systemd_system_${service}.service \ | |
289 | $RPM_BUILD_ROOT%{_unitdir}/${service}.service | |
c05ea879 | 290 | done |
fa0be8a4 | 291 | install -m 0755 rhel/etc_init.d_openvswitch \ |
d8fe0a6a | 292 | $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init |
95ca408c | 293 | |
92d53574 | 294 | install -p -D -m 0644 rhel/etc_openvswitch_default.conf \ |
295 | $RPM_BUILD_ROOT/%{_sysconfdir}/openvswitch/default.conf | |
296 | ||
3d1d098c | 297 | install -p -D -m 0644 rhel/etc_logrotate.d_openvswitch \ |
4f98e02e | 298 | $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/openvswitch |
95ca408c | 299 | |
fa0be8a4 | 300 | install -m 0644 vswitchd/vswitch.ovsschema \ |
4f98e02e | 301 | $RPM_BUILD_ROOT/%{_datadir}/openvswitch/vswitch.ovsschema |
95ca408c | 302 | |
4f98e02e | 303 | install -d -m 0755 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ |
d8fe0a6a | 304 | install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \ |
4f98e02e | 305 | $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs |
d8fe0a6a | 306 | install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \ |
4f98e02e | 307 | $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs |
95ca408c | 308 | |
bb1a7ca2 | 309 | install -d -m 0755 $RPM_BUILD_ROOT%{python2_sitelib} |
bb1a7ca2 TR |
310 | cp -a $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/* \ |
311 | $RPM_BUILD_ROOT%{python2_sitelib} | |
db8dcbaf LM |
312 | |
313 | %if 0%{?fedora} > 22 || %{with build_python3} | |
314 | install -d -m 0755 $RPM_BUILD_ROOT%{python3_sitelib} | |
bb1a7ca2 TR |
315 | cp -a $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/ovs \ |
316 | $RPM_BUILD_ROOT%{python3_sitelib} | |
db8dcbaf LM |
317 | %endif |
318 | ||
bb1a7ca2 | 319 | rm -rf $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/ |
d8fe0a6a | 320 | |
fa0be8a4 | 321 | install -d -m 0755 $RPM_BUILD_ROOT/%{_sharedstatedir}/openvswitch |
d8fe0a6a | 322 | |
1c9564eb | 323 | touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/conf.db |
c1c7480b | 324 | touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/.conf.db.~lock~ |
1c9564eb FL |
325 | touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/system-id.conf |
326 | ||
9b897c91 AA |
327 | install -p -m 644 -D selinux/openvswitch-custom.pp \ |
328 | $RPM_BUILD_ROOT%{_datadir}/selinux/packages/%{name}/openvswitch-custom.pp | |
329 | ||
d5c2862a | 330 | install -d $RPM_BUILD_ROOT%{_prefix}/lib/firewalld/services/ |
4a546141 | 331 | install -p -m 0644 rhel/usr_lib_firewalld_services_ovn-central-firewall-service.xml \ |
55f36be5 | 332 | $RPM_BUILD_ROOT%{_prefix}/lib/firewalld/services/ovn-central-firewall-service.xml |
4a546141 | 333 | install -p -m 0644 rhel/usr_lib_firewalld_services_ovn-host-firewall-service.xml \ |
55f36be5 MM |
334 | $RPM_BUILD_ROOT%{_prefix}/lib/firewalld/services/ovn-host-firewall-service.xml |
335 | ||
f1ea8916 TR |
336 | install -d -m 0755 $RPM_BUILD_ROOT%{_prefix}/lib/ocf/resource.d/ovn |
337 | ln -s %{_datadir}/openvswitch/scripts/ovndb-servers.ocf \ | |
338 | $RPM_BUILD_ROOT%{_prefix}/lib/ocf/resource.d/ovn/ovndb-servers | |
339 | ||
ea36b046 TR |
340 | install -p -D -m 0755 \ |
341 | rhel/usr_share_openvswitch_scripts_ovs-systemd-reload \ | |
342 | $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/ovs-systemd-reload | |
343 | ||
1247b5a7 | 344 | # remove unpackaged files |
e7529141 | 345 | rm -f $RPM_BUILD_ROOT%{_bindir}/ovs-parse-backtrace \ |
1247b5a7 | 346 | $RPM_BUILD_ROOT%{_sbindir}/ovs-vlan-bug-workaround \ |
50e6c26f | 347 | $RPM_BUILD_ROOT%{_mandir}/man8/ovs-vlan-bug-workaround.8 |
1247b5a7 | 348 | |
329cf232 GS |
349 | %check |
350 | %if %{with check} | |
0d3f2152 | 351 | if make check TESTSUITEFLAGS='%{_smp_mflags}' RECHECK=yes; then :; |
329cf232 GS |
352 | else |
353 | cat tests/testsuite.log | |
354 | exit 1 | |
355 | fi | |
356 | %endif | |
8ef22bb1 LR |
357 | %if %{with check_datapath_kernel} |
358 | if make check-kernel RECHECK=yes; then :; | |
359 | else | |
360 | cat tests/system-kmod-testsuite.log | |
361 | exit 1 | |
362 | fi | |
363 | %endif | |
329cf232 | 364 | |
d8fe0a6a RS |
365 | %clean |
366 | rm -rf $RPM_BUILD_ROOT | |
367 | ||
21aade70 AC |
368 | %pre selinux-policy |
369 | %selinux_relabel_pre -s targeted | |
370 | ||
d8fe0a6a | 371 | %preun |
0447019d FL |
372 | %if 0%{?systemd_preun:1} |
373 | %systemd_preun %{name}.service | |
374 | %else | |
375 | if [ $1 -eq 0 ] ; then | |
0e12c2a4 | 376 | # Package removal, not upgrade |
0447019d FL |
377 | /bin/systemctl --no-reload disable %{name}.service >/dev/null 2>&1 || : |
378 | /bin/systemctl stop %{name}.service >/dev/null 2>&1 || : | |
379 | fi | |
380 | %endif | |
381 | ||
0e12c2a4 | 382 | %preun ovn-central |
c05ea879 | 383 | %if 0%{?systemd_preun:1} |
c05ea879 RB |
384 | %systemd_preun ovn-northd.service |
385 | %else | |
386 | if [ $1 -eq 0 ] ; then | |
0e12c2a4 BS |
387 | # Package removal, not upgrade |
388 | /bin/systemctl --no-reload disable ovn-northd.service >/dev/null 2>&1 || : | |
389 | /bin/systemctl stop ovn-northd.service >/dev/null 2>&1 || : | |
390 | fi | |
391 | %endif | |
392 | ||
393 | %preun ovn-host | |
394 | %if 0%{?systemd_preun:1} | |
395 | %systemd_preun ovn-controller.service | |
396 | %else | |
397 | if [ $1 -eq 0 ] ; then | |
398 | # Package removal, not upgrade | |
c05ea879 RB |
399 | /bin/systemctl --no-reload disable ovn-controller.service >/dev/null 2>&1 || : |
400 | /bin/systemctl stop ovn-controller.service >/dev/null 2>&1 || : | |
0e12c2a4 BS |
401 | fi |
402 | %endif | |
403 | ||
404 | %preun ovn-vtep | |
405 | %if 0%{?systemd_preun:1} | |
406 | %systemd_preun ovn-controller-vtep.service | |
407 | %else | |
408 | if [ $1 -eq 0 ] ; then | |
409 | # Package removal, not upgrade | |
ab4d55dc RB |
410 | /bin/systemctl --no-reload disable ovn-controller-vtep.service >/dev/null 2>&1 || : |
411 | /bin/systemctl stop ovn-controller-vtep.service >/dev/null 2>&1 || : | |
c05ea879 RB |
412 | fi |
413 | %endif | |
d8fe0a6a | 414 | |
f624bf23 AP |
415 | %pre |
416 | getent group openvswitch >/dev/null || groupadd -r openvswitch | |
417 | getent passwd openvswitch >/dev/null || \ | |
418 | useradd -r -g openvswitch -d / -s /sbin/nologin \ | |
419 | -c "Open vSwitch Daemons" openvswitch | |
420 | ||
421 | %if %{with dpdk} | |
00b8c48f | 422 | getent group hugetlbfs >/dev/null || groupadd -r hugetlbfs |
f624bf23 AP |
423 | usermod -a -G hugetlbfs openvswitch |
424 | %endif | |
425 | exit 0 | |
426 | ||
d8fe0a6a | 427 | %post |
ac416a3a | 428 | if [ $1 -eq 1 ]; then |
ac416a3a | 429 | sed -i 's:^#OVS_USER_ID=:OVS_USER_ID=:' /etc/sysconfig/openvswitch |
b096fa42 | 430 | sed -i 's:\(.*su\).*:\1 openvswitch openvswitch:' %{_sysconfdir}/logrotate.d/openvswitch |
ac416a3a | 431 | |
e3e738a3 | 432 | %if %{with dpdk} |
e3e738a3 | 433 | sed -i \ |
434 | 's@OVS_USER_ID="openvswitch:openvswitch"@OVS_USER_ID="openvswitch:hugetlbfs"@'\ | |
435 | /etc/sysconfig/openvswitch | |
436 | %endif | |
437 | ||
ac416a3a | 438 | # In the case of upgrade, this is not needed. |
439 | chown -R openvswitch:openvswitch /etc/openvswitch | |
b096fa42 | 440 | chown -R openvswitch:openvswitch /var/log/openvswitch |
ac416a3a | 441 | fi |
442 | ||
0447019d FL |
443 | %if 0%{?systemd_post:1} |
444 | %systemd_post %{name}.service | |
445 | %else | |
446 | # Package install, not upgrade | |
447 | if [ $1 -eq 1 ]; then | |
448 | /bin/systemctl daemon-reload >dev/null || : | |
449 | fi | |
450 | %endif | |
451 | ||
0e12c2a4 BS |
452 | %post ovn-central |
453 | %if 0%{?systemd_post:1} | |
454 | %systemd_post ovn-northd.service | |
455 | %else | |
456 | # Package install, not upgrade | |
457 | if [ $1 -eq 1 ]; then | |
458 | /bin/systemctl daemon-reload >dev/null || : | |
459 | fi | |
460 | %endif | |
461 | ||
462 | %post ovn-host | |
c05ea879 RB |
463 | %if 0%{?systemd_post:1} |
464 | %systemd_post ovn-controller.service | |
0e12c2a4 BS |
465 | %else |
466 | # Package install, not upgrade | |
467 | if [ $1 -eq 1 ]; then | |
468 | /bin/systemctl daemon-reload >dev/null || : | |
469 | fi | |
470 | %endif | |
471 | ||
472 | %post ovn-vtep | |
473 | %if 0%{?systemd_post:1} | |
ab4d55dc | 474 | %systemd_post ovn-controller-vtep.service |
c05ea879 RB |
475 | %else |
476 | # Package install, not upgrade | |
477 | if [ $1 -eq 1 ]; then | |
478 | /bin/systemctl daemon-reload >dev/null || : | |
479 | fi | |
480 | %endif | |
d8fe0a6a | 481 | |
9b897c91 | 482 | %post selinux-policy |
21aade70 | 483 | %selinux_modules_install -s targeted %{_datadir}/selinux/packages/%{name}/openvswitch-custom.pp |
9b897c91 | 484 | |
d8fe0a6a | 485 | %postun |
5771f476 FL |
486 | %if 0%{?systemd_postun:1} |
487 | %systemd_postun %{name}.service | |
0447019d FL |
488 | %else |
489 | /bin/systemctl daemon-reload >/dev/null 2>&1 || : | |
0447019d FL |
490 | %endif |
491 | ||
0e12c2a4 | 492 | %postun ovn-central |
44dd4cc4 LR |
493 | %if 0%{?systemd_postun:1} |
494 | %systemd_postun ovn-northd.service | |
c05ea879 RB |
495 | %else |
496 | /bin/systemctl daemon-reload >/dev/null 2>&1 || : | |
0e12c2a4 BS |
497 | %endif |
498 | ||
499 | %postun ovn-host | |
44dd4cc4 LR |
500 | %if 0%{?systemd_postun:1} |
501 | %systemd_postun ovn-controller.service | |
0e12c2a4 BS |
502 | %else |
503 | /bin/systemctl daemon-reload >/dev/null 2>&1 || : | |
0e12c2a4 BS |
504 | %endif |
505 | ||
506 | %postun ovn-vtep | |
44dd4cc4 LR |
507 | %if 0%{?systemd_postun:1} |
508 | %systemd_postun ovn-controller-vtep.service | |
0e12c2a4 BS |
509 | %else |
510 | /bin/systemctl daemon-reload >/dev/null 2>&1 || : | |
c05ea879 | 511 | %endif |
d8fe0a6a | 512 | |
9b897c91 AA |
513 | %postun selinux-policy |
514 | if [ $1 -eq 0 ] ; then | |
21aade70 | 515 | %selinux_modules_uninstall -s targeted openvswitch-custom |
9b897c91 AA |
516 | fi |
517 | ||
21aade70 AC |
518 | %posttrans selinux-policy |
519 | %selinux_relabel_post -s targeted | |
520 | ||
9b897c91 AA |
521 | %files selinux-policy |
522 | %defattr(-,root,root) | |
523 | %{_datadir}/selinux/packages/%{name}/openvswitch-custom.pp | |
524 | ||
db8dcbaf | 525 | %files -n %{_py2}-openvswitch |
bb1a7ca2 | 526 | %{python2_sitelib}/ovs |
bb1a7ca2 | 527 | |
db8dcbaf | 528 | %if 0%{?fedora} > 22 || %{with build_python3} |
bb1a7ca2 TR |
529 | %files -n python3-openvswitch |
530 | %{python3_sitelib}/ovs | |
db8dcbaf | 531 | %endif |
9136f9bd | 532 | |
f305420a FL |
533 | %files test |
534 | %{_bindir}/ovs-test | |
535 | %{_bindir}/ovs-vlan-test | |
536 | %{_bindir}/ovs-l3ping | |
8647686e AC |
537 | %{_bindir}/ovs-pcap |
538 | %{_bindir}/ovs-tcpdump | |
539 | %{_bindir}/ovs-tcpundump | |
f305420a FL |
540 | %{_mandir}/man8/ovs-test.8* |
541 | %{_mandir}/man8/ovs-vlan-test.8* | |
542 | %{_mandir}/man8/ovs-l3ping.8* | |
8647686e AC |
543 | %{_mandir}/man1/ovs-pcap.1* |
544 | %{_mandir}/man8/ovs-tcpdump.8* | |
545 | %{_mandir}/man1/ovs-tcpundump.1* | |
bb1a7ca2 | 546 | %{python2_sitelib}/ovstest |
f305420a | 547 | |
3519fa08 | 548 | %files devel |
bc4fd439 | 549 | %{_libdir}/lib*.so |
3519fa08 FL |
550 | %{_libdir}/*.a |
551 | %{_libdir}/*.la | |
2fd84d5e | 552 | %{_libdir}/pkgconfig/*.pc |
3519fa08 FL |
553 | %{_includedir}/openvswitch/* |
554 | %{_includedir}/openflow/* | |
13a08aa9 | 555 | %{_includedir}/ovn/* |
3519fa08 | 556 | |
fa72c536 TR |
557 | %if 0%{?rhel} > 7 || 0%{?fedora} > 28 |
558 | %files -n network-scripts-%{name} | |
559 | %{_sysconfdir}/sysconfig/network-scripts/ifup-ovs | |
560 | %{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs | |
561 | %endif | |
562 | ||
d8fe0a6a | 563 | %files |
951d79e6 | 564 | %defattr(-,openvswitch,openvswitch) |
1c9564eb | 565 | %dir %{_sysconfdir}/openvswitch |
92d53574 | 566 | %{_sysconfdir}/openvswitch/default.conf |
1c9564eb | 567 | %config %ghost %{_sysconfdir}/openvswitch/conf.db |
c1c7480b | 568 | %ghost %{_sysconfdir}/openvswitch/.conf.db.~lock~ |
1c9564eb FL |
569 | %config %ghost %{_sysconfdir}/openvswitch/system-id.conf |
570 | %config(noreplace) %{_sysconfdir}/sysconfig/openvswitch | |
951d79e6 TR |
571 | %defattr(-,root,root) |
572 | %{_sysconfdir}/bash_completion.d/ovs-appctl-bashcomp.bash | |
573 | %{_sysconfdir}/bash_completion.d/ovs-vsctl-bashcomp.bash | |
a7321a1f | 574 | %config(noreplace) %{_sysconfdir}/logrotate.d/openvswitch |
d8fe0a6a | 575 | %{_unitdir}/openvswitch.service |
4f621873 | 576 | %{_unitdir}/ovsdb-server.service |
84ad1208 | 577 | %{_unitdir}/ovs-vswitchd.service |
a694ead1 | 578 | %{_unitdir}/ovs-delete-transient-ports.service |
d8fe0a6a | 579 | %{_datadir}/openvswitch/scripts/openvswitch.init |
fa72c536 | 580 | %if ! (0%{?rhel} > 7 || 0%{?fedora} > 28) |
d8fe0a6a RS |
581 | %{_sysconfdir}/sysconfig/network-scripts/ifup-ovs |
582 | %{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs | |
fa72c536 | 583 | %endif |
aa6ccca5 FL |
584 | %{_datadir}/openvswitch/bugtool-plugins/ |
585 | %{_datadir}/openvswitch/scripts/ovs-bugtool-* | |
586 | %{_datadir}/openvswitch/scripts/ovs-check-dead-ifs | |
587 | %{_datadir}/openvswitch/scripts/ovs-lib | |
50e6c26f | 588 | %{_datadir}/openvswitch/scripts/ovs-save |
aa6ccca5 FL |
589 | %{_datadir}/openvswitch/scripts/ovs-vtep |
590 | %{_datadir}/openvswitch/scripts/ovs-ctl | |
15117123 | 591 | %{_datadir}/openvswitch/scripts/ovs-kmod-ctl |
ea36b046 | 592 | %{_datadir}/openvswitch/scripts/ovs-systemd-reload |
aa6ccca5 FL |
593 | %config %{_datadir}/openvswitch/vswitch.ovsschema |
594 | %config %{_datadir}/openvswitch/vtep.ovsschema | |
5b88626a FL |
595 | %{_bindir}/ovs-appctl |
596 | %{_bindir}/ovs-docker | |
597 | %{_bindir}/ovs-dpctl | |
598 | %{_bindir}/ovs-dpctl-top | |
599 | %{_bindir}/ovs-ofctl | |
600 | %{_bindir}/ovs-vsctl | |
601 | %{_bindir}/ovsdb-client | |
602 | %{_bindir}/ovsdb-tool | |
603 | %{_bindir}/ovs-testcontroller | |
604 | %{_bindir}/ovs-pki | |
605 | %{_bindir}/vtep-ctl | |
bc4fd439 | 606 | %{_libdir}/lib*.so.* |
f616ba3e FL |
607 | %{_sbindir}/ovs-bugtool |
608 | %{_sbindir}/ovs-vswitchd | |
609 | %{_sbindir}/ovsdb-server | |
a2f24d79 FL |
610 | %{_mandir}/man1/ovsdb-client.1* |
611 | %{_mandir}/man1/ovsdb-server.1* | |
612 | %{_mandir}/man1/ovsdb-tool.1* | |
6bb9b060 | 613 | %{_mandir}/man5/ovsdb-server.5* |
a2f24d79 | 614 | %{_mandir}/man5/ovs-vswitchd.conf.db.5* |
bfaf6352 | 615 | %{_mandir}/man5/ovsdb.5* |
a2f24d79 | 616 | %{_mandir}/man5/vtep.5* |
b81dc9a3 | 617 | %{_mandir}/man7/ovs-fields.7* |
bfaf6352 TR |
618 | %{_mandir}/man7/ovsdb.7* |
619 | %{_mandir}/man7/ovsdb-server.7* | |
a2f24d79 FL |
620 | %{_mandir}/man8/vtep-ctl.8* |
621 | %{_mandir}/man8/ovs-appctl.8* | |
622 | %{_mandir}/man8/ovs-bugtool.8* | |
623 | %{_mandir}/man8/ovs-ctl.8* | |
624 | %{_mandir}/man8/ovs-dpctl.8* | |
625 | %{_mandir}/man8/ovs-dpctl-top.8* | |
15117123 | 626 | %{_mandir}/man8/ovs-kmod-ctl.8* |
a2f24d79 FL |
627 | %{_mandir}/man8/ovs-ofctl.8* |
628 | %{_mandir}/man8/ovs-pki.8* | |
629 | %{_mandir}/man8/ovs-vsctl.8* | |
630 | %{_mandir}/man8/ovs-vswitchd.8* | |
631 | %{_mandir}/man8/ovs-parse-backtrace.8* | |
632 | %{_mandir}/man8/ovs-testcontroller.8* | |
ea5dbd79 | 633 | %if %{with dpdk} |
634 | %{_prefix}/lib/udev/rules.d/91-vfio.rules | |
635 | %endif | |
888cf44d | 636 | %doc NOTICE README.rst NEWS rhel/README.RHEL.rst |
d8fe0a6a | 637 | /var/lib/openvswitch |
b096fa42 | 638 | %attr(750,root,root) /var/log/openvswitch |
51542edd | 639 | %ghost %attr(755,root,root) %{_rundir}/openvswitch |
d8fe0a6a | 640 | |
0e12c2a4 | 641 | %files ovn-docker |
eaa923e3 GS |
642 | %{_bindir}/ovn-docker-overlay-driver |
643 | %{_bindir}/ovn-docker-underlay-driver | |
0e12c2a4 BS |
644 | |
645 | %files ovn-common | |
c05ea879 | 646 | %{_bindir}/ovn-nbctl |
600a8085 | 647 | %{_bindir}/ovn-sbctl |
f448e5a4 | 648 | %{_bindir}/ovn-trace |
3547a8c1 | 649 | %{_bindir}/ovn-detrace |
c05ea879 | 650 | %{_datadir}/openvswitch/scripts/ovn-ctl |
a4245b78 | 651 | %{_datadir}/openvswitch/scripts/ovndb-servers.ocf |
cfc6963c FL |
652 | %{_datadir}/openvswitch/scripts/ovn-bugtool-nbctl-show |
653 | %{_datadir}/openvswitch/scripts/ovn-bugtool-sbctl-lflow-list | |
654 | %{_datadir}/openvswitch/scripts/ovn-bugtool-sbctl-show | |
c05ea879 RB |
655 | %{_mandir}/man8/ovn-ctl.8* |
656 | %{_mandir}/man8/ovn-nbctl.8* | |
f448e5a4 | 657 | %{_mandir}/man8/ovn-trace.8* |
3547a8c1 | 658 | %{_mandir}/man1/ovn-detrace.1* |
0e12c2a4 | 659 | %{_mandir}/man7/ovn-architecture.7* |
600a8085 | 660 | %{_mandir}/man8/ovn-sbctl.8* |
0e12c2a4 BS |
661 | %{_mandir}/man5/ovn-nb.5* |
662 | %{_mandir}/man5/ovn-sb.5* | |
f1ea8916 | 663 | %{_prefix}/lib/ocf/resource.d/ovn/ovndb-servers |
0e12c2a4 BS |
664 | |
665 | %files ovn-central | |
666 | %{_bindir}/ovn-northd | |
667 | %{_mandir}/man8/ovn-northd.8* | |
c05ea879 RB |
668 | %config %{_datadir}/openvswitch/ovn-nb.ovsschema |
669 | %config %{_datadir}/openvswitch/ovn-sb.ovsschema | |
0e12c2a4 | 670 | %{_unitdir}/ovn-northd.service |
d5c2862a | 671 | %{_prefix}/lib/firewalld/services/ovn-central-firewall-service.xml |
0e12c2a4 BS |
672 | |
673 | %files ovn-host | |
674 | %{_bindir}/ovn-controller | |
675 | %{_mandir}/man8/ovn-controller.8* | |
c05ea879 | 676 | %{_unitdir}/ovn-controller.service |
d5c2862a | 677 | %{_prefix}/lib/firewalld/services/ovn-host-firewall-service.xml |
0e12c2a4 BS |
678 | |
679 | %files ovn-vtep | |
680 | %{_bindir}/ovn-controller-vtep | |
681 | %{_mandir}/man8/ovn-controller-vtep.8* | |
ab4d55dc | 682 | %{_unitdir}/ovn-controller-vtep.service |
c05ea879 | 683 | |
51639025 | 684 | %files ipsec |
bdddc715 QX |
685 | %{_datadir}/openvswitch/scripts/ovs-monitor-ipsec |
686 | %{_unitdir}/openvswitch-ipsec.service | |
687 | ||
d8fe0a6a RS |
688 | %changelog |
689 | * Wed Jan 12 2011 Ralf Spenneberg <ralf@os-s.net> | |
690 | - First build on F14 |