# # This doesn't work at all yet. I don't know if the management interface is needed # (bundling apache seems like a sooooooooo great idea). Maybe it is possible to # setup the server part by hand. The perl module in perl/control.tar needs to # be packaged (vmware-cmd requires that). Something needs to be done with # the authd (inetd integration is needed I guess). # # The modules from any-any upgrade are too old (I used the ones comming with VMw-S). # # It builds on amd64, I have changed the networking package not to require the main package # so it can be installed outside 32bit chroot. # # But hey, it's at least free ;-) # # I probably won't have time to work on this, switching to vmware-player. # TODO: # problem with libsexy/libsexymm: # ln -s /usr/lib/libsexy.so.2 /usr/lib/libsexy.so.1 # ln -s /usr/lib/libsexymm.so.2 /usr/lib/libsexymm.so.1 # # Conditional build: %bcond_without dist_kernel # without distribution kernel %bcond_without kernel # don't build kernel modules %bcond_without userspace # don't build userspace utilities %bcond_without internal_libs # internal libs stuff %bcond_without doc # package huge docs %bcond_with verbose # verbose build (V=1) # %include /usr/lib/rpm/macros.perl # %define ver 2.0 %define subver 63231 %define rel 0.5 %define urel 116 %{expand:%%global ccver %(%{__cc} -dumpversion)} # Summary: VMware Server Summary(pl.UTF-8): VMware Server - wirtualna platforma dla stacji roboczej Name: VMware-server Version: %{ver}.%{subver} Release: %{rel} License: custom, non-distributable Group: Applications/Emulators # http://www.vmware.com/beta/server/download.html Source0: http://download3.vmware.com/software/vmserver/%{name}-e.x.p-%{subver}.i386.tar.gz # NoSource0-md5: 853247ff0e313f34bd0c3052de8e2c28 Source1: http://download3.vmware.com/software/vmserver/%{name}-e.x.p-%{subver}.x86_64.tar.gz # NoSource1-md5: 0d36ae02640d913251fd11918f798da3 Source2: http://download3.vmware.com/software/vmserver/VMware-vix-e.x.p-%{subver}.i386.tar.gz # NoSource2-md5: c7d162fb8c805143ea5b40e7f62ef4da Source3: http://download3.vmware.com/software/vmserver/VMware-vix-e.x.p-%{subver}.x86_64.tar.gz # NoSource3-md5: 10124d4747e7a579a270376458b7a77b Source4: http://uruz.org/files/vmware-any-any-update-%{urel}.tgz # NoSource4-md5: 3a2e2cb8c3d662190198c77c4a656dbb Source5: %{name}.init Source6: %{name}-vmnet.conf Source7: %{name}.png Source8: %{name}.desktop Source9: %{name}-nat.conf Source10: %{name}-dhcpd.conf Source11: %{name}-libs Patch0: %{name}-Makefile.patch Patch1: %{name}-run_script.patch Patch2: %{name}-init_pl.patch NoSource: 0 NoSource: 1 NoSource: 2 NoSource: 3 NoSource: 4 URL: http://www.vmware.com/ %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.16} BuildRequires: libstdc++-devel BuildRequires: rpm-perlprov BuildRequires: rpmbuild(macros) >= 1.438 BuildRequires: sed >= 4.0 #Requires: libgnomecanvasmm #Requires: libsexy #Requires: libsexymm ExclusiveArch: %{ix86} %{x8664} BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %define _noautoprovfiles %{_libdir}/vmware*/lib/.*\.so.* # TMP hack to compare with upstream rpm %define _libdir %{_prefix}/lib %define _docdir %{_defaultdocdir}/vmware %define sonamedeps %(cat %{SOURCE11} | xargs) %define _noautoprov %sonamedeps %define _noautoreq %sonamedeps %description VMware Server Virtual Platform is a thin software layer that allows multiple guest operating systems to run concurrently on a single standard PC, without repartitioning or rebooting, and without significant loss of performance. %description -l pl.UTF-8 VMware Server Virtual Platform to cienka warstwa oprogramowania pozwalająca na jednoczesne działanie wielu gościnnych systemów operacyjnych na jednym zwykłym PC, bez repartycjonowania ani rebootowania, bez znacznej utraty wydajności. %package debug Summary: VMware debug utility Summary(pl.UTF-8): Narzędzie VMware do odpluskwiania Group: Applications/Emulators Requires: %{name} = %{version}-%{release} %description debug VMware debug utility. %description debug -l pl.UTF-8 Narzędzie VMware do odpluskwiania. %package console Summary: VMware console utility Summary(pl.UTF-8): Konsola VMware Group: Applications/Emulators Requires: %{name} = %{version}-%{release} %description console A tool for controlling VM. %description console -l pl.UTF-8 Narzędzie VMware do kontroli VM. %package help Summary: VMware Server help files Summary(pl.UTF-8): Pliki pomocy dla VMware Server Group: Applications/Emulators Requires: %{name} = %{version}-%{release} Requires: mozilla %description help VMware Server help files. %description help -l pl.UTF-8 Pliki pomocy dla VMware Server. %package console-help Summary: VMware Server console help files Summary(pl.UTF-8): Pliki pomocy dla konsoli VMware Server Group: Applications/Emulators Requires: %{name} = %{version}-%{release} Requires: mozilla %description console-help VMware Server console help files. %description console-help -l pl.UTF-8 Pliki pomocy dla konsoli VMware Server. %package networking Summary: VMware networking utilities Summary(pl.UTF-8): Narzędzia VMware do obsługi sieci Group: Applications/Emulators Requires(post,preun): /sbin/chkconfig #Requires: %{name} = %{version}-%{release} Requires: rc-scripts %description networking VMware networking utilities. %description networking -l pl.UTF-8 Narzędzia VMware do obsługi sieci. %package samba Summary: VMware SMB utilities Summary(pl.UTF-8): Narzędzia VMware do SMB Group: Applications/Emulators Requires: %{name} = %{version}-%{release} %description samba VMware SMB utilities. %description samba -l pl.UTF-8 Narzędzia VMware do SMB. %package -n kernel%{_alt_kernel}-misc-vmci Summary: Kernel module for VMware Server Summary(pl.UTF-8): Moduł jądra dla VMware Server Release: %{rel}@%{_kernel_ver_str} Group: Base/Kernel Requires(post,postun): /sbin/depmod Requires: dev >= 2.9.0-7 %if %{with dist_kernel} %requires_releq_kernel Requires(postun): %releq_kernel %endif Provides: kernel(vmci) = %{version}-%{rel} %description -n kernel%{_alt_kernel}-misc-vmci Kernel modules for VMware Server - vmci. %description -n kernel%{_alt_kernel}-misc-vmci -l pl.UTF-8 Moduły jądra dla VMware Server - vmci. %package -n kernel%{_alt_kernel}-misc-vmmon Summary: Kernel module for VMware Server Summary(pl.UTF-8): Moduł jądra dla VMware Server Release: %{rel}@%{_kernel_ver_str} Group: Base/Kernel Requires(post,postun): /sbin/depmod Requires: dev >= 2.9.0-7 %if %{with dist_kernel} %requires_releq_kernel Requires(postun): %releq_kernel %endif Provides: kernel(vmmon) = %{version}-%{rel} %description -n kernel%{_alt_kernel}-misc-vmmon Kernel modules for VMware Server - vmmon. %description -n kernel%{_alt_kernel}-misc-vmmon -l pl.UTF-8 Moduły jądra dla VMware Server - vmmon. %package -n kernel%{_alt_kernel}-misc-vmnet Summary: Kernel module for VMware Server Summary(pl.UTF-8): Moduł jądra dla VMware Server Release: %{rel}@%{_kernel_ver_str} Group: Base/Kernel Requires(post,postun): /sbin/depmod Requires: dev >= 2.9.0-7 %if %{with dist_kernel} %requires_releq_kernel Requires(postun): %releq_kernel %endif Provides: kernel(vmnet) = %{version}-%{rel} %description -n kernel%{_alt_kernel}-misc-vmnet Kernel modules for VMware Server - vmnet. %description -n kernel%{_alt_kernel}-misc-vmnet -l pl.UTF-8 Moduły jądra dla VMware Server - vmnet. %prep %ifarch %{ix86} %setup -q -T -n vmware-server-distrib -b0 %{?with_userspace:-a2} %endif %ifarch %{x8664} %setup -q -T -n vmware-server-distrib -b1 %{?with_userspace:-a3} %endif cd lib/modules %{__tar} xf source/vmci.tar %{__tar} xf source/vmmon.tar %{__tar} xf source/vmnet.tar mv vmmon-only/linux/driver.c{,.dist} mv vmnet-only/hub.c{,.dist} mv vmnet-only/driver.c{,.dist} #rm -rf binary # unusable cd - %{__gzip} -d man/man1/vmware.1.gz %if 0 tar zxf vmware-mui-distrib/console-distrib/%{name}-console-%{ver}-%{subver}.tar.gz cp vmware-any-any-update%{urel}/{vmmon,vmnet}.tar lib/modules/source/ cd lib/modules/source tar xf vmmon.tar tar xf vmnet.tar #%patch0 -p0 cp -a vmmon-only{,.clean} cp -a vmnet-only{,.clean} cd - %patch1 -p1 %patch2 -p0 tar xf lib/perl/control.tar %endif %build %if 0 cd vmware-any-any-update%{urel} chmod u+w ../lib/bin/vmware-vmx ../lib/bin-debug/vmware-vmx ../bin/vmnet-bridge %endif %if 0 rm -f update %{__cc} %{rpmldflags} %{rpmcflags} -o update update.c ./update vmx ../lib/bin/vmware-vmx ./update vmxdebug ../lib/bin-debug/vmware-vmx ./update bridge ../bin/vmnet-bridge cd - %endif %if %{with userspace} %if 0 cd control-only perl Makefile.PL sed -i "s:^INSTALLSITEARCH.*$:INSTALLSITEARCH = %{perl_vendorarch}:" Makefile sed -i "s:^INSTALLSITELIB.*$:INSTALLSITELIB = %{perl_vendorlib}:" Makefile sed -i "s:^INSTALLSITEMAN1DIR.*$:INSTALLSITEMAN1DIR = %{_mandir}/man1:" Makefile sed -i "s:^INSTALLSITEMAN3DIR.*$:INSTALLSITEMAN3DIR = %{_mandir}/man3:" Makefile %{__make} cd .. %endif %endif %if %{with kernel} cd lib/modules %build_kernel_modules -C vmci-only -m vmci SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{ccver} %build_kernel_modules -C vmmon-only -m vmmon SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{ccver} <<'EOF' if grep -q "^CONFIG_PREEMPT_RT=y$" o/.config; then sed -e '/pollQueueLock/s/SPIN_LOCK_UNLOCKED/SPIN_LOCK_UNLOCKED(pollQueueLock)/' \ -e '/timerLock/s/SPIN_LOCK_UNLOCKED/SPIN_LOCK_UNLOCKED(timerLock)/' \ linux/driver.c.dist > linux/driver.c else cat linux/driver.c.dist > linux/driver.c fi EOF %build_kernel_modules -C vmnet-only -m vmnet SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{ccver} <<'EOF' if grep -q "^CONFIG_PREEMPT_RT=y$" o/.config; then sed -e 's/SPIN_LOCK_UNLOCKED/SPIN_LOCK_UNLOCKED(vnetHubLock)/' \ hub.c.dist > hub.c sed -e 's/RW_LOCK_UNLOCKED/RW_LOCK_UNLOCKED(vnetPeerLock)/' \ driver.c.dist > driver.c else cat hub.c.dist > hub.c cat driver.c.dist > driver.c fi EOF %endif %install rm -rf $RPM_BUILD_ROOT %if %{with userspace} install -d \ $RPM_BUILD_ROOT%{_sysconfdir}/vmware{,-server-console} \ $RPM_BUILD_ROOT%{_sysconfdir}/vmware/vmnet8/{nat,dhcpd} \ $RPM_BUILD_ROOT%{_sysconfdir}/vmware/state \ $RPM_BUILD_ROOT%{_bindir} \ $RPM_BUILD_ROOT%{_sbindir} \ $RPM_BUILD_ROOT%{_libdir}/vmware{,-server-console}/bin \ $RPM_BUILD_ROOT%{_mandir} \ $RPM_BUILD_ROOT%{_pixmapsdir} \ $RPM_BUILD_ROOT%{_desktopdir} \ $RPM_BUILD_ROOT/etc/rc.d/init.d \ $RPM_BUILD_ROOT/var/{log,run}/vmware %if 0 cd control-only %{__make} install \ DESTDIR=$RPM_BUILD_ROOT cd .. %endif %if 0 # copy other required perl modules cp -a lib/perl5/site_perl/5.005/VMware $RPM_BUILD_ROOT%{perl_vendorarch} cp -a lib/perl5/site_perl/5.005/i386-linux/VMware/VmdbPerl $RPM_BUILD_ROOT%{perl_vendorarch}/VMware cp -a lib/perl5/site_perl/5.005/i386-linux/VMware/{HConfig,VmdbPerl}.pm $RPM_BUILD_ROOT%{perl_vendorarch}/VMware cp -a lib/perl5/site_perl/5.005/i386-linux/auto/VMware/{HConfig,VmdbPerl} $RPM_BUILD_ROOT%{perl_vendorarch}/auto/VMware # remove unecessary files rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/VMware/{HConfig,VmdbPerl,VmPerl}/.{exists,packlist} %endif %endif %if %{with kernel} %install_kernel_modules -m lib/modules/vmci-only/vmci -d misc %install_kernel_modules -m lib/modules/vmmon-only/vmmon -d misc %install_kernel_modules -m lib/modules/vmnet-only/vmnet -d misc %endif %if %{with userspace} install %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/vmnet install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/vmware/vmnet.conf install %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir} install %{SOURCE8} $RPM_BUILD_ROOT%{_desktopdir} install %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/vmware/vmnet8/nat/nat.conf install %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/vmware/vmnet8/dhcpd/dhcpd.conf touch $RPM_BUILD_ROOT%{_sysconfdir}/vmware/vmnet8/dhcpd/dhcpd.leases touch $RPM_BUILD_ROOT%{_sysconfdir}/vmware/vmnet8/dhcpd/dhcpd.leases~ install bin/*-* $RPM_BUILD_ROOT%{_bindir} install sbin/*-* $RPM_BUILD_ROOT%{_sbindir} install lib/bin/vmware-vmx $RPM_BUILD_ROOT%{_libdir}/vmware/bin cp -a lib/webAccess $RPM_BUILD_ROOT%{_libdir}/vmware cp -a lib/hostd $RPM_BUILD_ROOT%{_libdir}/vmware cp -a vmware-vix $RPM_BUILD_ROOT%{_libdir}/vmware cp -a lib/vmacore $RPM_BUILD_ROOT%{_libdir}/vmware cp -a lib/net-services.sh $RPM_BUILD_ROOT%{_libdir}/vmware cp -a lib/modules $RPM_BUILD_ROOT%{_libdir}/vmware rm -rf $RPM_BUILD_ROOT%{_libdir}/vmware/modules/*-only cp -a lib/configurator $RPM_BUILD_ROOT%{_libdir}/vmware cp -a etc/hostd $RPM_BUILD_ROOT/etc/vmware/hostd cp -a etc/installer.sh $RPM_BUILD_ROOT/etc/vmware cp -a etc/pam.d $RPM_BUILD_ROOT/etc/vmware cp -a etc/service $RPM_BUILD_ROOT/etc/vmware install -d $RPM_BUILD_ROOT%{_docdir} cp -a doc/* $RPM_BUILD_ROOT%{_docdir} cp -a vmware-vix-distrib/doc/VMwareVix $RPM_BUILD_ROOT%{_docdir} install -d $RPM_BUILD_ROOT%{_mandir}/man1 cp -a man/man1/vmware.1 $RPM_BUILD_ROOT%{_mandir}/man1 install installer/services.sh $RPM_BUILD_ROOT/etc/rc.d/init.d/vmware ln -s vmware $RPM_BUILD_ROOT/etc/rc.d/init.d/vmware-autostart ln -s vmware $RPM_BUILD_ROOT/etc/rc.d/init.d/vmware-core ln -s vmware $RPM_BUILD_ROOT/etc/rc.d/init.d/vmware-mgmt cat > $RPM_BUILD_ROOT%{_sysconfdir}/vmware/locations <<'EOF' file /etc/vmware/locations directory /etc/vmware/state answer BINDIR /usr/bin answer SBINDIR /usr/sbin answer LIBDIR /usr/lib/vmware answer DOCDIR /usr/share/doc/vmware answer MANDIR /usr/share/man answer INITDIR /etc/rc.d answer INITSCRIPTSDIR /etc/rc.d/init.d file /etc/vmware/not_configured 1205422799 file /etc/rc.d/init.d/vmware 1205422799 answer INSTALL_CYCLE yes file /etc/rc.d/init.d/vmware-mgmt file /etc/rc.d/init.d/vmware-core file /etc/rc.d/init.d/vmware-autostart EOF rm $RPM_BUILD_ROOT/usr/bin/vmware-uninstall.pl rm $RPM_BUILD_ROOT/usr/bin/vmware-vimdump rm $RPM_BUILD_ROOT/usr/share/applications/VMware-server.desktop rm $RPM_BUILD_ROOT/usr/share/pixmaps/VMware-server.png %if 0 sed -e ' s@%sitearch%@%{perl_sitearch}@g; s@%sitelib%@%{perl_sitelib}@g; s@%vendorarch%@%{perl_vendorarch}@g; s@%vendorlib%@%{perl_vendorlib}@g; s@%archlib%@%{perl_archlib}@g; s@%privlib%@%{perl_privlib}@g;' < lib/serverd/init.pl.default > $RPM_BUILD_ROOT%{_libdir}/vmware/serverd/init.pl %endif cp -a lib/{config,help,isoimages,licenses,messages,share,xkeymap} \ $RPM_BUILD_ROOT%{_libdir}/vmware %if 0 cp -a vmware-server-console-distrib/lib/{bin-debug,config,help*,messages,share,xkeymap} \ $RPM_BUILD_ROOT%{_libdir}/vmware-server-console install vmware-server-console-distrib/lib/bin/vmware-remotemks $RPM_BUILD_ROOT%{_libdir}/vmware-server-console/bin cp -a vmware-server-console-distrib/man/* man/* $RPM_BUILD_ROOT%{_mandir} gunzip $RPM_BUILD_ROOT%{_mandir}/man?/*.gz %endif cat > $RPM_BUILD_ROOT%{_sysconfdir}/vmware-server-console/locations <