]> git.pld-linux.org Git - packages/open-vm-tools.git/blob - open-vm-tools.spec
- separate apidocs subpackage
[packages/open-vm-tools.git] / open-vm-tools.spec
1 #
2 # Conditional build:
3 %bcond_without  apidocs         # without API docs
4 %bcond_without  kernel          # without kernel modules
5 %bcond_without  userspace       # without userspace package
6 %bcond_with     verbose         # verbose build (V=1)
7 %bcond_with     x               # build with X11 support
8
9 # The goal here is to have main, userspace, package built once with
10 # simple release number, and only rebuild kernel packages with kernel
11 # version as part of release number, without the need to bump release
12 # with every kernel change.
13 %if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace}
14 %{error:kernel and userspace cannot be built at the same time on PLD builders}
15 exit 1
16 %endif
17
18 %if %{without userspace}
19 # nothing to be placed to debuginfo package
20 %define         _enable_debug_packages  0
21 %endif
22
23 %define         snap    2011.10.26
24 %define         subver  %(echo %{snap} | tr -d .)
25 %define         ver     9.4.6
26 %define         rev     1770165
27 %define         rel     14
28 %define         pname   open-vm-tools
29 %define         modsrc  modules/linux
30 Summary:        VMWare guest utilities
31 Summary(pl.UTF-8):      Narzędzia dla systemu-gościa dla VMware
32 Name:           %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
33 Version:        %{ver}
34 #Release:       0.%{subver}.%{rel}%{?with_kernel:@%{_kernel_ver_str}}
35 Release:        %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
36 Epoch:          1
37 License:        GPL
38 Group:          Applications/System
39 Source0:        http://downloads.sourceforge.net/project/open-vm-tools/open-vm-tools/stable-9.4.x/%{pname}-%{ver}-%{rev}.tar.gz
40 # Source0-md5:  3969daf1535d34e1c5f0c87a779b7642
41 #Source0:       http://downloads.sourceforge.net/open-vm-tools/open-vm-tools/%{snap}/%{pname}-%{snap}-%{rev}.tar.gz
42 Source1:        %{pname}-packaging
43 Source2:        %{pname}-modprobe.d
44 Source3:        %{pname}-init
45 Source4:        %{pname}-vmware-user.desktop
46 Patch0:         %{pname}-linux-3.10.patch
47 Patch2:         %{pname}-linux-3.12.patch
48 Patch3:         %{pname}-linux-3.14.patch
49 Patch4:         %{pname}-linux-3.15.patch
50 Patch5:         %{pname}-linux-3.16.patch
51 Patch6:         %{pname}-linux-3.18.3.patch
52 Patch7:         gcc5.patch
53 URL:            http://open-vm-tools.sourceforge.net/
54 BuildRequires:  rpmbuild(macros) >= 1.701
55 %if %{with userspace}
56 BuildRequires:  autoconf
57 BuildRequires:  doxygen
58 BuildRequires:  glib2-devel >= 2.6.0
59 %if %{with x}
60 BuildRequires:  gtk+2-devel
61 BuildRequires:  gtkmm-devel >= 2.4.0
62 %endif
63 BuildRequires:  libdnet-devel
64 BuildRequires:  libfuse-devel
65 BuildRequires:  libicu-devel
66 BuildRequires:  libnotify-devel
67 BuildRequires:  libpng-devel
68 BuildRequires:  libstdc++-devel
69 BuildRequires:  pam-devel
70 BuildRequires:  pkgconfig
71 BuildRequires:  procps-devel >= 1:3.3.3-2
72 BuildRequires:  uriparser-devel
73 %if %{with x}
74 BuildRequires:  xorg-lib-libSM-devel
75 BuildRequires:  xorg-lib-libX11-devel
76 BuildRequires:  xorg-lib-libXScrnSaver-devel
77 BuildRequires:  xorg-lib-libXinerama-devel
78 BuildRequires:  xorg-lib-libXrandr-devel
79 BuildRequires:  xorg-lib-libXtst-devel
80 %endif
81 Requires:       ethtool
82 Requires:       libdnet
83 Requires:       libicu
84 Obsoletes:      kernel-misc-pvscsi
85 Obsoletes:      kernel-misc-vmmemctl
86 %endif
87 %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
88 ExclusiveArch:  %{ix86} %{x8664} %{?with_kernel:x32}
89 BuildRoot:      %{tmpdir}/%{pname}-%{version}-root-%(id -u -n)
90
91 %description
92 VMWare guest utilities.
93
94 %description -l pl.UTF-8
95 Narzędzia dla systemu-gościa dla VMware.
96
97 %package devel
98 Summary:        Header files for open-vm-tools
99 Summary(pl.UTF-8):      Pliki nagłówkowe open-vm-tools
100 Group:          Development/Libraries
101 Requires:       %{pname} = %{epoch}:%{version}-%{release}
102
103 %description devel
104 Header files for open-vm-tools.
105
106 %description devel -l pl.UTF-8
107 Pliki nagłówkowe open-vm-tools.
108
109 %package static
110 Summary:        Static open-vm-tools libraries
111 Summary(pl.UTF-8):      Statyczne biblioteki open-vm-tools
112 Group:          Development/Libraries
113 Requires:       %{pname}-devel = %{epoch}:%{version}-%{release}
114
115 %description static
116 Static open-vm-tools libraries.
117
118 %description static -l pl.UTF-8
119 Statyczne biblioteki open-vm-tools.
120
121 %package gui
122 Summary:        VMware guest utitities
123 Summary(pl.UTF-8):      Narzędzia dla systemu-gościa dla VMware.
124 Group:          Applications/System
125 Requires:       %{pname} = %{epoch}:%{version}-%{release}
126
127 %description gui
128 VMWare guest utilities. This package contains GUI part of tools.
129
130 %description gui -l pl.UTF-8
131 Narzędzia dla systemu-gościa dla VMware. Ten pakiet zawiera graficzną
132 część narzędzi.
133
134 %package apidocs
135 Summary:        VMware API documentation
136 Summary(pl.UTF-8):      Dokumentacja do API VMware
137 Group:          Documentation
138 Requires:       %{pname} = %{epoch}:%{version}-%{release}
139
140 %description apidocs
141 This package contains VMware API documentation.
142
143 %description apidocs -l pl.UTF-8
144 Ten pakiet zawiera dokumentację do API VMware.
145
146 %define kernel_pkg()\
147 %package -n kernel%{_alt_kernel}-misc-vmblock\
148 Summary:        VMware vmblock Linux kernel module\
149 Summary(pl.UTF-8):      Moduł jądra Linuksa VMware vmblock\
150 Release:        %{rel}@%{_kernel_ver_str}\
151 Group:          Base/Kernel\
152 Requires(post,postun):  /sbin/depmod\
153 Requires:       dev >= 2.9.0-7\
154 %requires_releq_kernel\
155 Requires(postun):       %releq_kernel\
156 \
157 %description -n kernel%{_alt_kernel}-misc-vmblock\
158 VMware vmblock Linux kernel module.\
159 \
160 %description -n kernel%{_alt_kernel}-misc-vmblock -l pl.UTF-8\
161 Moduł jądra Linuksa VMware vmblock.\
162 \
163 %package -n kernel%{_alt_kernel}-misc-vmci\
164 Summary:        VMware vmci Linux kernel module\
165 Summary(pl.UTF-8):      Moduł jądra Linuksa VMware vmci\
166 Release:        %{rel}@%{_kernel_ver_str}\
167 Group:          Base/Kernel\
168 Requires(post,postun):  /sbin/depmod\
169 Requires:       dev >= 2.9.0-7\
170 %requires_releq_kernel\
171 Requires(postun):       %releq_kernel\
172 \
173 %description -n kernel%{_alt_kernel}-misc-vmci\
174 VMware vmci Linux kernel module.\
175 \
176 %description -n kernel%{_alt_kernel}-misc-vmci -l pl.UTF-8\
177 Moduł jądra Linuksa VMware vmci.\
178 \
179 %package -n kernel%{_alt_kernel}-misc-vmhgfs\
180 Summary:        VMware vmhgfs Linux kernel module\
181 Summary(pl.UTF-8):      Moduł jądra Linuksa VMware vmhgfs\
182 Release:        %{rel}@%{_kernel_ver_str}\
183 Group:          Base/Kernel\
184 Requires(post,postun):  /sbin/depmod\
185 Requires:       dev >= 2.9.0-7\
186 %requires_releq_kernel\
187 Requires(postun):       %releq_kernel\
188 \
189 %description -n kernel%{_alt_kernel}-misc-vmhgfs\
190 VMware vmhgfs Linux kernel module.\
191 \
192 %description -n kernel%{_alt_kernel}-misc-vmhgfs -l pl.UTF-8\
193 Moduł jądra Linuksa VMware vmhgfs.\
194 \
195 %package -n kernel%{_alt_kernel}-misc-vmsync\
196 Summary:        VMware vmsync Linux kernel module\
197 Summary(pl.UTF-8):      Moduł jądra Linuksa VMware vmsync\
198 Release:        %{rel}@%{_kernel_ver_str}\
199 Group:          Base/Kernel\
200 Requires(post,postun):  /sbin/depmod\
201 Requires:       dev >= 2.9.0-7\
202 %requires_releq_kernel\
203 Requires(postun):       %releq_kernel\
204 \
205 %description -n kernel%{_alt_kernel}-misc-vmsync\
206 VMware vmsync Linux kernel module.\
207 \
208 %description -n kernel%{_alt_kernel}-misc-vmsync -l pl.UTF-8\
209 Moduł jądra Linuksa VMware vmsync.\
210 \
211 %package -n kernel%{_alt_kernel}-misc-vmxnet\
212 Summary:        VMware vmxnet Linux kernel module\
213 Summary(pl.UTF-8):      Moduł jądra Linuksa VMware vmxnet\
214 Release:        %{rel}@%{_kernel_ver_str}\
215 Group:          Base/Kernel\
216 Requires(post,postun):  /sbin/depmod\
217 Requires:       dev >= 2.9.0-7\
218 %requires_releq_kernel\
219 Requires(postun):       %releq_kernel\
220 \
221 %description -n kernel%{_alt_kernel}-misc-vmxnet\
222 VMware vmxnet Linux kernel module.\
223 \
224 %description -n kernel%{_alt_kernel}-misc-vmxnet -l pl.UTF-8\
225 Moduł jądra Linuksa VMware vmxnet.\
226 \
227 %package -n kernel%{_alt_kernel}-misc-vsock\
228 Summary:        VMware vsock Linux kernel module\
229 Summary(pl.UTF-8):      Moduł jądra Linuksa VMware vsock\
230 Release:        %{rel}@%{_kernel_ver_str}\
231 Group:          Base/Kernel\
232 Requires(post,postun):  /sbin/depmod\
233 Requires:       dev >= 2.9.0-7\
234 %requires_releq_kernel\
235 Requires(postun):       %releq_kernel\
236 \
237 %description -n kernel%{_alt_kernel}-misc-vsock\
238 VMware vsock Linux kernel module.\
239 \
240 %description -n kernel%{_alt_kernel}-misc-vsock -l pl.UTF-8\
241 Moduł jądra Linuksa VMware vsock.\
242 \
243 %if %{with kernel}\
244 %files -n kernel%{_alt_kernel}-misc-vmblock\
245 %defattr(644,root,root,755)\
246 /lib/modules/%{_kernel_ver}/misc/vmblock.ko*\
247 \
248 %files -n kernel%{_alt_kernel}-misc-vmhgfs\
249 %defattr(644,root,root,755)\
250 /lib/modules/%{_kernel_ver}/misc/vmhgfs.ko*\
251 \
252 %if %{_kernel_version_code} < %{_kernel_version_magic 3 10 0}\
253 %files -n kernel%{_alt_kernel}-misc-vmci\
254 %defattr(644,root,root,755)\
255 /lib/modules/%{_kernel_ver}/misc/vmci.ko*\
256 \
257 %files -n kernel%{_alt_kernel}-misc-vmsync\
258 %defattr(644,root,root,755)\
259 /lib/modules/%{_kernel_ver}/misc/vmsync.ko*\
260 %endif\
261 \
262 %files -n kernel%{_alt_kernel}-misc-vmxnet\
263 %defattr(644,root,root,755)\
264 /lib/modules/%{_kernel_ver}/misc/vmxnet.ko*\
265 \
266 %files -n kernel%{_alt_kernel}-misc-vsock\
267 %defattr(644,root,root,755)\
268 /lib/modules/%{_kernel_ver}/misc/vsock.ko*\
269 %endif\
270 \
271 %post   -n kernel%{_alt_kernel}-misc-vmblock\
272 %depmod %{_kernel_ver}\
273 \
274 %post   -n kernel%{_alt_kernel}-misc-vmci\
275 %depmod %{_kernel_ver}\
276 \
277 %post   -n kernel%{_alt_kernel}-misc-vmhgfs\
278 %depmod %{_kernel_ver}\
279 \
280 %post   -n kernel%{_alt_kernel}-misc-vmsync\
281 %depmod %{_kernel_ver}\
282 \
283 %post   -n kernel%{_alt_kernel}-misc-vmxnet\
284 %depmod %{_kernel_ver}\
285 \
286 %post   -n kernel%{_alt_kernel}-misc-vsock\
287 %depmod %{_kernel_ver}\
288 %{nil}
289
290 %define build_kernel_pkg()\
291 export OVT_SOURCE_DIR=$PWD\
292 %build_kernel_modules -C %{modsrc}/vmblock -m vmblock SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{cc_version}\
293 %build_kernel_modules -C %{modsrc}/vmhgfs -m vmhgfs SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{cc_version}\
294 %build_kernel_modules -C %{modsrc}/vmxnet -m vmxnet SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{cc_version}\
295 %build_kernel_modules -C %{modsrc}/vsock -m vsock SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{cc_version}\
296 %install_kernel_modules -D installed -m %{modsrc}/vmblock/vmblock -d misc\
297 %install_kernel_modules -D installed -m %{modsrc}/vmhgfs/vmhgfs -d misc\
298 %install_kernel_modules -D installed -m %{modsrc}/vmxnet/vmxnet -d misc\
299 %install_kernel_modules -D installed -m %{modsrc}/vsock/vsock -d misc\
300 %if %{_kernel_version_code} < %{_kernel_version_magic 3 10 0}\
301 %build_kernel_modules -C %{modsrc}/vmci -m vmci SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{cc_version}\
302 %build_kernel_modules -C %{modsrc}/vmsync -m vmsync SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{cc_version}\
303 %install_kernel_modules -D installed -m %{modsrc}/vmci/vmci -d misc\
304 %install_kernel_modules -D installed -m %{modsrc}/vmsync/vmsync -d misc\
305 %endif\
306 %{nil}
307
308 %{?with_kernel:%{expand:%create_kernel_packages}}
309
310 %prep
311 #setup -q -n %{pname}-%{snap}-%{rev}
312 %setup -q -n %{pname}-%{ver}-%{rev}
313 %patch0 -p1
314 %patch2 -p1
315 %patch3 -p1
316 %patch4 -p1
317 %patch5 -p1
318 %patch6 -p1
319 %patch7 -p1
320
321 cp %{SOURCE1} packaging
322 %{__sed} -i -e 's|##{BUILD_OUTPUT}##|build|' docs/api/doxygen.conf
323
324 %build
325 %{?with_kernel:%{expand:%build_kernel_packages}}
326
327 %if %{with userspace}
328 rm -rf autom4te.cache
329 install -d config
330 %{__libtoolize}
331 %{__aclocal} -I m4
332 %{__automake}
333 %{__autoconf}
334 export CUSTOM_PROCPS_NAME=procps
335 %configure2_13 \
336         --without-kernel-modules \
337 %if %{with x}
338         --with-x
339 %else
340         --without-x
341 %endif
342 %{__make} \
343         CFLAGS="%{rpmcflags} -Wno-unused-but-set-variable" \
344         CXXFLAGS="%{rpmcxxflags} -std=c++11 -Wno-unused-but-set-variable"
345 %endif
346
347 %install
348 rm -rf $RPM_BUILD_ROOT
349
350 %if %{with kernel}
351 install -d $RPM_BUILD_ROOT
352 cp -a installed/* $RPM_BUILD_ROOT
353 %endif
354
355 %if %{with userspace}
356 %{__make} install \
357         DESTDIR=$RPM_BUILD_ROOT
358
359 rm $RPM_BUILD_ROOT/sbin/mount.vmhgfs
360 ln -sf %{_sbindir}/mount.vmhgfs $RPM_BUILD_ROOT/sbin/mount.vmhgfs
361 rm -f $RPM_BUILD_ROOT%{_libdir}/open-vm-tools/plugins/common/*.la
362
363 #mkdir -p docs/%{name}-%{version}/api
364 #mv docs/api/build/html docs/%{name}-%{version}/api
365 %{__rm} -r $RPM_BUILD_ROOT/usr/share/doc/%{pname}
366
367 install -d $RPM_BUILD_ROOT/etc/{modprobe.d,rc.d/init.d,xdg/autostart}
368 cp %{SOURCE2} $RPM_BUILD_ROOT/etc/modprobe.d/%{pname}.conf
369 cp %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{pname}
370 cp %{SOURCE4} $RPM_BUILD_ROOT/etc/xdg/autostart/vmware-user.desktop
371 %endif
372
373 %clean
374 rm -rf $RPM_BUILD_ROOT
375
376 %post
377 /sbin/ldconfig
378 /sbin/chkconfig --add open-vm-tools
379 %service open-vm-tools restart "Open Virtual Machine"
380
381 %preun
382 if [ "$1" = "0" ]; then
383         %service open-vm-tools stop
384         /sbin/chkconfig --del open-vm-tools
385 fi
386
387 %postun -p /sbin/ldconfig
388
389 %if %{with userspace}
390 %files
391 %defattr(644,root,root,755)
392 %doc AUTHORS ChangeLog NEWS README packaging
393 %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/vmtoolsd
394 %dir /etc/vmware-tools
395 %attr(755,root,root) /etc/vmware-tools/*vm-*
396 %attr(755,root,root) /etc/vmware-tools/statechange.subr
397 %dir /etc/vmware-tools/scripts
398 %dir /etc/vmware-tools/scripts/vmware
399 %attr(755,root,root) /etc/vmware-tools/scripts/vmware/network
400 %attr(755,root,root) /sbin/mount.vmhgfs
401 %attr(755,root,root) %{_bindir}/vmtoolsd
402 %attr(755,root,root) %{_bindir}/vmware-checkvm
403 %attr(755,root,root) %{_bindir}/vmware-hgfsclient
404 %attr(755,root,root) %{_bindir}/vmware-rpctool
405 %attr(755,root,root) %{_bindir}/vmware-toolbox-cmd
406 %if %{with x}
407 %attr(4755,root,root) %{_bindir}/vmware-user-suid-wrapper
408 %endif
409 %attr(755,root,root) %{_bindir}/vmware-xferlogs
410 %attr(755,root,root) %{_bindir}/vmware-vmblock-fuse
411 %attr(755,root,root) %{_sbindir}/mount.vmhgfs
412 %attr(755,root,root) %{_libdir}/libguestlib.so.*.*.*
413 %attr(755,root,root) %ghost %{_libdir}/libguestlib.so.0
414 %attr(755,root,root) %{_libdir}/libvmtools.so.*.*.*
415 %attr(755,root,root) %ghost %{_libdir}/libvmtools.so.0
416 %attr(755,root,root) %{_libdir}/libhgfs.so.*.*.*
417 %attr(755,root,root) %ghost %{_libdir}/libhgfs.so.0
418 %dir %{_libdir}/open-vm-tools
419 %dir %{_libdir}/open-vm-tools/plugins
420 %dir %{_libdir}/open-vm-tools/plugins/vmsvc
421 %attr(755,root,root) %{_libdir}/open-vm-tools/plugins/vmsvc/libguestInfo.so
422 %attr(755,root,root) %{_libdir}/open-vm-tools/plugins/vmsvc/libpowerOps.so
423 %attr(755,root,root) %{_libdir}/open-vm-tools/plugins/vmsvc/libtimeSync.so
424 %attr(755,root,root) %{_libdir}/open-vm-tools/plugins/vmsvc/libvmbackup.so
425 %dir %{_libdir}/open-vm-tools/plugins/common
426 %attr(755,root,root) %{_libdir}/open-vm-tools/plugins/common/libhgfsServer.so
427 %attr(755,root,root) %{_libdir}/open-vm-tools/plugins/common/libvix.so
428 %if %{with x}
429 %dir %{_libdir}/open-vm-tools/plugins/vmusr
430 %attr(755,root,root) %{_libdir}/open-vm-tools/plugins/vmusr/libdesktopEvents.so
431 %attr(755,root,root) %{_libdir}/open-vm-tools/plugins/vmusr/libdndcp.so
432 %attr(755,root,root) %{_libdir}/open-vm-tools/plugins/vmusr/libresolutionSet.so
433 %endif
434 %attr(754,root,root) /etc/rc.d/init.d/%{pname}
435 /etc/modprobe.d/%{pname}.conf
436 %dir %{_datadir}/open-vm-tools
437 %dir %{_datadir}/open-vm-tools/messages
438 %lang(de) %{_datadir}/open-vm-tools/messages/de
439 %lang(ja) %{_datadir}/open-vm-tools/messages/ja
440 %lang(ko) %{_datadir}/open-vm-tools/messages/ko
441 %lang(zh_CN) %{_datadir}/open-vm-tools/messages/zh_CN
442
443 %files devel
444 %defattr(644,root,root,755)
445 %attr(755,root,root) %{_libdir}/libguestlib.so
446 %attr(755,root,root) %{_libdir}/libvmtools.so
447 %attr(755,root,root) %{_libdir}/libhgfs.so
448 %dir %{_includedir}/vmGuestLib
449 %{_includedir}/vmGuestLib/includeCheck.h
450 %{_includedir}/vmGuestLib/vmGuestLib.h
451 %{_includedir}/vmGuestLib/vmSessionId.h
452 %{_includedir}/vmGuestLib/vm_basic_types.h
453 %{_libdir}/libguestlib.la
454 %{_libdir}/libvmtools.la
455 %{_libdir}/libhgfs.la
456 %{_pkgconfigdir}/vmguestlib.pc
457
458 %files static
459 %defattr(644,root,root,755)
460 %{_libdir}/libguestlib.a
461 %{_libdir}/libvmtools.a
462 %{_libdir}/libhgfs.a
463
464 %files gui
465 %defattr(644,root,root,755)
466 %{_sysconfdir}/xdg/autostart/vmware-user.desktop
467
468 %if %{with apidocs}
469 %files apidocs
470 %defattr(644,root,root,755)
471 %doc docs/api/build/html/*
472 %endif
473 %endif
This page took 0.069821 seconds and 3 git commands to generate.