]> git.pld-linux.org Git - packages/openvswitch.git/blob - openvswitch.spec
- added devel subpackage
[packages/openvswitch.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 #       /usr/bin/ovn-controller
8 #       /usr/bin/ovn-controller-vtep
9 #       /usr/bin/ovn-detrace
10 #       /usr/bin/ovn-docker-overlay-driver
11 #       /usr/bin/ovn-docker-underlay-driver
12 #       /usr/bin/ovn-nbctl
13 #       /usr/bin/ovn-northd
14 #       /usr/bin/ovn-sbctl
15 #       /usr/bin/ovn-trace
16 #       /usr/bin/ovs-docker
17 #       /usr/bin/ovs-tcpdump
18 #       /usr/bin/ovs-testcontroller
19 #       /usr/bin/vtep-ctl
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
39
40 #
41 # Conditional build:
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)
45
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}
48 exit 1
49 %endif
50
51 %if %{without userspace}
52 # nothing to be placed to debuginfo package
53 %define         _enable_debug_packages  0
54 %endif
55
56 %define         rel     0.1
57 %define         pname   openvswitch
58 Summary:        Production Quality, Multilayer Open Virtual Switch
59 #Summary(pl.UTF-8):     -
60 Name:           %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
61 Version:        2.8.1
62 Release:        %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
63 License:        Apache v2.0
64 Group:          Networking/Daemons
65 Source0:        http://openvswitch.org/releases/%{pname}-%{version}.tar.gz
66 # Source0-md5:  837e291cfd60af0fc455e77deb2e1172
67 Source1:        ifdown-ovs
68 Source2:        ifup-ovs
69 Source3:        README.PLD
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
82 BuildRequires:  groff
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
93 %if %{with kernel}
94 %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:3.11}
95 %else
96 Requires:       uname(release) >= 3.11
97 %endif
98 Requires(post,preun):   /sbin/chkconfig
99 Requires(post,preun,postun):    systemd-units >= 38
100 Requires:       python-modules
101 Requires:       rc-scripts
102 Requires:       systemd-units >= 38
103 Obsoletes:      ovsdbmonitor < 2.3.0-1
104 BuildRoot:      %{tmpdir}/%{pname}-%{version}-root-%(id -u -n)
105
106 %description
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
114 Nexus 1000V.
115
116 %package devel
117 Summary:        Header files and development libraries for openvswitch
118 Group:          Development/Libraries
119
120 %description devel
121 Header files and development libraries for openvswitch.
122
123 %package -n python-openvswitch
124 Summary:        Open vSwitch python bindings
125 Group:          Development/Languages/Python
126 Requires:       python-modules
127
128 %description -n python-openvswitch
129 Python bindings for the Open vSwitch database
130
131 %package test
132 Summary:        Open vSwitch test package
133 Group:          Networking/Admin
134 Requires:       python-modules
135 Requires:       python-openvswitch = %{version}-%{release}
136
137 %description test
138 This package contains utilities that are useful to diagnose
139 performance and connectivity issues in Open vSwitch setup.
140
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}\
146 Group:          Base/Kernel\
147 Requires(post,postun):  /sbin/depmod\
148 %requires_releq_kernel\
149 Requires(postun):       %releq_kernel\
150 \
151 %description -n kernel%{_alt_kernel}-net-openvswitch\
152 This is driver for openvswitch for Linux.\
153 \
154 This package contains Linux module.\
155 \
156 %description -n kernel%{_alt_kernel}-net-openvswitch -l pl.UTF-8\
157 Sterownik dla Linuksa do openvswitch.\
158 \
159 Ten pakiet zawiera moduł jądra Linuksa.\
160 \
161 %if %{with kernel}\
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*\
167 %endif\
168 \
169 %post   -n kernel%{_alt_kernel}-net-openvswitch\
170 %depmod %{_kernel_ver}\
171 \
172 %postun -n kernel%{_alt_kernel}-net-openvswitch\
173 %depmod %{_kernel_ver}\
174 %{nil}
175
176 %define build_kernel_pkg()\
177 %configure \\\
178         --with-linux=%{_kernelsrcdir} \\\
179         --with-linux-source=%{_kernelsrcdir}\
180 \
181 %{__make} clean\
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\
184 %{nil}
185
186 %{?with_kernel:%{expand:%create_kernel_packages}}
187
188 %prep
189 %setup -q -n %{pname}-%{version}
190 cp %{SOURCE3} .
191
192 %build
193 %{?with_kernel:%{expand:%build_kernel_packages}}
194
195 %if %{with userspace}
196 %configure
197 %{__make} clean
198 %{__make}
199 %endif
200
201 %install
202 rm -rf $RPM_BUILD_ROOT
203
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
208
209 %{__make} install \
210         DESTDIR=$RPM_BUILD_ROOT
211
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
219
220 %{__mv} $RPM_BUILD_ROOT%{_datadir}/%{pname}/python/{ovs,ovstest} $RPM_BUILD_ROOT%{py_sitescriptdir}
221 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/%{pname}/python
222
223 %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la
224
225 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
226 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
227
228 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/ovsdbmonitor
229 %py_comp $RPM_BUILD_ROOT%{_datadir}/ovsdbmonitor
230 %endif
231
232 %if %{with kernel}
233 cp -a installed/* $RPM_BUILD_ROOT
234 %endif
235
236 %clean
237 rm -rf $RPM_BUILD_ROOT
238
239 %post
240 /sbin/chkconfig --add openvswitch
241 %service -n openvswitch restart
242 NORESTART=1
243 %systemd_post openvswitch.service
244
245 %preun
246 if [ "$1" = "0" ]; then
247         %service -q openvswitch stop
248         /sbin/chkconfig --del openvswitch
249 fi
250 %systemd_preun openvswitch.service
251
252 %postun
253 %systemd_reload
254
255 %if %{with userspace}
256 %files
257 %defattr(644,root,root,755)
258 %doc AUTHORS.rst CONTRIBUTING.rst MAINTAINERS.rst NEWS NOTICE README.rst
259 %doc README.PLD
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
271
272 %attr(754,root,root) /etc/rc.d/init.d/openvswitch
273 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/openvswitch
274
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*
310
311 %files devel
312 %defattr(644,root,root,755)
313 %{_includedir}/openflow
314 %{_includedir}/openvswitch
315 %{_includedir}/ovn
316 %{_libdir}/libofproto.a
317 %{_libdir}/libopenvswitch.a
318 %{_libdir}/libovn.a
319 %{_libdir}/libovsdb.a
320 %{_libdir}/libsflow.a
321 %{_libdir}/libvtep.a
322 %{_pkgconfigdir}/libofproto.pc
323 %{_pkgconfigdir}/libopenvswitch.pc
324 %{_pkgconfigdir}/libovsdb.pc
325 %{_pkgconfigdir}/libsflow.pc
326
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*
335
336 %files test
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*
342 %endif
This page took 1.461434 seconds and 3 git commands to generate.