]> git.pld-linux.org Git - packages/open-vm-tools.git/blob - open-vm-tools.spec
- release 16 (by relup.sh)
[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     16
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 %if "%{_rpmversion}" >= "5"
140 BuildArch:      noarch
141 %endif
142
143 %description apidocs
144 This package contains VMware API documentation.
145
146 %description apidocs -l pl.UTF-8
147 Ten pakiet zawiera dokumentację do API VMware.
148
149 %define kernel_pkg()\
150 %package -n kernel%{_alt_kernel}-misc-vmblock\
151 Summary:        VMware vmblock Linux kernel module\
152 Summary(pl.UTF-8):      Moduł jądra Linuksa VMware vmblock\
153 Release:        %{rel}@%{_kernel_ver_str}\
154 Group:          Base/Kernel\
155 Requires(post,postun):  /sbin/depmod\
156 Requires:       dev >= 2.9.0-7\
157 %requires_releq_kernel\
158 Requires(postun):       %releq_kernel\
159 \
160 %description -n kernel%{_alt_kernel}-misc-vmblock\
161 VMware vmblock Linux kernel module.\
162 \
163 %description -n kernel%{_alt_kernel}-misc-vmblock -l pl.UTF-8\
164 Moduł jądra Linuksa VMware vmblock.\
165 \
166 %package -n kernel%{_alt_kernel}-misc-vmci\
167 Summary:        VMware vmci Linux kernel module\
168 Summary(pl.UTF-8):      Moduł jądra Linuksa VMware vmci\
169 Release:        %{rel}@%{_kernel_ver_str}\
170 Group:          Base/Kernel\
171 Requires(post,postun):  /sbin/depmod\
172 Requires:       dev >= 2.9.0-7\
173 %requires_releq_kernel\
174 Requires(postun):       %releq_kernel\
175 \
176 %description -n kernel%{_alt_kernel}-misc-vmci\
177 VMware vmci Linux kernel module.\
178 \
179 %description -n kernel%{_alt_kernel}-misc-vmci -l pl.UTF-8\
180 Moduł jądra Linuksa VMware vmci.\
181 \
182 %package -n kernel%{_alt_kernel}-misc-vmhgfs\
183 Summary:        VMware vmhgfs Linux kernel module\
184 Summary(pl.UTF-8):      Moduł jądra Linuksa VMware vmhgfs\
185 Release:        %{rel}@%{_kernel_ver_str}\
186 Group:          Base/Kernel\
187 Requires(post,postun):  /sbin/depmod\
188 Requires:       dev >= 2.9.0-7\
189 %requires_releq_kernel\
190 Requires(postun):       %releq_kernel\
191 \
192 %description -n kernel%{_alt_kernel}-misc-vmhgfs\
193 VMware vmhgfs Linux kernel module.\
194 \
195 %description -n kernel%{_alt_kernel}-misc-vmhgfs -l pl.UTF-8\
196 Moduł jądra Linuksa VMware vmhgfs.\
197 \
198 %package -n kernel%{_alt_kernel}-misc-vmsync\
199 Summary:        VMware vmsync Linux kernel module\
200 Summary(pl.UTF-8):      Moduł jądra Linuksa VMware vmsync\
201 Release:        %{rel}@%{_kernel_ver_str}\
202 Group:          Base/Kernel\
203 Requires(post,postun):  /sbin/depmod\
204 Requires:       dev >= 2.9.0-7\
205 %requires_releq_kernel\
206 Requires(postun):       %releq_kernel\
207 \
208 %description -n kernel%{_alt_kernel}-misc-vmsync\
209 VMware vmsync Linux kernel module.\
210 \
211 %description -n kernel%{_alt_kernel}-misc-vmsync -l pl.UTF-8\
212 Moduł jądra Linuksa VMware vmsync.\
213 \
214 %package -n kernel%{_alt_kernel}-misc-vmxnet\
215 Summary:        VMware vmxnet Linux kernel module\
216 Summary(pl.UTF-8):      Moduł jądra Linuksa VMware vmxnet\
217 Release:        %{rel}@%{_kernel_ver_str}\
218 Group:          Base/Kernel\
219 Requires(post,postun):  /sbin/depmod\
220 Requires:       dev >= 2.9.0-7\
221 %requires_releq_kernel\
222 Requires(postun):       %releq_kernel\
223 \
224 %description -n kernel%{_alt_kernel}-misc-vmxnet\
225 VMware vmxnet Linux kernel module.\
226 \
227 %description -n kernel%{_alt_kernel}-misc-vmxnet -l pl.UTF-8\
228 Moduł jądra Linuksa VMware vmxnet.\
229 \
230 %package -n kernel%{_alt_kernel}-misc-vsock\
231 Summary:        VMware vsock Linux kernel module\
232 Summary(pl.UTF-8):      Moduł jądra Linuksa VMware vsock\
233 Release:        %{rel}@%{_kernel_ver_str}\
234 Group:          Base/Kernel\
235 Requires(post,postun):  /sbin/depmod\
236 Requires:       dev >= 2.9.0-7\
237 %requires_releq_kernel\
238 Requires(postun):       %releq_kernel\
239 \
240 %description -n kernel%{_alt_kernel}-misc-vsock\
241 VMware vsock Linux kernel module.\
242 \
243 %description -n kernel%{_alt_kernel}-misc-vsock -l pl.UTF-8\
244 Moduł jądra Linuksa VMware vsock.\
245 \
246 %if %{with kernel}\
247 %files -n kernel%{_alt_kernel}-misc-vmblock\
248 %defattr(644,root,root,755)\
249 /lib/modules/%{_kernel_ver}/misc/vmblock.ko*\
250 \
251 %files -n kernel%{_alt_kernel}-misc-vmhgfs\
252 %defattr(644,root,root,755)\
253 /lib/modules/%{_kernel_ver}/misc/vmhgfs.ko*\
254 \
255 %if %{_kernel_version_code} < %{_kernel_version_magic 3 10 0}\
256 %files -n kernel%{_alt_kernel}-misc-vmci\
257 %defattr(644,root,root,755)\
258 /lib/modules/%{_kernel_ver}/misc/vmci.ko*\
259 \
260 %files -n kernel%{_alt_kernel}-misc-vmsync\
261 %defattr(644,root,root,755)\
262 /lib/modules/%{_kernel_ver}/misc/vmsync.ko*\
263 %endif\
264 \
265 %files -n kernel%{_alt_kernel}-misc-vmxnet\
266 %defattr(644,root,root,755)\
267 /lib/modules/%{_kernel_ver}/misc/vmxnet.ko*\
268 \
269 %files -n kernel%{_alt_kernel}-misc-vsock\
270 %defattr(644,root,root,755)\
271 /lib/modules/%{_kernel_ver}/misc/vsock.ko*\
272 %endif\
273 \
274 %post   -n kernel%{_alt_kernel}-misc-vmblock\
275 %depmod %{_kernel_ver}\
276 \
277 %post   -n kernel%{_alt_kernel}-misc-vmci\
278 %depmod %{_kernel_ver}\
279 \
280 %post   -n kernel%{_alt_kernel}-misc-vmhgfs\
281 %depmod %{_kernel_ver}\
282 \
283 %post   -n kernel%{_alt_kernel}-misc-vmsync\
284 %depmod %{_kernel_ver}\
285 \
286 %post   -n kernel%{_alt_kernel}-misc-vmxnet\
287 %depmod %{_kernel_ver}\
288 \
289 %post   -n kernel%{_alt_kernel}-misc-vsock\
290 %depmod %{_kernel_ver}\
291 %{nil}
292
293 %define build_kernel_pkg()\
294 export OVT_SOURCE_DIR=$PWD\
295 %build_kernel_modules -C %{modsrc}/vmblock -m vmblock SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{cc_version}\
296 %build_kernel_modules -C %{modsrc}/vmhgfs -m vmhgfs SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{cc_version}\
297 %build_kernel_modules -C %{modsrc}/vmxnet -m vmxnet SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{cc_version}\
298 %build_kernel_modules -C %{modsrc}/vsock -m vsock SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{cc_version}\
299 %install_kernel_modules -D installed -m %{modsrc}/vmblock/vmblock -d misc\
300 %install_kernel_modules -D installed -m %{modsrc}/vmhgfs/vmhgfs -d misc\
301 %install_kernel_modules -D installed -m %{modsrc}/vmxnet/vmxnet -d misc\
302 %install_kernel_modules -D installed -m %{modsrc}/vsock/vsock -d misc\
303 %if %{_kernel_version_code} < %{_kernel_version_magic 3 10 0}\
304 %build_kernel_modules -C %{modsrc}/vmci -m vmci SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{cc_version}\
305 %build_kernel_modules -C %{modsrc}/vmsync -m vmsync SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{cc_version}\
306 %install_kernel_modules -D installed -m %{modsrc}/vmci/vmci -d misc\
307 %install_kernel_modules -D installed -m %{modsrc}/vmsync/vmsync -d misc\
308 %endif\
309 %{nil}
310
311 %{?with_kernel:%{expand:%create_kernel_packages}}
312
313 %prep
314 #setup -q -n %{pname}-%{snap}-%{rev}
315 %setup -q -n %{pname}-%{ver}-%{rev}
316 %patch0 -p1
317 %patch2 -p1
318 %patch3 -p1
319 %patch4 -p1
320 %patch5 -p1
321 %patch6 -p1
322 %patch7 -p1
323
324 cp %{SOURCE1} packaging
325 %{__sed} -i -e 's|##{BUILD_OUTPUT}##|build|' docs/api/doxygen.conf
326
327 %build
328 %{?with_kernel:%{expand:%build_kernel_packages}}
329
330 %if %{with userspace}
331 rm -rf autom4te.cache
332 install -d config
333 %{__libtoolize}
334 %{__aclocal} -I m4
335 %{__automake}
336 %{__autoconf}
337 export CUSTOM_PROCPS_NAME=procps
338 %configure2_13 \
339         --without-kernel-modules \
340 %if %{with x}
341         --with-x
342 %else
343         --without-x
344 %endif
345 %{__make} \
346         CFLAGS="%{rpmcflags} -Wno-unused-but-set-variable" \
347         CXXFLAGS="%{rpmcxxflags} -std=c++11 -Wno-unused-but-set-variable"
348 %endif
349
350 %install
351 rm -rf $RPM_BUILD_ROOT
352
353 %if %{with kernel}
354 install -d $RPM_BUILD_ROOT
355 cp -a installed/* $RPM_BUILD_ROOT
356 %endif
357
358 %if %{with userspace}
359 %{__make} install \
360         DESTDIR=$RPM_BUILD_ROOT
361
362 rm $RPM_BUILD_ROOT/sbin/mount.vmhgfs
363 ln -sf %{_sbindir}/mount.vmhgfs $RPM_BUILD_ROOT/sbin/mount.vmhgfs
364 rm -f $RPM_BUILD_ROOT%{_libdir}/open-vm-tools/plugins/common/*.la
365
366 #mkdir -p docs/%{name}-%{version}/api
367 #mv docs/api/build/html docs/%{name}-%{version}/api
368 %{__rm} -r $RPM_BUILD_ROOT/usr/share/doc/%{pname}
369
370 install -d $RPM_BUILD_ROOT/etc/{modprobe.d,rc.d/init.d,xdg/autostart}
371 cp %{SOURCE2} $RPM_BUILD_ROOT/etc/modprobe.d/%{pname}.conf
372 cp %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{pname}
373 cp %{SOURCE4} $RPM_BUILD_ROOT/etc/xdg/autostart/vmware-user.desktop
374 %endif
375
376 %clean
377 rm -rf $RPM_BUILD_ROOT
378
379 %post
380 /sbin/ldconfig
381 /sbin/chkconfig --add open-vm-tools
382 %service open-vm-tools restart "Open Virtual Machine"
383
384 %preun
385 if [ "$1" = "0" ]; then
386         %service open-vm-tools stop
387         /sbin/chkconfig --del open-vm-tools
388 fi
389
390 %postun -p /sbin/ldconfig
391
392 %if %{with userspace}
393 %files
394 %defattr(644,root,root,755)
395 %doc AUTHORS ChangeLog NEWS README packaging
396 %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/vmtoolsd
397 %dir /etc/vmware-tools
398 %attr(755,root,root) /etc/vmware-tools/*vm-*
399 %attr(755,root,root) /etc/vmware-tools/statechange.subr
400 %dir /etc/vmware-tools/scripts
401 %dir /etc/vmware-tools/scripts/vmware
402 %attr(755,root,root) /etc/vmware-tools/scripts/vmware/network
403 %attr(755,root,root) /sbin/mount.vmhgfs
404 %attr(755,root,root) %{_bindir}/vmtoolsd
405 %attr(755,root,root) %{_bindir}/vmware-checkvm
406 %attr(755,root,root) %{_bindir}/vmware-hgfsclient
407 %attr(755,root,root) %{_bindir}/vmware-rpctool
408 %attr(755,root,root) %{_bindir}/vmware-toolbox-cmd
409 %if %{with x}
410 %attr(4755,root,root) %{_bindir}/vmware-user-suid-wrapper
411 %endif
412 %attr(755,root,root) %{_bindir}/vmware-xferlogs
413 %attr(755,root,root) %{_bindir}/vmware-vmblock-fuse
414 %attr(755,root,root) %{_sbindir}/mount.vmhgfs
415 %attr(755,root,root) %{_libdir}/libguestlib.so.*.*.*
416 %attr(755,root,root) %ghost %{_libdir}/libguestlib.so.0
417 %attr(755,root,root) %{_libdir}/libvmtools.so.*.*.*
418 %attr(755,root,root) %ghost %{_libdir}/libvmtools.so.0
419 %attr(755,root,root) %{_libdir}/libhgfs.so.*.*.*
420 %attr(755,root,root) %ghost %{_libdir}/libhgfs.so.0
421 %dir %{_libdir}/open-vm-tools
422 %dir %{_libdir}/open-vm-tools/plugins
423 %dir %{_libdir}/open-vm-tools/plugins/vmsvc
424 %attr(755,root,root) %{_libdir}/open-vm-tools/plugins/vmsvc/libguestInfo.so
425 %attr(755,root,root) %{_libdir}/open-vm-tools/plugins/vmsvc/libpowerOps.so
426 %attr(755,root,root) %{_libdir}/open-vm-tools/plugins/vmsvc/libtimeSync.so
427 %attr(755,root,root) %{_libdir}/open-vm-tools/plugins/vmsvc/libvmbackup.so
428 %dir %{_libdir}/open-vm-tools/plugins/common
429 %attr(755,root,root) %{_libdir}/open-vm-tools/plugins/common/libhgfsServer.so
430 %attr(755,root,root) %{_libdir}/open-vm-tools/plugins/common/libvix.so
431 %if %{with x}
432 %dir %{_libdir}/open-vm-tools/plugins/vmusr
433 %attr(755,root,root) %{_libdir}/open-vm-tools/plugins/vmusr/libdesktopEvents.so
434 %attr(755,root,root) %{_libdir}/open-vm-tools/plugins/vmusr/libdndcp.so
435 %attr(755,root,root) %{_libdir}/open-vm-tools/plugins/vmusr/libresolutionSet.so
436 %endif
437 %attr(754,root,root) /etc/rc.d/init.d/%{pname}
438 /etc/modprobe.d/%{pname}.conf
439 %dir %{_datadir}/open-vm-tools
440 %dir %{_datadir}/open-vm-tools/messages
441 %lang(de) %{_datadir}/open-vm-tools/messages/de
442 %lang(ja) %{_datadir}/open-vm-tools/messages/ja
443 %lang(ko) %{_datadir}/open-vm-tools/messages/ko
444 %lang(zh_CN) %{_datadir}/open-vm-tools/messages/zh_CN
445
446 %files devel
447 %defattr(644,root,root,755)
448 %attr(755,root,root) %{_libdir}/libguestlib.so
449 %attr(755,root,root) %{_libdir}/libvmtools.so
450 %attr(755,root,root) %{_libdir}/libhgfs.so
451 %dir %{_includedir}/vmGuestLib
452 %{_includedir}/vmGuestLib/includeCheck.h
453 %{_includedir}/vmGuestLib/vmGuestLib.h
454 %{_includedir}/vmGuestLib/vmSessionId.h
455 %{_includedir}/vmGuestLib/vm_basic_types.h
456 %{_libdir}/libguestlib.la
457 %{_libdir}/libvmtools.la
458 %{_libdir}/libhgfs.la
459 %{_pkgconfigdir}/vmguestlib.pc
460
461 %files static
462 %defattr(644,root,root,755)
463 %{_libdir}/libguestlib.a
464 %{_libdir}/libvmtools.a
465 %{_libdir}/libhgfs.a
466
467 %files gui
468 %defattr(644,root,root,755)
469 %{_sysconfdir}/xdg/autostart/vmware-user.desktop
470
471 %if %{with apidocs}
472 %files apidocs
473 %defattr(644,root,root,755)
474 %doc docs/api/build/html/*
475 %endif
476 %endif
This page took 0.066015 seconds and 3 git commands to generate.