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