]> git.pld-linux.org Git - packages/VMware-player.git/blob - VMware-player.spec
ed98f2fb7d253f61bd2b167f81a773a9e14ea6b2
[packages/VMware-player.git] / VMware-player.spec
1 #
2 # Conditional build:
3 %bcond_without  dist_kernel     # without distribution kernel
4 %bcond_without  kernel          # don't build kernel modules
5 %bcond_without  userspace       # don't build userspace utilities
6 %bcond_with     internal_libs   # internal libs stuff
7 %bcond_with     verbose         # verbose build (V=1)
8 #
9 %include        /usr/lib/rpm/macros.perl
10
11 %ifarch %{x8664}
12 %undefine       with_userspace
13 %endif
14 #
15 %define         _ver    2.0.1
16 %define         _build  55017
17 %define         _rel    0.1
18 %define         _urel   113
19 %define         _ccver  %(rpm -q --qf "%{VERSION}" gcc)
20 #
21 Summary:        VMware player
22 Summary(pl.UTF-8):      VMware player - wirtualna platforma dla stacji roboczej
23 Name:           VMware-player
24 Version:        %{_ver}.%{_build}
25 Release:        %{_rel}
26 License:        custom, non-distributable
27 Group:          Applications/Emulators
28 Source0:        http://download3.vmware.com/software/vmplayer/%{name}-%{_ver}-%{_build}.i386.tar.gz
29 # NoSource0-md5:        2d1b2d847cf002b2f418b94f5b973ecc
30 NoSource:       0
31 Source1:        http://download3.vmware.com/software/vmplayer/%{name}-%{_ver}-%{_build}.x86_64.tar.gz
32 # NoSource1-md5:        dca7a144e1a01c69387401e46e7e3b26
33 NoSource:       1
34 Source2:        http://knihovny.cvut.cz/ftp/pub/vmware/vmware-any-any-update%{_urel}.tar.gz
35 # Source2-md5:  cb3f91f2196778e6d76d5a6697286d04
36 Source3:        %{name}-vmnet.conf
37 Source4:        %{name}.png
38 Source5:        %{name}.desktop
39 Source6:        %{name}-nat.conf
40 Source7:        %{name}-dhcpd.conf
41 Source8:        %{name}.init
42 Patch0:         %{name}-Makefile.patch
43 Patch1:         %{name}-run_script.patch
44 URL:            http://www.vmware.com/
45 BuildRequires:  gcc-c++
46 %{?with_dist_kernel:BuildRequires:      kernel-module-build >= 3:2.6.7}
47 BuildRequires:  rpm-perlprov
48 BuildRequires:  rpmbuild(macros) >= 1.268
49 BuildRequires:  sed >= 4.0
50 Requires:       libgnomecanvasmm
51 Requires:       libview >= 0.5.5-2
52 Requires:       openssl < 0.9.8
53 Requires:       openssl >= 0.9.7
54 ExclusiveArch:  %{ix86} %{x8664}
55 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56
57 %define         _noautoprovfiles %{_libdir}/vmware/lib/.*\.so.*
58
59 %description
60 VMware Player Virtual Platform is a thin software layer that allows
61 multiple guest operating systems to run concurrently on a single
62 standard PC, without repartitioning or rebooting, and without
63 significant loss of performance.
64
65 %description -l pl.UTF-8
66 VMware Player Virtual Platform to cienka warstwa oprogramowania
67 pozwalająca na jednoczesne działanie wielu gościnnych systemów
68 operacyjnych na jednym zwykłym PC, bez repartycjonowania ani
69 rebootowania, bez znacznej utraty wydajności.
70
71 %package debug
72 Summary:        VMware debug utility
73 Summary(pl.UTF-8):      Narzędzie VMware do odpluskwiania
74 Group:          Applications/Emulators
75 Requires:       %{name} = %{version}-%{release}
76
77 %description debug
78 VMware debug utility.
79
80 %description debug -l pl.UTF-8
81 Narzędzie VMware do odpluskwiania.
82
83 %package help
84 Summary:        VMware Player help files
85 Summary(pl.UTF-8):      Pliki pomocy dla VMware Player
86 Group:          Applications/Emulators
87 Requires:       %{name} = %{version}-%{release}
88 Requires:       mozilla
89
90 %description help
91 VMware Player help files.
92
93 %description help -l pl.UTF-8
94 Pliki pomocy dla VMware Player.
95
96 %package networking
97 Summary:        VMware networking utilities
98 Summary(pl.UTF-8):      Narzędzia VMware do obsługi sieci
99 Group:          Applications/Emulators
100 Requires(post,preun):   /sbin/chkconfig
101 Requires:       %{name} = %{version}-%{release}
102 Requires:       rc-scripts
103 Obsoletes:      VMware-Player-samba
104
105 %description networking
106 VMware networking utilities.
107
108 %description networking -l pl.UTF-8
109 Narzędzia VMware do obsługi sieci.
110
111 %package -n kernel%{_alt_kernel}-misc-vmmon
112 Summary:        Kernel module for VMware Player
113 Summary(pl.UTF-8):      Moduł jądra dla VMware Player
114 Release:        %{_rel}@%{_kernel_ver_str}
115 Group:          Base/Kernel
116 Requires(post,postun):  /sbin/depmod
117 Requires:       dev >= 2.9.0-7
118 %if %{with dist_kernel}
119 %requires_releq_kernel
120 Requires(postun):       %releq_kernel
121 %endif
122 Provides:       kernel(vmmon) = %{version}-%{_rel}
123
124 %description -n kernel%{_alt_kernel}-misc-vmmon
125 Kernel modules for VMware Player - vmmon.
126
127 %description -n kernel%{_alt_kernel}-misc-vmmon -l pl.UTF-8
128 Moduły jądra dla VMware Player - vmmon.
129
130 %package -n kernel%{_alt_kernel}-misc-vmnet
131 Summary:        Kernel module for VMware Player
132 Summary(pl.UTF-8):      Moduł jądra dla VMware Player
133 Release:        %{_rel}@%{_kernel_ver_str}
134 Group:          Base/Kernel
135 Requires(post,postun):  /sbin/depmod
136 Requires:       dev >= 2.9.0-7
137 %if %{with dist_kernel}
138 %requires_releq_kernel
139 Requires(postun):       %releq_kernel
140 %endif
141 Provides:       kernel(vmnet) = %{version}-%{_rel}
142
143 %description -n kernel%{_alt_kernel}-misc-vmnet
144 Kernel modules for VMware Player - vmnet.
145
146 %description -n kernel%{_alt_kernel}-misc-vmnet -l pl.UTF-8
147 Moduły jądra dla VMware Player - vmnet.
148
149 %prep
150 %setup -q -n vmware-player-distrib -a2
151 cd vmware-any-any-update%{_urel}
152 tar xf vmmon.tar
153 tar xf vmnet.tar
154 cp -a vmmon-only{,.clean}
155 cp -a vmnet-only{,.clean}
156 sed -e 's/filter x86_64%/filter x86_64% amd64% ia64%/' \
157         -i vmnet-only.clean/Makefile.kernel
158 cd -
159
160 %build
161 sed -i 's:vm_db_answer_LIBDIR:VM_LIBDIR:g;s:vm_db_answer_BINDIR:VM_BINDIR:g' bin/vmplayer
162
163 cd vmware-any-any-update%{_urel}
164 chmod u+w ../lib/bin/vmware-vmx ../lib/bin-debug/vmware-vmx ../bin/vmnet-bridge
165
166 # hack until new any-any-update version available
167 sed -i -e 's/#define.*VMMON_VERSION_V6.*/#define VMMON_VERSION_V6               (167 << 16 | 0)/g' vmmon-only/include/iocontrols_compat.h
168
169 %if %{with kernel}
170 rm -rf built
171 mkdir built
172
173 for mod in vmmon vmnet ; do
174         for cfg in %{?with_dist_kernel:dist}%{!?with_dist_kernel:nondist}; do
175                 if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
176                         exit 1
177                 fi
178                 rm -rf $mod-only
179                 cp -a $mod-only.clean $mod-only
180                 cd $mod-only
181                 install -d o/include/linux
182                 ln -sf %{_kernelsrcdir}/config-$cfg o/.config
183                 ln -sf %{_kernelsrcdir}/Module.symvers-$cfg o/Module.symvers
184                 ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h o/include/linux/autoconf.h
185         if grep -q "^CONFIG_PREEMPT_RT=y$" o/.config; then
186                 sed -e '/pollQueueLock/s/SPIN_LOCK_UNLOCKED/SPIN_LOCK_UNLOCKED(pollQueueLock)/' \
187                         -e '/timerLock/s/SPIN_LOCK_UNLOCKED/SPIN_LOCK_UNLOCKED(timerLock)/' \
188                         -i ../vmmon-only/linux/driver.c
189                 sed -e 's/SPIN_LOCK_UNLOCKED/SPIN_LOCK_UNLOCKED(vnetHubLock)/' \
190                         -i ../vmnet-only/hub.c
191                 sed -e 's/RW_LOCK_UNLOCKED/RW_LOCK_UNLOCKED(vnetPeerLock)/' \
192                         -i ../vmnet-only/driver.c
193         fi
194         %if %{with dist_kernel}
195                 %{__make} -j1 -C %{_kernelsrcdir} O=$PWD/o prepare scripts
196         %else
197                 install -d o/include/config
198                 touch o/include/config/MARKER
199                 ln -sf %{_kernelsrcdir}/scripts o/scripts
200                 %endif
201                 %{__make} -C %{_kernelsrcdir} modules \
202                         VMWARE_VER=VME_V5 \
203                         SRCROOT=$PWD \
204                         M=$PWD O=$PWD/o \
205                         VM_KBUILD=26 \
206                         %{?with_verbose:V=1} \
207                         VM_CCVER=%{_ccver}
208                 mv -f $mod.ko ../built/$mod-$cfg.ko
209                 cd -
210         done
211 done
212 %endif
213
214 %install
215 rm -rf $RPM_BUILD_ROOT
216
217 %if %{with userspace}
218 install -d \
219         $RPM_BUILD_ROOT%{_sysconfdir}/{modprobe.d,vmware} \
220         $RPM_BUILD_ROOT%{_sysconfdir}/vmware/vmnet8/{nat,dhcpd} \
221         $RPM_BUILD_ROOT%{_bindir} \
222         $RPM_BUILD_ROOT%{_libdir}/vmware/{bin,lib,share/pixmaps} \
223         $RPM_BUILD_ROOT%{_mandir} \
224         $RPM_BUILD_ROOT%{_pixmapsdir} \
225         $RPM_BUILD_ROOT%{_iconsdir}/hicolor \
226         $RPM_BUILD_ROOT%{_desktopdir} \
227         $RPM_BUILD_ROOT/etc/rc.d/init.d \
228         $RPM_BUILD_ROOT/var/run/vmware
229 %endif
230
231 %if %{with kernel}
232 echo "options vmmon vmversion=16" > $RPM_BUILD_ROOT/etc/modprobe.d/%{name}-vmmon.conf
233
234 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/misc
235
236 cd vmware-any-any-update%{_urel}/built
237 install vmmon* $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/vmmon.ko
238 install vmnet* $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/vmnet.ko
239 cd -
240 %endif
241
242 %if %{with userspace}
243 install %{SOURCE8} $RPM_BUILD_ROOT/etc/rc.d/init.d/vmnet
244 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/vmware/vmnet.conf
245 install %{SOURCE4} $RPM_BUILD_ROOT%{_pixmapsdir}
246 install %{SOURCE5} $RPM_BUILD_ROOT%{_desktopdir}
247 install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/vmware/vmnet8/nat/nat.conf
248 install %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/vmware/vmnet8/dhcpd/dhcpd.conf
249
250 touch $RPM_BUILD_ROOT%{_sysconfdir}/vmware/vmnet8/dhcpd/dhcpd.leases
251 touch $RPM_BUILD_ROOT%{_sysconfdir}/vmware/vmnet8/dhcpd/dhcpd.leases~
252
253 cp -a lib/share/icons/hicolor/* $RPM_BUILD_ROOT%{_iconsdir}/hicolor
254
255 install lib/share/pixmaps/* $RPM_BUILD_ROOT%{_libdir}/vmware/share/pixmaps
256 install doc/EULA $RPM_BUILD_ROOT%{_libdir}/vmware/share/EULA.txt
257
258 install bin/*-* $RPM_BUILD_ROOT%{_bindir}
259 install lib/bin/vmware-vmx $RPM_BUILD_ROOT%{_libdir}/vmware/bin
260 install lib/lib/libvmwarebase.so.0/libvmwarebase.so.0 $RPM_BUILD_ROOT%{_libdir}
261 install lib/lib/libvmwareui.so.0/libvmwareui.so.0 $RPM_BUILD_ROOT%{_libdir}
262
263 cp -r   lib/{bin-debug,config,help*,messages,xkeymap} \
264         $RPM_BUILD_ROOT%{_libdir}/vmware
265
266 cat > $RPM_BUILD_ROOT%{_sysconfdir}/vmware/locations <<EOF
267 VM_BINDIR=%{_bindir}
268 VM_LIBDIR=%{_libdir}/vmware
269 EOF
270
271 %if %{with internal_libs}
272 install bin/vmplayer $RPM_BUILD_ROOT%{_bindir}
273 install lib/bin/vmplayer $RPM_BUILD_ROOT%{_libdir}/vmware/bin
274 install lib/lib/* $RPM_BUILD_ROOT%{_libdir}/vmware/lib
275 cp -r   lib/libconf $RPM_BUILD_ROOT%{_libdir}/vmware
276 %else
277 install lib/bin/vmplayer $RPM_BUILD_ROOT%{_bindir}
278 %endif
279 %endif
280
281 %clean
282 rm -rf $RPM_BUILD_ROOT
283
284 %post networking
285 /sbin/chkconfig --add vmnet
286 %service vmnet restart "VMware networking service"
287
288 %preun networking
289 if [ "$1" = "0" ]; then
290         %service vmnet stop
291         /sbin/chkconfig --del vmnet
292 fi
293
294 %post   -n kernel%{_alt_kernel}-misc-vmmon
295 %depmod %{_kernel_ver}
296
297 %postun -n kernel%{_alt_kernel}-misc-vmmon
298 %depmod %{_kernel_ver}
299
300 %post   -n kernel%{_alt_kernel}-misc-vmnet
301 %depmod %{_kernel_ver}
302
303 %postun -n kernel%{_alt_kernel}-misc-vmnet
304 %depmod %{_kernel_ver}
305
306 %if %{with userspace}
307 %files
308 %defattr(644,root,root,755)
309 %doc doc/* lib/configurator/vmnet-{dhcpd,nat}.conf
310 %dir %{_sysconfdir}/vmware
311 %{_sysconfdir}/vmware/locations
312 %attr(755,root,root) %{_bindir}/vmplayer
313 %attr(755,root,root) %{_bindir}/vmware-acetool
314 %attr(755,root,root) %{_bindir}/vm-support
315 %attr(755,root,root) %{_libdir}/libvmwarebase.so.*
316 %attr(755,root,root) %{_libdir}/libvmwareui.so.*
317 %dir %{_libdir}/vmware
318 %dir %{_libdir}/vmware/bin
319 %dir %{_libdir}/vmware/lib
320 # warning: SUID !!!
321 %attr(4755,root,root) %{_libdir}/vmware/bin/vmware-vmx
322 %{_libdir}/vmware/config
323 %if %{with internal_libs}
324 %attr(755,root,root) %{_libdir}/vmware/bin/vmware
325 %{_libdir}/vmware/lib/lib*
326 %attr(755,root,root) %{_libdir}/vmware/lib/wrapper-gtk24.sh
327 %endif
328 %dir %{_libdir}/vmware/messages
329 %lang(en) %{_libdir}/vmware/messages/en
330 %lang(ja) %{_libdir}/vmware/messages/ja
331 %{_libdir}/vmware/share
332 %{_libdir}/vmware/xkeymap
333 %attr(1777,root,root) %dir /var/run/vmware
334 %{_iconsdir}/hicolor/*/*/*.png
335 %{_iconsdir}/hicolor/*/*/*.svg
336 %{_pixmapsdir}/*.png
337 %{_desktopdir}/%{name}.desktop
338
339 %files debug
340 %defattr(644,root,root,755)
341 %dir %{_libdir}/vmware/bin-debug
342 # warning: SUID !!!
343 %attr(4755,root,root) %{_libdir}/vmware/bin-debug/vmware-vmx
344
345 %files help
346 %defattr(644,root,root,755)
347 %{_libdir}/vmware/help*
348
349 %files networking
350 %defattr(644,root,root,755)
351 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/vmware/vmnet.conf
352 %attr(754,root,root) /etc/rc.d/init.d/vmnet
353 %attr(755,root,root) %{_bindir}/vmnet-bridge
354 %attr(755,root,root) %{_bindir}/vmnet-detect
355 %attr(755,root,root) %{_bindir}/vmnet-dhcpd
356 %attr(755,root,root) %{_bindir}/vmnet-natd
357 %attr(755,root,root) %{_bindir}/vmnet-netifup
358 %attr(755,root,root) %{_bindir}/vmnet-sniffer
359 %attr(755,root,root) %{_bindir}/vmware-ping
360 %dir %{_sysconfdir}/vmware/vmnet8
361 %dir %{_sysconfdir}/vmware/vmnet8/dhcpd
362 %dir %{_sysconfdir}/vmware/vmnet8/nat
363 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/vmware/vmnet8/dhcpd/dhcpd.conf
364 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/vmware/vmnet8/nat/nat.conf
365 %verify(not md5 mtime size) %{_sysconfdir}/vmware/vmnet8/dhcpd/dhcpd.leases*
366
367 %endif
368
369 %if %{with kernel}
370 %files -n kernel%{_alt_kernel}-misc-vmmon
371 %defattr(644,root,root,755)
372 /etc/modprobe.d/%{name}-vmmon.conf
373 /lib/modules/%{_kernel_ver}/misc/vmmon.ko*
374
375 %files -n kernel%{_alt_kernel}-misc-vmnet
376 %defattr(644,root,root,755)
377 /lib/modules/%{_kernel_ver}/misc/vmnet.ko*
378
379 %endif
This page took 0.13027 seconds and 2 git commands to generate.