# $Header: /magellan-cvs/smage/vmware-workstation/vmware-workstation-6.0.4.93057-r3.smage2,v 1.1 2008/07/12 12:19:27 niro Exp $ PNAME="vmware-workstation" PVER="6.0.4.93057" PBUILD="r3" PCATEGORIE="app-emulation" STATE="unstable" DESCRIPTION="VMWare-Workstation, a powerful PC Emulation software." HOMEPAGE="http://vmware.com/products/ws/" DEPEND=">= virtual/glibc >= x11-libs/libXrandr-1 >= x11-libs/libXcursor-1 >= x11-libs/libXinerama-1 >= x11-libs/libXi-1 >= dev-cpp/libsexymm-0.1.9 >= dev-lang/perl-5 >= virtual/kernel-sources >= sys-apps/pciutils-2.1.11" # fetch it at http://download3.vmware.com/software/wkst/ SRCFILE_x86="VMware-workstation-${PVER:0:5}-${PVER##*.}.i386.tar.gz" SRCFILE_x86_64="VMware-workstation-${PVER:0:5}-${PVER##*.}.x86_64.tar.gz" SRCFILE="$(eval echo \$SRCFILE_${ARCH/i*86/x86})" SRCDIR="${BUILDDIR}/vmware-distrib" # fetch'em at http://ftp.cvut.cz/vmware/ # be aware that these any-any drivers are an unoffical update # this patchset is based on the orig 6.0.4 drivers with some 2.6.25 patches applied # see: http://bbs.archlinux.org/viewtopic.php?id=47704 # !! replace this tarball with an official one as soon as available!! DRIVERS_VER=118-unofficial DRIVERS_DIR="vmware-any-any-update${DRIVERS_VER}" DRIVERS_TAR="${DRIVERS_DIR}.tar.gz" sminclude mtools SRC_URI=( http://download3.vmware.com/software/wkst/${SRCFILE_x86} http://download3.vmware.com/software/wkst/${SRCFILE_x86_64} mirror://${PNAME}/${SRCFILE_x86} mirror://${PNAME}/${SRCFILE_x86_64} mirror://${PNAME}/vmware.rc6 mirror://${PNAME}/vmware.envd ) # only fetch update if DRIVERS_VER is given if [[ ! -z ${DRIVERS_VER} ]] then SRC_URI=( ${SRC_URI[*]} mirror://${PNAME}/${DRIVERS_TAR} ) fi src_prepare() { munpack ${SRCFILE} || die cd ${SRCDIR} # only run update if DRIVERS_VER is given! if [[ ! -z ${DRIVERS_VER} ]] then # install updated kernel modules munpack ${DRIVERS_TAR} ${SRCDIR} || die mv -f ${DRIVERS_DIR}/*.tar ${SRCDIR}/lib/modules/source/ || die cd ${SRCDIR}/${DRIVERS_DIR} chmod 0755 ./update || die chmod 0755 ../lib/bin/vmware || die chmod 0755 ../bin/vmnet-bridge || die chmod 0755 ../lib/bin/vmware-vmx || die chmod 0755 ../lib/bin-debug/vmware-vmx || die # vmware any93 doesn't patch anything #./update vmware ../lib/bin/vmware || die #./update bridge ../bin/vmnet-bridge || die #./update vmx ../lib/bin/vmware-vmx || die #./update vmxdebug ../lib/bin-debug/vmware-vmx || die fi } src_install() { cd ${SRCDIR} # needed directories minstalldir /etc/udev/rules.d || die minstalldir /usr/bin || die minstalldir /opt/vmware || die # This is to fix a problem where if someone merges vmware and then # before configuring vmware they upgrade or re-merge the vmware # package which would rmdir the /etc/vmware/init.d/rc?.d directories. mkeepdir /etc/vmware/init.d/rc0.d || die mkeepdir /etc/vmware/init.d/rc1.d || die mkeepdir /etc/vmware/init.d/rc2.d || die mkeepdir /etc/vmware/init.d/rc3.d || die mkeepdir /etc/vmware/init.d/rc4.d || die mkeepdir /etc/vmware/init.d/rc5.d || die mkeepdir /etc/vmware/init.d/rc6.d || die # install all files cp -a bin ${BINDIR}/opt/vmware/ || die cp -dr lib ${BINDIR}/opt/vmware/ || die cp -a sbin ${BINDIR}/opt/vmware/ || die # remove precompiled kernel modules (none of them matches our kernels) rm -rf ${BINDIR}/opt/vmware/lib/modules/binary || die # needed config files cp -a etc/* ${BINDIR}/etc/vmware/ || die cp -a installer/services.sh ${BINDIR}/etc/vmware/init.d/vmware || die # create a symlink to /usr/bin mlink /opt/vmware/bin/vmware /usr/bin/vmware || die # install docs and man pages cp -a doc ${BINDIR}/opt/vmware/ || die cp -a man ${BINDIR}/opt/vmware/ || die # install missing EULA if [[ ! -f ${BINDIR}/opt/vmware/lib/share/EULA.txt ]] then minstallfile doc/EULA /opt/vmware/lib/share/EULA.txt || die fi # vmware enviroment minstallenv vmware.envd 90vmware || die # install our initscript minstallrc vmware.rc6 vmware || die # udev rules echo 'KERNEL=="vmmon*", MODE=0660' > \ ${BINDIR}/etc/udev/rules.d/60-vmware.rules || die # fix all permissions sed -i 's/mknod -m 600/mknod -m 0660/' ${BINDIR}/etc/vmware/init.d/vmware || die mchown -R root:root / || die mchmod u+s /opt/vmware/bin/vmware || die mchmod u+s /opt/vmware/bin/vmware-ping || die mchmod u+s /opt/vmware/lib/bin/vmware-vmx || die # Questions: echo "Adding answers to /etc/vmware/locations" locations="${BINDIR}/etc/vmware/locations" echo "answer BINDIR /opt/vmware/bin" >> ${locations} || die echo "answer LIBDIR /opt/vmware/lib" >> ${locations} || die echo "answer MANDIR /opt/vmware/man" >> ${locations} || die echo "answer DOCDIR /opt/vmware/doc" >> ${locations} || die echo "answer SBINDIR /opt/vmware/sbin" >> ${locations} || die echo "answer RUN_CONFIGURATOR no" >> ${locations} || die echo "answer INITDIR /etc/vmware/init.d" >> ${locations} || die echo "answer INITSCRIPTSDIR /etc/vmware/init.d" >> ${locations} || die } preinstall() { # This must be done after the install to get the mtimes on each file # right. This perl snippet gets the /etc/vmware/locations file code: # perl -e "@a = stat('bin/vmware'); print \$a[9]" # The above perl line and the find line below output the same thing. # I would think the find line is faster to execute. # find /opt/vmware/bin/vmware -printf %T@ D="${BUILDDIR}/${PKGNAME}/binfiles" echo "Generating /etc/vmware/locations file." d=`echo ${D} | wc -c` for x in `find ${D}/opt/vmware ${D}/etc/vmware` ; do x="`echo ${x} | cut -c ${d}-`" if [ -d ${D}/${x} ] ; then echo "directory ${x}" >> ${D}/etc/vmware/locations else echo -n "file ${x}" >> ${D}/etc/vmware/locations if [ "${x}" == "/etc/vmware/locations" ] ; then echo "" >> ${D}/etc/vmware/locations elif [ "${x}" == "/etc/vmware/not_configured" ] ; then echo "" >> ${D}/etc/vmware/locations else echo -n " " >> ${D}/etc/vmware/locations #perl -e "@a = stat('${D}${x}'); print \$a[9]" >> ${D}/etc/vmware/locations #find ${D}${x} -printf %T@ >> ${D}/etc/vmware/locations # we are using the .mtime from the package as reference for all files later, # so we must use it here to, to get rid of the not_configured file find ${BUILDDIR}/${PKGNAME}/.mtime -printf %T@ >> ${D}/etc/vmware/locations echo "" >> ${D}/etc/vmware/locations fi fi done } postinstall() { # This is to fix the problem where the not_configured file doesn't get # removed when the configuration is run. This doesn't remove the file # It just tells the vmware-config.pl script it can delete it. echo "Updating ${MROOT}/etc/vmware/locations" for x in ${MROOT}/etc/vmware/._cfg????_locations ; do if [ -f $x ] ; then cat $x >> ${MROOT}/etc/vmware/locations rm $x fi done echo echo "You need to run /opt/vmware/bin/vmware-config.pl to complete the install." echo echo "For VMware Add-Ons just visit" echo "http://www.vmware.com/download/downloadaddons.html" echo echo "After configuring, type 'vmware' to launch." echo }