]> git.pld-linux.org Git - packages/openvswitch.git/blob - openvswitch.spec
- disable testing atomic ops on i486
[packages/openvswitch.git] / openvswitch.spec
1 #
2 # Conditional build:
3 %bcond_without  dist_kernel     # allow non-distribution kernel
4 %bcond_without  kernel          # don't build kernel modules
5 %bcond_without  userspace       # don't build userspace programs
6 %bcond_with     verbose         # verbose build (V=1)
7
8 # set kernel_builtin to true for kernels with openvswitch module (>= 3.3)
9 %define         kernel_builtin  %(echo %{_kernel_ver} | awk '{ split($0, v, "."); vv=v[1]*1000+v[2]; if (vv >= 3003) print 1; else print 0 }')
10 #'
11 %if %{kernel_builtin} == 1
12 %undefine       with_kernel
13 %endif
14
15 %if %{without kernel}
16 %undefine       with_dist_kernel
17 %endif
18 %if "%{_alt_kernel}" != "%{nil}"
19 %undefine       with_userspace
20 %endif
21 %if %{without userspace}
22 # nothing to be placed to debuginfo package
23 %define         _enable_debug_packages  0
24 %endif
25
26 %define         rel     1
27 %define         pname   openvswitch
28 Summary:        Production Quality, Multilayer Open Virtual Switch
29 #Summary(pl.UTF-8):     -
30 Name:           %{pname}%{_alt_kernel}
31 Version:        2.0.0
32 Release:        %{rel}
33 License:        Apache v2.0
34 Group:          Networking/Daemons
35 Source0:        http://openvswitch.org/releases/%{pname}-%{version}.tar.gz
36 # Source0-md5:  7d7a58350e634e515e0fe43c64d64f44
37 Source1:        ifdown-ovs
38 Source2:        ifup-ovs
39 Source3:        README.PLD
40 Source4:        %{pname}.logrotate
41 Source5:        %{pname}.tmpfiles
42 Source6:        %{pname}.sysconfig
43 Source7:        %{pname}.init
44 #Source8:       openvswitch-controller.init
45 #Source9:       openvswitch-ipsec.init
46 Source10:       %{pname}.service
47 Source11:       ovsdbmonitor.desktop
48 Patch0:         fix-man-typo.patch
49 Patch1:         disable-atomic-test.patch
50 URL:            http://openvswitch.org/
51 BuildRequires:  Zope-Interface
52 BuildRequires:  automake
53 BuildRequires:  autoconf
54 BuildRequires:  graphviz
55 BuildRequires:  groff
56 BuildRequires:  openssl-devel
57 BuildRequires:  openssl-tools
58 BuildRequires:  pkgconfig
59 BuildRequires:  python-PyQt4-devel
60 BuildRequires:  python-PyQt4-devel-tools
61 BuildRequires:  python-TwistedConch
62 BuildRequires:  python-TwistedCore
63 BuildRequires:  python-distribute
64 BuildRequires:  rpm-pythonprov
65 BuildRequires:  rpmbuild(macros) >= 1.647
66 %if %{with kernel}
67 %{?with_dist_kernel:BuildRequires:      kernel%{_alt_kernel}-module-build >= 3:2.6.32}
68 %else
69 Requires:       uname(release) >= 3.3
70 %endif
71 Requires(post,preun):   /sbin/chkconfig
72 Requires(post,preun,postun):    systemd-units >= 38
73 Requires:       python-modules
74 Requires:       rc-scripts
75 Requires:       systemd-units >= 38
76 BuildRoot:      %{tmpdir}/%{pname}-%{version}-root-%(id -u -n)
77
78 %description
79 Open vSwitch is a production quality, multilayer virtual switch
80 licensed under the open source Apache 2.0 license. It is designed to
81 enable massive network automation through programmatic extension,
82 while still supporting standard management interfaces and protocols
83 (e.g. NetFlow, sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In addition,
84 it is designed to support distribution across multiple physical
85 servers similar to VMware's vNetwork distributed vswitch or Cisco's
86 Nexus 1000V.
87
88 #%description -l pl.UTF-8
89
90 %package -n python-openvswitch
91 Summary:        Open vSwitch python bindings
92 Group:          Development/Languages/Python
93 Requires:       python-modules
94
95 %description -n python-openvswitch
96 Python bindings for the Open vSwitch database
97
98 %package -n ovsdbmonitor
99 Summary:        Open vSwitch graphical monitoring tool
100 Group:          Networking/Admin
101 Requires:       Zope-Interface
102 Requires:       python-PyQt4-devel-tools
103 Requires:       python-TwistedConch
104 Requires:       python-TwistedCore
105 Requires:       python-modules
106 Requires:       python-openvswitch = %{version}-%{release}
107
108 %description -n ovsdbmonitor
109 A GUI tool for monitoring and troubleshooting local or remote Open
110 vSwitch installations. It presents GUI tables that graphically
111 represent an Open vSwitch kernel flow table (similar to "ovs-dpctl
112 dump-flows") and Open vSwitch database contents (similar to "ovs-vsctl
113 list <table>").
114
115 %package test
116 Summary:        Open vSwitch test package
117 Group:          Networking/Admin
118 Requires:       python-modules
119 Requires:       python-openvswitch = %{version}-%{release}
120
121 %description test
122 This package contains utilities that are useful to diagnose
123 performance and connectivity issues in Open vSwitch setup.
124
125 %package -n kernel%{_alt_kernel}-net-openvswitch
126 Summary:        Linux driver for openvswitch
127 Summary(pl.UTF-8):      Sterownik dla Linuksa do openvswitch
128 Release:        %{rel}@%{_kernel_ver_str}
129 Group:          Base/Kernel
130 Requires(post,postun):  /sbin/depmod
131 %if %{with dist_kernel}
132 %requires_releq_kernel
133 Requires(postun):       %releq_kernel
134 %endif
135
136 %description -n kernel%{_alt_kernel}-net-openvswitch
137 This is driver for openvswitch for Linux.
138
139 This package contains Linux module.
140
141 %description -n kernel%{_alt_kernel}-net-openvswitch -l pl.UTF-8
142 Sterownik dla Linuksa do openvswitch.
143
144 Ten pakiet zawiera moduł jądra Linuksa.
145
146 %prep
147 %setup -q -n %{pname}-%{version}
148 %patch0 -p1
149 %ifarch i486
150 %patch1 -p1
151 %endif
152 cp %{SOURCE3} .
153
154 %build
155 %{__aclocal} -I m4
156 %{__automake}
157 %{__autoconf}
158 %configure \
159 %if %{with kernel}
160         --with-linux=%{_kernelsrcdir} \
161         --with-linux-source=%{_kernelsrcdir}
162 %endif
163
164 %{__make}
165
166 %install
167 rm -rf $RPM_BUILD_ROOT
168
169 %if %{with userspace}
170 install -d $RPM_BUILD_ROOT{%{py_sitescriptdir},%{systemdunitdir},%{systemdtmpfilesdir}} \
171         $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d,logrotate.d},/lib/rc-scripts} \
172         $RPM_BUILD_ROOT{%{_desktopdir},%{_datadir}/%{pname}/pki}
173
174 %{__make} install \
175         DESTDIR=$RPM_BUILD_ROOT
176
177 install -p %{SOURCE1} $RPM_BUILD_ROOT/lib/rc-scripts/ifdown-ovs
178 install -p %{SOURCE2} $RPM_BUILD_ROOT/lib/rc-scripts/ifup-ovs
179 install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/openvswitch
180 install -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/openvswitch.conf
181 install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/openvswitch
182 install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/openvswitch
183 install -p %{SOURCE10} $RPM_BUILD_ROOT%{systemdunitdir}/openvswitch.service
184 install -p %{SOURCE11} $RPM_BUILD_ROOT%{_desktopdir}
185
186 %{__mv} $RPM_BUILD_ROOT%{_datadir}/%{pname}/python/{ovs,ovstest} $RPM_BUILD_ROOT%{py_sitescriptdir}
187 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/%{pname}/python
188
189 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
190 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
191
192 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/ovsdbmonitor
193 %py_comp $RPM_BUILD_ROOT%{_datadir}/ovsdbmonitor
194 %endif
195
196 %if %{with kernel}
197 cd datapath/linux
198 %install_kernel_modules -m openvswitch -d kernel/net/openvswitch
199 %endif
200
201 %clean
202 rm -rf $RPM_BUILD_ROOT
203
204 %post
205 /sbin/chkconfig --add openvswitch
206 %service -n openvswitch restart
207 NORESTART=1
208 %systemd_post openvswitch.service
209
210 %preun
211 if [ "$1" = "0" ]; then
212         %service -q openvswitch stop
213         /sbin/chkconfig --del openvswitch
214 fi
215 %systemd_preun openvswitch.service
216
217 %postun
218 %systemd_reload
219
220 %post   -n kernel%{_alt_kernel}-net-openvswitch
221 %depmod %{_kernel_ver}
222
223 %postun -n kernel%{_alt_kernel}-net-openvswitch
224 %depmod %{_kernel_ver}
225
226 %if %{with userspace}
227 %files
228 %defattr(644,root,root,755)
229 %doc INSTALL INSTALL.KVM INSTALL.SSL INSTALL.Libvirt INSTALL.XenServer INSTALL.userspace
230 %doc AUTHORS DESIGN NEWS README IntegrationGuide OPENFLOW-1.1+
231 %doc REPORTING-BUGS WHY-OVS README.PLD FAQ
232 %attr(755,root,root) /lib/rc-scripts/ifdown-ovs
233 %attr(755,root,root) /lib/rc-scripts/ifup-ovs
234 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/openvswitch
235 %{systemdtmpfilesdir}/openvswitch.conf
236 %{systemdunitdir}/openvswitch.service
237 %dir %{_datadir}/%{pname}
238 %{_datadir}/%{pname}/pki
239 %dir %{_datadir}/%{pname}/scripts
240 %attr(755,root,root) %{_datadir}/%{pname}/scripts/*
241 %{_datadir}/%{pname}/bugtool-plugins
242 %{_datadir}/%{pname}/vswitch.ovsschema
243
244 %attr(754,root,root) /etc/rc.d/init.d/openvswitch
245 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/openvswitch
246
247 %attr(755,root,root) %{_bindir}/ovs-appctl
248 %attr(755,root,root) %{_bindir}/ovs-benchmark
249 %attr(755,root,root) %{_bindir}/ovs-controller
250 %attr(755,root,root) %{_bindir}/ovs-dpctl
251 %attr(755,root,root) %{_bindir}/ovs-dpctl-top
252 %attr(755,root,root) %{_bindir}/ovs-l3ping
253 %attr(755,root,root) %{_bindir}/ovs-ofctl
254 %attr(755,root,root) %{_bindir}/ovs-parse-backtrace
255 %attr(755,root,root) %{_bindir}/ovs-pcap
256 %attr(755,root,root) %{_bindir}/ovs-pki
257 %attr(755,root,root) %{_bindir}/ovs-tcpundump
258 %attr(755,root,root) %{_bindir}/ovs-vsctl
259 %attr(755,root,root) %{_bindir}/ovsdb-client
260 %attr(755,root,root) %{_bindir}/ovsdb-tool
261 %attr(755,root,root) %{_sbindir}/ovs-bugtool
262 %attr(755,root,root) %{_sbindir}/ovs-vlan-bug-workaround
263 %attr(755,root,root) %{_sbindir}/ovs-vswitchd
264 %attr(755,root,root) %{_sbindir}/ovsdb-server
265 %{_mandir}/man1/ovs-benchmark.1*
266 %{_mandir}/man1/ovs-pcap.1*
267 %{_mandir}/man1/ovs-tcpundump.1*
268 %{_mandir}/man1/ovsdb-client.1*
269 %{_mandir}/man1/ovsdb-server.1*
270 %{_mandir}/man1/ovsdb-tool.1*
271 %{_mandir}/man5/ovs-vswitchd.conf.db.5*
272 %{_mandir}/man8/ovs-appctl.8*
273 %{_mandir}/man8/ovs-bugtool.8*
274 %{_mandir}/man8/ovs-controller.8*
275 %{_mandir}/man8/ovs-ctl.8*
276 %{_mandir}/man8/ovs-dpctl.8*
277 %{_mandir}/man8/ovs-dpctl-top.8*
278 %{_mandir}/man8/ovs-l3ping.8*
279 %{_mandir}/man8/ovs-ofctl.8*
280 %{_mandir}/man8/ovs-parse-backtrace.8*
281 %{_mandir}/man8/ovs-pki.8*
282 %{_mandir}/man8/ovs-vlan-bug-workaround.8*
283 %{_mandir}/man8/ovs-vlan-test.8*
284 %{_mandir}/man8/ovs-vsctl.8*
285 %{_mandir}/man8/ovs-vswitchd.8*
286
287 %files -n python-openvswitch
288 %defattr(644,root,root,755)
289 %dir %{py_sitescriptdir}/ovs
290 %{py_sitescriptdir}/ovs/*.py*
291 %dir %{py_sitescriptdir}/ovs/db
292 %{py_sitescriptdir}/ovs/db/*.py*
293 %dir %{py_sitescriptdir}/ovs/unixctl
294 %{py_sitescriptdir}/ovs/unixctl/*.py*
295
296 %files -n ovsdbmonitor
297 %defattr(644,root,root,755)
298 %attr(755,root,root) %{_bindir}/ovsdbmonitor
299 %{_datadir}/ovsdbmonitor
300 %{_desktopdir}/ovsdbmonitor.desktop
301 %{_mandir}/man1/ovsdbmonitor.1*
302
303 %files test
304 %defattr(644,root,root,755)
305 %attr(755,root,root) %{_bindir}/ovs-test
306 %attr(755,root,root) %{_bindir}/ovs-vlan-test
307 %{py_sitescriptdir}/ovstest
308 %{_mandir}/man8/ovs-test.8*
309 %endif
310
311 %if %{with kernel}
312 %files -n kernel%{_alt_kernel}-net-openvswitch
313 %defattr(644,root,root,755)
314 %dir /lib/modules/%{_kernel_ver}/kernel/net/openvswitch
315 /lib/modules/%{_kernel_ver}/kernel/net/openvswitch/*.ko*
316 %endif
This page took 0.0523749999999999 seconds and 4 git commands to generate.