2 # - verify all init scripts still work
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 # /usr/bin/ovn-controller
8 # /usr/bin/ovn-controller-vtep
10 # /usr/bin/ovn-docker-overlay-driver
11 # /usr/bin/ovn-docker-underlay-driver
17 # /usr/bin/ovs-tcpdump
18 # /usr/bin/ovs-testcontroller
20 # /usr/share/man/man1/ovn-detrace.1.gz
21 # /usr/share/man/man5/ovn-nb.5.gz
22 # /usr/share/man/man5/ovn-sb.5.gz
23 # /usr/share/man/man5/vtep.5.gz
24 # /usr/share/man/man7/ovn-architecture.7.gz
25 # /usr/share/man/man7/ovs-fields.7.gz
26 # /usr/share/man/man8/ovn-controller-vtep.8.gz
27 # /usr/share/man/man8/ovn-controller.8.gz
28 # /usr/share/man/man8/ovn-ctl.8.gz
29 # /usr/share/man/man8/ovn-nbctl.8.gz
30 # /usr/share/man/man8/ovn-northd.8.gz
31 # /usr/share/man/man8/ovn-sbctl.8.gz
32 # /usr/share/man/man8/ovn-trace.8.gz
33 # /usr/share/man/man8/ovs-tcpdump.8.gz
34 # /usr/share/man/man8/ovs-testcontroller.8.gz
35 # /usr/share/man/man8/vtep-ctl.8.gz
36 # /usr/share/openvswitch/ovn-nb.ovsschema
37 # /usr/share/openvswitch/ovn-sb.ovsschema
38 # /usr/share/openvswitch/vtep.ovsschema
42 %bcond_with kernel # build kernel module for flow-based switching for kernels < 4.11
43 %bcond_without userspace # don't build userspace programs
44 %bcond_with verbose # verbose build (V=1)
46 %if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace}
47 %{error:kernel and userspace cannot be built at the same time on PLD builders}
51 %if %{without userspace}
52 # nothing to be placed to debuginfo package
53 %define _enable_debug_packages 0
57 %define pname openvswitch
58 Summary: Production Quality, Multilayer Open Virtual Switch
60 Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
62 Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
64 Group: Networking/Daemons
65 Source0: http://openvswitch.org/releases/%{pname}-%{version}.tar.gz
66 # Source0-md5: 837e291cfd60af0fc455e77deb2e1172
70 Source4: %{pname}.logrotate
71 Source5: %{pname}.tmpfiles
72 Source6: %{pname}.sysconfig
73 Source7: %{pname}.init
74 #Source8: openvswitch-controller.init
75 #Source9: openvswitch-ipsec.init
76 Source10: %{pname}.service
77 URL: http://openvswitch.org/
78 BuildRequires: Zope-Interface
79 BuildRequires: autoconf
80 BuildRequires: automake
81 BuildRequires: graphviz
83 BuildRequires: openssl-devel
84 BuildRequires: openssl-tools
85 BuildRequires: pkgconfig
86 BuildRequires: python-PyQt4-devel-tools
87 BuildRequires: python-TwistedConch
88 BuildRequires: python-TwistedCore
89 BuildRequires: python-distribute
90 BuildRequires: rpm-pythonprov
91 BuildRequires: rpmbuild(macros) >= 1.701
92 BuildRequires: sip-PyQt4
94 %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:3.11}
96 Requires: uname(release) >= 3.11
98 Requires(post,preun): /sbin/chkconfig
99 Requires(post,preun,postun): systemd-units >= 38
100 Requires: python-modules
102 Requires: systemd-units >= 38
103 Obsoletes: ovsdbmonitor < 2.3.0-1
104 BuildRoot: %{tmpdir}/%{pname}-%{version}-root-%(id -u -n)
107 Open vSwitch is a production quality, multilayer virtual switch
108 licensed under the open source Apache 2.0 license. It is designed to
109 enable massive network automation through programmatic extension,
110 while still supporting standard management interfaces and protocols
111 (e.g. NetFlow, sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In addition,
112 it is designed to support distribution across multiple physical
113 servers similar to VMware's vNetwork distributed vswitch or Cisco's
117 Summary: Header files and development libraries for openvswitch
118 Group: Development/Libraries
121 Header files and development libraries for openvswitch.
123 %package -n python-openvswitch
124 Summary: Open vSwitch python bindings
125 Group: Development/Languages/Python
126 Requires: python-modules
128 %description -n python-openvswitch
129 Python bindings for the Open vSwitch database
132 Summary: Open vSwitch test package
133 Group: Networking/Admin
134 Requires: python-modules
135 Requires: python-openvswitch = %{version}-%{release}
138 This package contains utilities that are useful to diagnose
139 performance and connectivity issues in Open vSwitch setup.
141 %define kernel_pkg()\
142 %package -n kernel%{_alt_kernel}-net-openvswitch\
143 Summary: Linux driver for openvswitch\
144 Summary(pl.UTF-8): Sterownik dla Linuksa do openvswitch\
145 Release: %{rel}@%{_kernel_ver_str}\
147 Requires(post,postun): /sbin/depmod\
148 %requires_releq_kernel\
149 Requires(postun): %releq_kernel\
151 %description -n kernel%{_alt_kernel}-net-openvswitch\
152 This is driver for openvswitch for Linux.\
154 This package contains Linux module.\
156 %description -n kernel%{_alt_kernel}-net-openvswitch -l pl.UTF-8\
157 Sterownik dla Linuksa do openvswitch.\
159 Ten pakiet zawiera moduł jądra Linuksa.\
162 %files -n kernel%{_alt_kernel}-net-openvswitch\
163 %defattr(644,root,root,755)\
164 /etc/modprobe.d/%{_kernel_ver}/openvswitch.conf\
165 %dir /lib/modules/%{_kernel_ver}/kernel/net/openvswitch\
166 /lib/modules/%{_kernel_ver}/kernel/net/openvswitch/*.ko*\
169 %post -n kernel%{_alt_kernel}-net-openvswitch\
170 %depmod %{_kernel_ver}\
172 %postun -n kernel%{_alt_kernel}-net-openvswitch\
173 %depmod %{_kernel_ver}\
176 %define build_kernel_pkg()\
178 --with-linux=%{_kernelsrcdir} \\\
179 --with-linux-source=%{_kernelsrcdir}\
182 %{__make} -C datapath/linux %{?with_verbose:V=1}\
183 %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\
186 %{?with_kernel:%{expand:%create_kernel_packages}}
189 %setup -q -n %{pname}-%{version}
193 %{?with_kernel:%{expand:%build_kernel_packages}}
195 %if %{with userspace}
202 rm -rf $RPM_BUILD_ROOT
204 %if %{with userspace}
205 install -d $RPM_BUILD_ROOT{%{py_sitescriptdir},%{systemdunitdir},%{systemdtmpfilesdir}} \
206 $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d,logrotate.d},/lib/rc-scripts} \
207 $RPM_BUILD_ROOT%{_datadir}/%{pname}/pki
210 DESTDIR=$RPM_BUILD_ROOT
212 install -p %{SOURCE1} $RPM_BUILD_ROOT/lib/rc-scripts/ifdown-ovs
213 install -p %{SOURCE2} $RPM_BUILD_ROOT/lib/rc-scripts/ifup-ovs
214 install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/openvswitch
215 install -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/openvswitch.conf
216 install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/openvswitch
217 install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/openvswitch
218 install -p %{SOURCE10} $RPM_BUILD_ROOT%{systemdunitdir}/openvswitch.service
220 %{__mv} $RPM_BUILD_ROOT%{_datadir}/%{pname}/python/{ovs,ovstest} $RPM_BUILD_ROOT%{py_sitescriptdir}
221 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/%{pname}/python
223 %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la
225 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
226 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
228 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/ovsdbmonitor
229 %py_comp $RPM_BUILD_ROOT%{_datadir}/ovsdbmonitor
233 cp -a installed/* $RPM_BUILD_ROOT
237 rm -rf $RPM_BUILD_ROOT
240 /sbin/chkconfig --add openvswitch
241 %service -n openvswitch restart
243 %systemd_post openvswitch.service
246 if [ "$1" = "0" ]; then
247 %service -q openvswitch stop
248 /sbin/chkconfig --del openvswitch
250 %systemd_preun openvswitch.service
255 %if %{with userspace}
257 %defattr(644,root,root,755)
258 %doc AUTHORS.rst CONTRIBUTING.rst MAINTAINERS.rst NEWS NOTICE README.rst
260 %attr(755,root,root) /lib/rc-scripts/ifdown-ovs
261 %attr(755,root,root) /lib/rc-scripts/ifup-ovs
262 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/openvswitch
263 %{systemdtmpfilesdir}/openvswitch.conf
264 %{systemdunitdir}/openvswitch.service
265 %dir %{_datadir}/%{pname}
266 %{_datadir}/%{pname}/pki
267 %dir %{_datadir}/%{pname}/scripts
268 %attr(755,root,root) %{_datadir}/%{pname}/scripts/*
269 %{_datadir}/%{pname}/bugtool-plugins
270 %{_datadir}/%{pname}/vswitch.ovsschema
272 %attr(754,root,root) /etc/rc.d/init.d/openvswitch
273 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/openvswitch
275 %attr(755,root,root) %{_bindir}/ovs-appctl
276 %attr(755,root,root) %{_bindir}/ovs-dpctl
277 %attr(755,root,root) %{_bindir}/ovs-dpctl-top
278 %attr(755,root,root) %{_bindir}/ovs-l3ping
279 %attr(755,root,root) %{_bindir}/ovs-ofctl
280 %attr(755,root,root) %{_bindir}/ovs-parse-backtrace
281 %attr(755,root,root) %{_bindir}/ovs-pcap
282 %attr(755,root,root) %{_bindir}/ovs-pki
283 %attr(755,root,root) %{_bindir}/ovs-tcpundump
284 %attr(755,root,root) %{_bindir}/ovs-vsctl
285 %attr(755,root,root) %{_bindir}/ovsdb-client
286 %attr(755,root,root) %{_bindir}/ovsdb-tool
287 %attr(755,root,root) %{_sbindir}/ovs-bugtool
288 %attr(755,root,root) %{_sbindir}/ovs-vlan-bug-workaround
289 %attr(755,root,root) %{_sbindir}/ovs-vswitchd
290 %attr(755,root,root) %{_sbindir}/ovsdb-server
291 %{_mandir}/man1/ovs-pcap.1*
292 %{_mandir}/man1/ovs-tcpundump.1*
293 %{_mandir}/man1/ovsdb-client.1*
294 %{_mandir}/man1/ovsdb-server.1*
295 %{_mandir}/man1/ovsdb-tool.1*
296 %{_mandir}/man5/ovs-vswitchd.conf.db.5*
297 %{_mandir}/man8/ovs-appctl.8*
298 %{_mandir}/man8/ovs-bugtool.8*
299 %{_mandir}/man8/ovs-ctl.8*
300 %{_mandir}/man8/ovs-dpctl.8*
301 %{_mandir}/man8/ovs-dpctl-top.8*
302 %{_mandir}/man8/ovs-l3ping.8*
303 %{_mandir}/man8/ovs-ofctl.8*
304 %{_mandir}/man8/ovs-parse-backtrace.8*
305 %{_mandir}/man8/ovs-pki.8*
306 %{_mandir}/man8/ovs-vlan-bug-workaround.8*
307 %{_mandir}/man8/ovs-vlan-test.8*
308 %{_mandir}/man8/ovs-vsctl.8*
309 %{_mandir}/man8/ovs-vswitchd.8*
312 %defattr(644,root,root,755)
313 %{_includedir}/openflow
314 %{_includedir}/openvswitch
316 %{_libdir}/libofproto.a
317 %{_libdir}/libopenvswitch.a
319 %{_libdir}/libovsdb.a
320 %{_libdir}/libsflow.a
322 %{_pkgconfigdir}/libofproto.pc
323 %{_pkgconfigdir}/libopenvswitch.pc
324 %{_pkgconfigdir}/libovsdb.pc
325 %{_pkgconfigdir}/libsflow.pc
327 %files -n python-openvswitch
328 %defattr(644,root,root,755)
329 %dir %{py_sitescriptdir}/ovs
330 %{py_sitescriptdir}/ovs/*.py*
331 %dir %{py_sitescriptdir}/ovs/db
332 %{py_sitescriptdir}/ovs/db/*.py*
333 %dir %{py_sitescriptdir}/ovs/unixctl
334 %{py_sitescriptdir}/ovs/unixctl/*.py*
337 %defattr(644,root,root,755)
338 %attr(755,root,root) %{_bindir}/ovs-test
339 %attr(755,root,root) %{_bindir}/ovs-vlan-test
340 %{py_sitescriptdir}/ovstest
341 %{_mandir}/man8/ovs-test.8*