]>
Commit | Line | Data |
---|---|---|
d8fe0a6a RS |
1 | # Spec file for Open vSwitch. |
2 | ||
c260f4e2 | 3 | # Copyright (C) 2009, 2010, 2013, 2014 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: | |
12 | # rpmbuild -bb --without check rhel/openvswitch-fedora.spec | |
d8fe0a6a RS |
13 | |
14 | #%define kernel 2.6.40.4-5.fc15.x86_64 | |
15 | ||
da11d088 FL |
16 | # Enable PIE, bz#955181 |
17 | %global _hardened_build 1 | |
18 | ||
d8fe0a6a RS |
19 | Name: openvswitch |
20 | Summary: Open vSwitch | |
21 | Group: System Environment/Daemons | |
22 | URL: http://www.openvswitch.org/ | |
23 | Version: @VERSION@ | |
24 | ||
362d45b7 FL |
25 | # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the |
26 | # lib/sflow*.[ch] files are SISSL | |
27 | # datapath/ is GPLv2 (although not built into any of the binary packages) | |
28 | # python/compat is Python (although not built into any of the binary packages) | |
29 | License: ASL 2.0 and LGPLv2+ and SISSL | |
d8fe0a6a | 30 | Release: 1%{?dist} |
d09dbe62 | 31 | Source: http://openvswitch.org/releases/%{name}-%{version}.tar.gz |
d8fe0a6a | 32 | |
21ea8738 FL |
33 | BuildRequires: autoconf |
34 | BuildRequires: systemd-units openssl openssl-devel | |
35 | BuildRequires: python python-twisted-core python-zope-interface PyQt4 | |
36 | BuildRequires: desktop-file-utils | |
37 | BuildRequires: groff graphviz | |
38 | ||
ab725f42 FL |
39 | Requires: openssl iproute module-init-tools |
40 | #Upstream kernel commit 4f647e0a3c37b8d5086214128614a136064110c3 | |
41 | Requires: kernel >= 3.15.0-0 | |
42 | ||
b33c6dca | 43 | Requires(post): systemd-units |
d8fe0a6a RS |
44 | Requires(preun): systemd-units |
45 | Requires(postun): systemd-units | |
f1b476c3 | 46 | Obsoletes: openvswitch-controller <= 0:2.1.0-1 |
d8fe0a6a | 47 | |
329cf232 GS |
48 | %bcond_without check |
49 | ||
d8fe0a6a | 50 | %description |
6fcc7a7a | 51 | Open vSwitch provides standard network bridging functions and |
d8fe0a6a RS |
52 | support for the OpenFlow protocol for remote per-flow control of |
53 | traffic. | |
54 | ||
9136f9bd FL |
55 | %package -n python-openvswitch |
56 | Summary: Open vSwitch python bindings | |
57 | License: ASL 2.0 | |
58 | BuildArch: noarch | |
59 | Requires: python | |
60 | ||
61 | %description -n python-openvswitch | |
62 | Python bindings for the Open vSwitch database | |
63 | ||
f305420a FL |
64 | %package test |
65 | Summary: Open vSwitch testing utilities | |
66 | License: ASL 2.0 | |
67 | BuildArch: noarch | |
68 | Requires: python-openvswitch = %{version}-%{release} | |
69 | Requires: python python-twisted-core python-twisted-web | |
70 | ||
71 | %description test | |
72 | Utilities that are useful to diagnose performance and connectivity | |
73 | issues in Open vSwitch setup. | |
74 | ||
3519fa08 FL |
75 | %package devel |
76 | Summary: Open vSwitch OpenFlow development package (library, headers) | |
77 | License: ASL 2.0 | |
78 | Provides: openvswitch-static = %{version}-%{release} | |
79 | ||
80 | %description devel | |
81 | This provides static library, libopenswitch.a and the openvswitch header | |
82 | files needed to build an external application. | |
83 | ||
84 | ||
d8fe0a6a | 85 | %prep |
c1aadf4a | 86 | %setup -q |
d8fe0a6a RS |
87 | |
88 | %build | |
8c00d88b | 89 | %configure --enable-ssl --with-pkidir=%{_sharedstatedir}/openvswitch/pki |
6238c95d | 90 | make %{?_smp_mflags} |
d8fe0a6a RS |
91 | |
92 | %install | |
93 | rm -rf $RPM_BUILD_ROOT | |
94 | make install DESTDIR=$RPM_BUILD_ROOT | |
95ca408c | 95 | |
1c9564eb | 96 | install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch |
95ca408c | 97 | |
c846a5b2 FL |
98 | install -p -D -m 0644 \ |
99 | rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \ | |
100 | $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/openvswitch | |
3224d948 FL |
101 | install -p -D -m 0644 \ |
102 | rhel/usr_lib_systemd_system_openvswitch.service \ | |
d8fe0a6a | 103 | $RPM_BUILD_ROOT%{_unitdir}/openvswitch.service |
3224d948 FL |
104 | install -p -D -m 0644 \ |
105 | rhel/usr_lib_systemd_system_openvswitch-nonetwork.service \ | |
b49c106e | 106 | $RPM_BUILD_ROOT%{_unitdir}/openvswitch-nonetwork.service |
95ca408c | 107 | |
fa0be8a4 | 108 | install -m 0755 rhel/etc_init.d_openvswitch \ |
d8fe0a6a | 109 | $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init |
95ca408c | 110 | |
3d1d098c | 111 | install -p -D -m 0644 rhel/etc_logrotate.d_openvswitch \ |
4f98e02e | 112 | $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/openvswitch |
95ca408c | 113 | |
fa0be8a4 | 114 | install -m 0644 vswitchd/vswitch.ovsschema \ |
4f98e02e | 115 | $RPM_BUILD_ROOT/%{_datadir}/openvswitch/vswitch.ovsschema |
95ca408c | 116 | |
4f98e02e | 117 | install -d -m 0755 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ |
d8fe0a6a | 118 | install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \ |
4f98e02e | 119 | $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs |
d8fe0a6a | 120 | install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \ |
4f98e02e | 121 | $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs |
95ca408c | 122 | |
9136f9bd | 123 | install -d -m 0755 $RPM_BUILD_ROOT%{python_sitelib} |
3224d948 FL |
124 | mv $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/* \ |
125 | $RPM_BUILD_ROOT%{python_sitelib} | |
9136f9bd | 126 | rmdir $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/ |
d8fe0a6a | 127 | |
fa0be8a4 | 128 | install -d -m 0755 $RPM_BUILD_ROOT/%{_sharedstatedir}/openvswitch |
d8fe0a6a | 129 | |
3519fa08 FL |
130 | install -d -m 0755 $RPM_BUILD_ROOT%{_includedir}/openvswitch |
131 | install -p -D -m 0644 include/openvswitch/*.h \ | |
150ffd74 | 132 | -t $RPM_BUILD_ROOT%{_includedir}/openvswitch |
3224d948 FL |
133 | install -p -D -m 0644 config.h \ |
134 | -t $RPM_BUILD_ROOT%{_includedir}/openvswitch | |
3519fa08 FL |
135 | |
136 | install -d -m 0755 $RPM_BUILD_ROOT%{_includedir}/openvswitch/lib | |
137 | install -p -D -m 0644 lib/*.h \ | |
150ffd74 | 138 | -t $RPM_BUILD_ROOT%{_includedir}/openvswitch/lib |
3519fa08 FL |
139 | |
140 | install -d -m 0755 $RPM_BUILD_ROOT%{_includedir}/openflow | |
141 | install -p -D -m 0644 include/openflow/*.h \ | |
150ffd74 | 142 | -t $RPM_BUILD_ROOT%{_includedir}/openflow |
38b7a52b | 143 | |
1c9564eb FL |
144 | touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/conf.db |
145 | touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/system-id.conf | |
146 | ||
329cf232 GS |
147 | %check |
148 | %if %{with check} | |
149 | if make check TESTSUITEFLAGS='%{_smp_mflags}' || | |
150 | make check TESTSUITEFLAGS='--recheck'; then :; | |
151 | else | |
152 | cat tests/testsuite.log | |
153 | exit 1 | |
154 | fi | |
155 | %endif | |
156 | ||
d8fe0a6a RS |
157 | %clean |
158 | rm -rf $RPM_BUILD_ROOT | |
159 | ||
160 | %preun | |
0447019d FL |
161 | %if 0%{?systemd_preun:1} |
162 | %systemd_preun %{name}.service | |
163 | %else | |
164 | if [ $1 -eq 0 ] ; then | |
165 | # Package removal, not upgrade | |
166 | /bin/systemctl --no-reload disable %{name}.service >/dev/null 2>&1 || : | |
167 | /bin/systemctl stop %{name}.service >/dev/null 2>&1 || : | |
168 | fi | |
169 | %endif | |
170 | ||
d8fe0a6a RS |
171 | |
172 | %post | |
0447019d FL |
173 | %if 0%{?systemd_post:1} |
174 | %systemd_post %{name}.service | |
175 | %else | |
176 | # Package install, not upgrade | |
177 | if [ $1 -eq 1 ]; then | |
178 | /bin/systemctl daemon-reload >dev/null || : | |
179 | fi | |
180 | %endif | |
181 | ||
d8fe0a6a RS |
182 | |
183 | %postun | |
0447019d FL |
184 | %if 0%{?systemd_postun_with_restart:1} |
185 | %systemd_postun_with_restart %{name}.service | |
186 | %else | |
187 | /bin/systemctl daemon-reload >/dev/null 2>&1 || : | |
188 | if [ "$1" -ge "1" ] ; then | |
189 | # Package upgrade, not uninstall | |
190 | /bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || : | |
191 | fi | |
192 | %endif | |
193 | ||
d8fe0a6a | 194 | |
9136f9bd FL |
195 | %files -n python-openvswitch |
196 | %{python_sitelib}/ovs | |
197 | %doc COPYING | |
198 | ||
f305420a FL |
199 | %files test |
200 | %{_bindir}/ovs-test | |
201 | %{_bindir}/ovs-vlan-test | |
202 | %{_bindir}/ovs-l3ping | |
203 | %{_mandir}/man8/ovs-test.8* | |
204 | %{_mandir}/man8/ovs-vlan-test.8* | |
205 | %{_mandir}/man8/ovs-l3ping.8* | |
206 | %{python_sitelib}/ovstest | |
207 | ||
3519fa08 FL |
208 | %files devel |
209 | %{_libdir}/*.a | |
210 | %{_libdir}/*.la | |
211 | %{_includedir}/openvswitch/* | |
212 | %{_includedir}/openflow/* | |
213 | ||
d8fe0a6a RS |
214 | %files |
215 | %defattr(-,root,root) | |
1c9564eb FL |
216 | %dir %{_sysconfdir}/openvswitch |
217 | %config %ghost %{_sysconfdir}/openvswitch/conf.db | |
218 | %config %ghost %{_sysconfdir}/openvswitch/system-id.conf | |
219 | %config(noreplace) %{_sysconfdir}/sysconfig/openvswitch | |
a7321a1f | 220 | %config(noreplace) %{_sysconfdir}/logrotate.d/openvswitch |
d8fe0a6a | 221 | %{_unitdir}/openvswitch.service |
b49c106e | 222 | %{_unitdir}/openvswitch-nonetwork.service |
d8fe0a6a RS |
223 | %{_datadir}/openvswitch/scripts/openvswitch.init |
224 | %{_sysconfdir}/sysconfig/network-scripts/ifup-ovs | |
225 | %{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs | |
aa6ccca5 FL |
226 | %{_datadir}/openvswitch/bugtool-plugins/ |
227 | %{_datadir}/openvswitch/scripts/ovs-bugtool-* | |
228 | %{_datadir}/openvswitch/scripts/ovs-check-dead-ifs | |
229 | %{_datadir}/openvswitch/scripts/ovs-lib | |
230 | %{_datadir}/openvswitch/scripts/ovs-vtep | |
231 | %{_datadir}/openvswitch/scripts/ovs-ctl | |
232 | %config %{_datadir}/openvswitch/vswitch.ovsschema | |
233 | %config %{_datadir}/openvswitch/vtep.ovsschema | |
5b88626a FL |
234 | %{_bindir}/ovs-appctl |
235 | %{_bindir}/ovs-docker | |
236 | %{_bindir}/ovs-dpctl | |
237 | %{_bindir}/ovs-dpctl-top | |
238 | %{_bindir}/ovs-ofctl | |
239 | %{_bindir}/ovs-vsctl | |
240 | %{_bindir}/ovsdb-client | |
241 | %{_bindir}/ovsdb-tool | |
242 | %{_bindir}/ovs-testcontroller | |
243 | %{_bindir}/ovs-pki | |
244 | %{_bindir}/vtep-ctl | |
f616ba3e FL |
245 | %{_sbindir}/ovs-bugtool |
246 | %{_sbindir}/ovs-vswitchd | |
247 | %{_sbindir}/ovsdb-server | |
a2f24d79 FL |
248 | %{_mandir}/man1/ovs-benchmark.1* |
249 | %{_mandir}/man1/ovs-pcap.1* | |
250 | %{_mandir}/man1/ovs-tcpundump.1* | |
251 | %{_mandir}/man1/ovsdb-client.1* | |
252 | %{_mandir}/man1/ovsdb-server.1* | |
253 | %{_mandir}/man1/ovsdb-tool.1* | |
254 | %{_mandir}/man5/ovs-vswitchd.conf.db.5* | |
255 | %{_mandir}/man5/vtep.5* | |
256 | %{_mandir}/man8/vtep-ctl.8* | |
257 | %{_mandir}/man8/ovs-appctl.8* | |
258 | %{_mandir}/man8/ovs-bugtool.8* | |
259 | %{_mandir}/man8/ovs-ctl.8* | |
260 | %{_mandir}/man8/ovs-dpctl.8* | |
261 | %{_mandir}/man8/ovs-dpctl-top.8* | |
262 | %{_mandir}/man8/ovs-ofctl.8* | |
263 | %{_mandir}/man8/ovs-pki.8* | |
264 | %{_mandir}/man8/ovs-vsctl.8* | |
265 | %{_mandir}/man8/ovs-vswitchd.8* | |
266 | %{_mandir}/man8/ovs-parse-backtrace.8* | |
267 | %{_mandir}/man8/ovs-testcontroller.8* | |
b3d0fa1d FL |
268 | %doc COPYING DESIGN.md INSTALL.SSL.md NOTICE README.md WHY-OVS.md |
269 | %doc FAQ.md NEWS INSTALL.DPDK.md rhel/README.RHEL | |
d8fe0a6a | 270 | /var/lib/openvswitch |
c649fe54 | 271 | /var/log/openvswitch |
5b88626a FL |
272 | %exclude %{_bindir}/ovs-benchmark |
273 | %exclude %{_bindir}/ovs-parse-backtrace | |
274 | %exclude %{_bindir}/ovs-pcap | |
275 | %exclude %{_bindir}/ovs-tcpundump | |
f616ba3e | 276 | %exclude %{_sbindir}/ovs-vlan-bug-workaround |
e7b0f92d FL |
277 | %exclude %{_mandir}/man1/ovs-benchmark.1.gz |
278 | %exclude %{_mandir}/man1/ovs-pcap.1.gz | |
279 | %exclude %{_mandir}/man1/ovs-tcpundump.1.gz | |
280 | %exclude %{_mandir}/man8/ovs-vlan-bug-workaround.8.gz | |
aa6ccca5 | 281 | %exclude %{_datadir}/openvswitch/scripts/ovs-save |
d8fe0a6a RS |
282 | |
283 | %changelog | |
284 | * Wed Jan 12 2011 Ralf Spenneberg <ralf@os-s.net> | |
285 | - First build on F14 |