]> git.pld-linux.org Git - SPECS.git/blob - openvswitch.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / openvswitch.spec
1 # TODO:
2 # - verify all init scripts still work
3 #
4 # warning: Installed (but unpackaged) file(s) found:
5 #       /etc/bash_completion.d/ovs-appctl-bashcomp.bash
6 #       /etc/bash_completion.d/ovs-vsctl-bashcomp.bash
7
8 #
9 # Conditional build:
10 %bcond_with     kernel          # build kernel module for flow-based switching for kernels < 4.11
11 %bcond_without  userspace       # don't build userspace programs
12 %bcond_with     verbose         # verbose build (V=1)
13
14 %if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace}
15 %{error:kernel and userspace cannot be built at the same time on PLD builders}
16 exit 1
17 %endif
18
19 %if %{without userspace}
20 # nothing to be placed to debuginfo package
21 %define         _enable_debug_packages  0
22 %endif
23
24 %define         rel     1
25 %define         pname   openvswitch
26 Summary:        Production Quality, Multilayer Open Virtual Switch
27 #Summary(pl.UTF-8):     -
28 Name:           %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
29 Version:        2.10.0
30 Release:        %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
31 License:        Apache v2.0
32 Group:          Networking/Daemons
33 Source0:        http://openvswitch.org/releases/%{pname}-%{version}.tar.gz
34 # Source0-md5:  33a55c9bac1fcaa8842f84a175e50800
35 Source1:        ifdown-ovs
36 Source2:        ifup-ovs
37 Source3:        README.PLD
38 Source4:        %{pname}.logrotate
39 Source5:        %{pname}.tmpfiles
40 Source6:        %{pname}.sysconfig
41 Source7:        %{pname}.init
42 #Source8:       openvswitch-controller.init
43 #Source9:       openvswitch-ipsec.init
44 Source10:       %{pname}.service
45 URL:            http://openvswitch.org/
46 BuildRequires:  Zope-Interface
47 BuildRequires:  autoconf
48 BuildRequires:  automake
49 BuildRequires:  graphviz
50 BuildRequires:  groff
51 BuildRequires:  openssl-devel
52 BuildRequires:  openssl-tools
53 BuildRequires:  pkgconfig
54 BuildRequires:  python-PyQt4-devel-tools
55 BuildRequires:  python-TwistedConch
56 BuildRequires:  python-TwistedCore
57 BuildRequires:  python-distribute
58 BuildRequires:  rpm-pythonprov
59 BuildRequires:  rpmbuild(macros) >= 1.701
60 BuildRequires:  sip-PyQt4
61 %if %{with kernel}
62 %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:3.11}
63 %else
64 Requires:       uname(release) >= 3.11
65 %endif
66 Requires(post,preun):   /sbin/chkconfig
67 Requires(post,preun,postun):    systemd-units >= 38
68 Requires:       python-modules
69 Requires:       rc-scripts
70 Requires:       systemd-units >= 38
71 Obsoletes:      ovsdbmonitor < 2.3.0-1
72 BuildRoot:      %{tmpdir}/%{pname}-%{version}-root-%(id -u -n)
73
74 %description
75 Open vSwitch is a production quality, multilayer virtual switch
76 licensed under the open source Apache 2.0 license. It is designed to
77 enable massive network automation through programmatic extension,
78 while still supporting standard management interfaces and protocols
79 (e.g. NetFlow, sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In addition,
80 it is designed to support distribution across multiple physical
81 servers similar to VMware's vNetwork distributed vswitch or Cisco's
82 Nexus 1000V.
83
84 %package devel
85 Summary:        Header files and development libraries for openvswitch
86 Group:          Development/Libraries
87
88 %description devel
89 Header files and development libraries for openvswitch.
90
91 %package -n python-openvswitch
92 Summary:        Open vSwitch python bindings
93 Group:          Development/Languages/Python
94 Requires:       python-modules
95
96 %description -n python-openvswitch
97 Python bindings for the Open vSwitch database
98
99 %package test
100 Summary:        Open vSwitch test package
101 Group:          Networking/Admin
102 Requires:       python-modules
103 Requires:       python-openvswitch = %{version}-%{release}
104
105 %description test
106 This package contains utilities that are useful to diagnose
107 performance and connectivity issues in Open vSwitch setup.
108
109 %define kernel_pkg()\
110 %package -n kernel%{_alt_kernel}-net-openvswitch\
111 Summary:        Linux driver for openvswitch\
112 Summary(pl.UTF-8):      Sterownik dla Linuksa do openvswitch\
113 Release:        %{rel}@%{_kernel_ver_str}\
114 Group:          Base/Kernel\
115 Requires(post,postun):  /sbin/depmod\
116 %requires_releq_kernel\
117 Requires(postun):       %releq_kernel\
118 \
119 %description -n kernel%{_alt_kernel}-net-openvswitch\
120 This is driver for openvswitch for Linux.\
121 \
122 This package contains Linux module.\
123 \
124 %description -n kernel%{_alt_kernel}-net-openvswitch -l pl.UTF-8\
125 Sterownik dla Linuksa do openvswitch.\
126 \
127 Ten pakiet zawiera moduł jądra Linuksa.\
128 \
129 %if %{with kernel}\
130 %files -n kernel%{_alt_kernel}-net-openvswitch\
131 %defattr(644,root,root,755)\
132 /etc/modprobe.d/%{_kernel_ver}/openvswitch.conf\
133 %dir /lib/modules/%{_kernel_ver}/kernel/net/openvswitch\
134 /lib/modules/%{_kernel_ver}/kernel/net/openvswitch/*.ko*\
135 %endif\
136 \
137 %post   -n kernel%{_alt_kernel}-net-openvswitch\
138 %depmod %{_kernel_ver}\
139 \
140 %postun -n kernel%{_alt_kernel}-net-openvswitch\
141 %depmod %{_kernel_ver}\
142 %{nil}
143
144 %define build_kernel_pkg()\
145 %configure \\\
146         --with-linux=%{_kernelsrcdir} \\\
147         --with-linux-source=%{_kernelsrcdir}\
148 \
149 %{__make} clean\
150 %{__make} -C datapath/linux %{?with_verbose:V=1}\
151 %install_kernel_modules -D installed -s %{version} -n openvswitch -m datapath/linux/openvswitch,datapath/linux/vport-geneve,datapath/linux/vport-gre,datapath/linux/vport-lisp,datapath/linux/vport-stt,datapath/linux/vport-vxlan -d kernel/net/openvswitch\
152 %{nil}
153
154 %{?with_kernel:%{expand:%create_kernel_packages}}
155
156 %prep
157 %setup -q -n %{pname}-%{version}
158 cp %{SOURCE3} .
159
160 %build
161 %{?with_kernel:%{expand:%build_kernel_packages}}
162
163 %if %{with userspace}
164 %configure
165 %{__make} clean
166 %{__make}
167 %endif
168
169 %install
170 rm -rf $RPM_BUILD_ROOT
171
172 %if %{with userspace}
173 install -d $RPM_BUILD_ROOT{%{py_sitescriptdir},%{systemdunitdir},%{systemdtmpfilesdir}} \
174         $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d,logrotate.d},/lib/rc-scripts} \
175         $RPM_BUILD_ROOT%{_datadir}/%{pname}/pki
176
177 %{__make} install \
178         DESTDIR=$RPM_BUILD_ROOT
179
180 install -p %{SOURCE1} $RPM_BUILD_ROOT/lib/rc-scripts/ifdown-ovs
181 install -p %{SOURCE2} $RPM_BUILD_ROOT/lib/rc-scripts/ifup-ovs
182 install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/openvswitch
183 install -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/openvswitch.conf
184 install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/openvswitch
185 install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/openvswitch
186 install -p %{SOURCE10} $RPM_BUILD_ROOT%{systemdunitdir}/openvswitch.service
187
188 %{__mv} $RPM_BUILD_ROOT%{_datadir}/%{pname}/python/{ovs,ovstest} $RPM_BUILD_ROOT%{py_sitescriptdir}
189 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/%{pname}/python
190
191 %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la
192
193 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
194 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
195
196 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/ovsdbmonitor
197 %py_comp $RPM_BUILD_ROOT%{_datadir}/ovsdbmonitor
198
199 %py_postclean
200 %endif
201
202 %if %{with kernel}
203 cp -a installed/* $RPM_BUILD_ROOT
204 %endif
205
206 %clean
207 rm -rf $RPM_BUILD_ROOT
208
209 %post
210 /sbin/chkconfig --add openvswitch
211 %service -n openvswitch restart
212 NORESTART=1
213 %systemd_post openvswitch.service
214
215 %preun
216 if [ "$1" = "0" ]; then
217         %service -q openvswitch stop
218         /sbin/chkconfig --del openvswitch
219 fi
220 %systemd_preun openvswitch.service
221
222 %postun
223 %systemd_reload
224
225 %if %{with userspace}
226 %files
227 %defattr(644,root,root,755)
228 %doc AUTHORS.rst CONTRIBUTING.rst MAINTAINERS.rst NEWS NOTICE README.rst
229 %doc README.PLD
230 %attr(755,root,root) /lib/rc-scripts/ifdown-ovs
231 %attr(755,root,root) /lib/rc-scripts/ifup-ovs
232 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/openvswitch
233 %{systemdtmpfilesdir}/openvswitch.conf
234 %{systemdunitdir}/openvswitch.service
235 %dir %{_datadir}/%{pname}
236 %{_datadir}/%{pname}/pki
237 %dir %{_datadir}/%{pname}/scripts
238 %attr(755,root,root) %{_datadir}/%{pname}/scripts/*
239 %{_datadir}/%{pname}/bugtool-plugins
240 %{_datadir}/%{pname}/vswitch.ovsschema
241 %{_datadir}/%{pname}/ovn-nb.ovsschema
242 %{_datadir}/%{pname}/ovn-sb.ovsschema
243 %{_datadir}/%{pname}/vtep.ovsschema
244
245 %attr(754,root,root) /etc/rc.d/init.d/openvswitch
246 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/openvswitch
247
248 %attr(755,root,root) %{_bindir}/ovn-controller
249 %attr(755,root,root) %{_bindir}/ovn-controller-vtep
250 %attr(755,root,root) %{_bindir}/ovn-detrace
251 %attr(755,root,root) %{_bindir}/ovn-docker-overlay-driver
252 %attr(755,root,root) %{_bindir}/ovn-docker-underlay-driver
253 %attr(755,root,root) %{_bindir}/ovn-nbctl
254 %attr(755,root,root) %{_bindir}/ovn-northd
255 %attr(755,root,root) %{_bindir}/ovn-sbctl
256 %attr(755,root,root) %{_bindir}/ovn-trace
257 %attr(755,root,root) %{_bindir}/ovs-appctl
258 %attr(755,root,root) %{_bindir}/ovs-docker
259 %attr(755,root,root) %{_bindir}/ovs-dpctl
260 %attr(755,root,root) %{_bindir}/ovs-dpctl-top
261 %attr(755,root,root) %{_bindir}/ovs-l3ping
262 %attr(755,root,root) %{_bindir}/ovs-ofctl
263 %attr(755,root,root) %{_bindir}/ovs-parse-backtrace
264 %attr(755,root,root) %{_bindir}/ovs-pcap
265 %attr(755,root,root) %{_bindir}/ovs-pki
266 %attr(755,root,root) %{_bindir}/ovs-tcpundump
267 %attr(755,root,root) %{_bindir}/ovs-tcpdump
268 %attr(755,root,root) %{_bindir}/ovs-vsctl
269 %attr(755,root,root) %{_bindir}/ovsdb-client
270 %attr(755,root,root) %{_bindir}/ovsdb-tool
271 %attr(755,root,root) %{_bindir}/vtep-ctl
272 %attr(755,root,root) %{_sbindir}/ovs-bugtool
273 %attr(755,root,root) %{_sbindir}/ovs-vlan-bug-workaround
274 %attr(755,root,root) %{_sbindir}/ovs-vswitchd
275 %attr(755,root,root) %{_sbindir}/ovsdb-server
276 %{_mandir}/man1/ovn-detrace.1*
277 %{_mandir}/man1/ovs-pcap.1*
278 %{_mandir}/man1/ovs-tcpundump.1*
279 %{_mandir}/man1/ovsdb-client.1*
280 %{_mandir}/man1/ovsdb-server.1*
281 %{_mandir}/man1/ovsdb-tool.1*
282 %{_mandir}/man5/ovn-nb.5*
283 %{_mandir}/man5/ovn-sb.5*
284 %{_mandir}/man5/ovs-vswitchd.conf.db.5*
285 %{_mandir}/man5/ovsdb-server.5*
286 %{_mandir}/man5/ovsdb.5*
287 %{_mandir}/man5/vtep.5*
288 %{_mandir}/man7/ovn-architecture.7*
289 %{_mandir}/man7/ovs-fields.7*
290 %{_mandir}/man7/ovsdb-server.7*
291 %{_mandir}/man7/ovsdb.7*
292 %{_mandir}/man8/ovn-controller-vtep.8*
293 %{_mandir}/man8/ovn-controller.8*
294 %{_mandir}/man8/ovn-ctl.8*
295 %{_mandir}/man8/ovn-nbctl.8*
296 %{_mandir}/man8/ovn-northd.8*
297 %{_mandir}/man8/ovn-sbctl.8*
298 %{_mandir}/man8/ovn-trace.8*
299 %{_mandir}/man8/vtep-ctl.8*
300 %{_mandir}/man8/ovs-kmod-ctl.8*
301 %{_mandir}/man8/ovs-tcpdump.8*
302 %{_mandir}/man8/ovs-testcontroller.8*
303 %{_mandir}/man8/ovs-appctl.8*
304 %{_mandir}/man8/ovs-bugtool.8*
305 %{_mandir}/man8/ovs-ctl.8*
306 %{_mandir}/man8/ovs-dpctl.8*
307 %{_mandir}/man8/ovs-dpctl-top.8*
308 %{_mandir}/man8/ovs-l3ping.8*
309 %{_mandir}/man8/ovs-ofctl.8*
310 %{_mandir}/man8/ovs-parse-backtrace.8*
311 %{_mandir}/man8/ovs-pki.8*
312 %{_mandir}/man8/ovs-vlan-bug-workaround.8*
313 %{_mandir}/man8/ovs-vlan-test.8*
314 %{_mandir}/man8/ovs-vsctl.8*
315 %{_mandir}/man8/ovs-vswitchd.8*
316
317 %files devel
318 %defattr(644,root,root,755)
319 %{_includedir}/openflow
320 %{_includedir}/openvswitch
321 %{_includedir}/ovn
322 %{_libdir}/libofproto.a
323 %{_libdir}/libopenvswitch.a
324 %{_libdir}/libovn.a
325 %{_libdir}/libovsdb.a
326 %{_libdir}/libsflow.a
327 %{_libdir}/libvtep.a
328 %{_pkgconfigdir}/libofproto.pc
329 %{_pkgconfigdir}/libopenvswitch.pc
330 %{_pkgconfigdir}/libovsdb.pc
331 %{_pkgconfigdir}/libsflow.pc
332
333 %files -n python-openvswitch
334 %defattr(644,root,root,755)
335 %dir %{py_sitescriptdir}/ovs
336 %{py_sitescriptdir}/ovs/*.py*
337 %dir %{py_sitescriptdir}/ovs/compat
338 %{py_sitescriptdir}/ovs/compat/*.py*
339 %dir %{py_sitescriptdir}/ovs/compat/sortedcontainers
340 %{py_sitescriptdir}/ovs/compat/sortedcontainers/*.py*
341 %dir %{py_sitescriptdir}/ovs/db
342 %{py_sitescriptdir}/ovs/db/*.py*
343 %dir %{py_sitescriptdir}/ovs/unixctl
344 %{py_sitescriptdir}/ovs/unixctl/*.py*
345
346 %files test
347 %defattr(644,root,root,755)
348 %attr(755,root,root) %{_bindir}/ovs-test
349 %attr(755,root,root) %{_bindir}/ovs-testcontroller
350 %attr(755,root,root) %{_bindir}/ovs-vlan-test
351 %{py_sitescriptdir}/ovstest
352 %{_mandir}/man8/ovs-test.8*
353 %endif
This page took 0.063748 seconds and 3 git commands to generate.