diff options
author | Mike Auty <ikelos@gentoo.org> | 2009-03-04 17:55:32 +0000 |
---|---|---|
committer | Mike Auty <ikelos@gentoo.org> | 2009-03-04 17:55:32 +0000 |
commit | a9456df70493378406df60d864e60dd206456bdf (patch) | |
tree | e59162ff4b304f72be7a5331cfabb1ee3ea27318 | |
parent | Fix up SRC_URI to use variable names whereever possible. (diff) | |
download | vmware-a9456df70493378406df60d864e60dd206456bdf.tar.gz vmware-a9456df70493378406df60d864e60dd206456bdf.tar.bz2 vmware-a9456df70493378406df60d864e60dd206456bdf.zip |
Add in vmware-converter masked (both package and keyword).
svn path=/trunk/; revision=359
11 files changed, 709 insertions, 0 deletions
diff --git a/app-emulation/vmware-converter/Manifest b/app-emulation/vmware-converter/Manifest new file mode 100644 index 0000000..518e017 --- /dev/null +++ b/app-emulation/vmware-converter/Manifest @@ -0,0 +1,9 @@ +AUX 4.0.0.146302.off/000_all_initd-location.patch 1131 RMD160 3ab69d825994cc3bb177143d27091fc292cec46a SHA1 14264460c8500f1ead267059e2b9b9a5dc8c057f SHA256 b4055370b0092e71a2b2b0f27edeb7bc063ad265f95ab4530e52c3ab3167ad62 +AUX 4.0.0.146302.off/001_all_fix-permissions.patch 647 RMD160 0f25f7dd60dfcb5a72b1f7b9cf344d6f431143a9 SHA1 cabd3dd071ef62d4c70f52d1a3e02334ec7f3a73 SHA256 41492cde60da6d449c0f427ac7bd65598838ec17ac0e3a5f545feeb1d29ea391 +AUX 4.0.0.146302.off/002_all_pagebreak-detection-fix.patch 800 RMD160 f21a51e552d025a5120519d6dcd41efc3835a432 SHA1 06133c332b6b1f57476b1154de108a9dfc35435d SHA256 d327d7cb2166b9ef4c8c286568c3a7eb64542212164d58b8a7a3c5e51e19ed6d +AUX 4.0.0.146302.off/004_all_do-not-build-modules.patch 589 RMD160 b2153579c65a232de9c2e6dbd9bbe108d85f95e5 SHA1 394a67a30f1f29084836183303641915ce982bfd SHA256 916754b0616ea330490b9572be1a9216bb7dd441ba328b1e01e777b29fac4e1e +AUX 4.0.0.146302.off/007_all_use-modprobe-over-insmod.patch 445 RMD160 186ab443a733276a702dea16a23c04f7deed9d13 SHA1 c7113cd3f7f91527397f6fb07797d4e9c5c6f011 SHA256 bcf4930fae4812c8fbb2eb58b200f1da9441d97cd0c74b8ee6250cf097a28630 +AUX 4.0.0.146302.off/009_all_init.d-modules-warning.patch 991 RMD160 6205e976db47cd3361b5eca8593414d411a2ab8d SHA1 3742749baa606a57d447931f0af791696a49e660 SHA256 5fbc9f101abb3816a732f64a75e90ce7fcb6783c3cd7bae521d8785e88634498 +AUX vmware-converter.rc 1500 RMD160 f5bc22dbee280583ebca78836f38d82a4e164409 SHA1 0326487bea4369c8ac2ee1796f472e5e0f0bd858 SHA256 348a516325be26f64b6bbded7fde25f392478a8511330200e6cd58d6977d6067 +DIST VMware-converter-4.0.0-146302.tar.gz 122325894 RMD160 8919371ded3a6756e6d175515bd273a4bf06bd93 SHA1 b736e69a65b96406d3407032fd18f84e403c72f1 SHA256 7a34ba719630979fc1fe0b210e13f2c8ddc414a8baf63400a1f586adffc6f0f0 +EBUILD vmware-converter-4.0.0.146302.ebuild 3108 RMD160 4adbc978c14533a577afd27cff093e02de30237d SHA1 e32436bef467d13e9f86e24ac32995f6f4821c18 SHA256 919e9a52cfa3096fed0d4b1d5ed036660fc78c0c327be473eb195ec52da94038 diff --git a/app-emulation/vmware-converter/files/4.0.0.146302.off/000_all_initd-location.patch b/app-emulation/vmware-converter/files/4.0.0.146302.off/000_all_initd-location.patch new file mode 100644 index 0000000..1d864f7 --- /dev/null +++ b/app-emulation/vmware-converter/files/4.0.0.146302.off/000_all_initd-location.patch @@ -0,0 +1,31 @@ +--- vmware-distrib/bin/vmware-config.pl.ori 2005-11-09 01:45:08.000000000 +0000 ++++ vmware-distrib/bin/vmware-config.pl 2005-11-09 01:48:21.000000000 +0000 +@@ -8433,7 +8433,7 @@ + error('Please shut down any running VMs and run this script again.' . + "\n\n"); + } else { +- if (system(shell_string(db_get_answer('INITSCRIPTSDIR') . '/vmware') ++ if (system(shell_string('/etc/init.d' . '/vmware') + . ' stop')) { + error('Unable to stop services for ' . vmware_product_name() . + "\n\n"); +@@ -8463,8 +8463,8 @@ + } + if (vmware_product() ne 'server') { + configure_gtk2(); +- createMimePackageFile(); +- configureDesktopFiles(); ++# createMimePackageFile(); ++# configureDesktopFiles(); + configure_mon(); + configure_pp(); + configure_net(); +@@ -8532,7 +8532,7 @@ + db_save(); + # Then start VMware's services + if (!$gOption{'skipstopstart'}) { +- system(shell_string(db_get_answer('INITSCRIPTSDIR') . '/vmware') . ' start'); ++ system(shell_string('/etc/init.d' . '/vmware') . ' start'); + print "\n"; + } + diff --git a/app-emulation/vmware-converter/files/4.0.0.146302.off/001_all_fix-permissions.patch b/app-emulation/vmware-converter/files/4.0.0.146302.off/001_all_fix-permissions.patch new file mode 100644 index 0000000..e646b7b --- /dev/null +++ b/app-emulation/vmware-converter/files/4.0.0.146302.off/001_all_fix-permissions.patch @@ -0,0 +1,15 @@ +diff -urN vmware-distrib.orig/bin/vmware-config.pl vmware-distrib/bin/vmware-config.pl +--- vmware-distrib.orig/bin/vmware-config.pl 2005-12-16 00:51:03.000000000 -0500 ++++ vmware-distrib/bin/vmware-config.pl 2005-12-21 14:34:03.000000000 -0500 +@@ -7327,7 +7327,10 @@ + error('Unable to write configuration file "' . $name . '".' . "\n\n"); + } + db_add_file($name, 0x1); +- safe_chmod(0644, $name); ++ safe_chmod(0664, $name); ++ my $gid = (getgrnam('vmware'))[2]; ++ my $uid = (stat($name))[4]; ++ safe_chown($uid,$gid,$name); + + # Append the promotional configuration if it exists + $promoconfig = $libdir . '/configurator/PROMOCONFIG'; diff --git a/app-emulation/vmware-converter/files/4.0.0.146302.off/002_all_pagebreak-detection-fix.patch b/app-emulation/vmware-converter/files/4.0.0.146302.off/002_all_pagebreak-detection-fix.patch new file mode 100644 index 0000000..fd3fc76 --- /dev/null +++ b/app-emulation/vmware-converter/files/4.0.0.146302.off/002_all_pagebreak-detection-fix.patch @@ -0,0 +1,15 @@ +diff -ur vmware-distrib.orig/bin/vmware-config.pl vmware-distrib/bin/vmware-config.pl +--- vmware-distrib.orig/bin/vmware-config.pl 2006-03-24 23:13:05.000000000 +0100 ++++ vmware-distrib/bin/vmware-config.pl 2006-03-24 23:26:40.000000000 +0100 +@@ -2015,9 +2015,9 @@ + . shell_string($pattern)); + chomp($header_page_offset); + # Ignore PAGE_OFFSET if we cannot parse it. +- if ($header_page_offset =~ /^$pattern \(?0x([0-9a-fA-F]{8,})/) { ++ if ($header_page_offset =~ /^$pattern \(?(\([^)]*\))?\)?0x([0-9a-fA-F]{8,}).*$/) { + # We found a valid page offset +- $header_page_offset = $1; ++ $header_page_offset = $2; + if (defined($gSystem{'page_offset'}) and + not (lc($header_page_offset) eq lc($gSystem{'page_offset'}))) { + if ($source eq 'user') { diff --git a/app-emulation/vmware-converter/files/4.0.0.146302.off/004_all_do-not-build-modules.patch b/app-emulation/vmware-converter/files/4.0.0.146302.off/004_all_do-not-build-modules.patch new file mode 100644 index 0000000..cec3b3e --- /dev/null +++ b/app-emulation/vmware-converter/files/4.0.0.146302.off/004_all_do-not-build-modules.patch @@ -0,0 +1,17 @@ +diff -uNr vmware-server-distrib.orig/bin/vmware-config.pl vmware-server-distrib/bin/vmware-config.pl +--- vmware-server-distrib.orig/bin/vmware-config.pl 2006-02-18 18:12:26.000000000 +0000 ++++ vmware-server-distrib/bin/vmware-config.pl 2006-02-18 18:14:17.000000000 +0000 +@@ -8571,10 +8571,10 @@ + configure_gtk2(); + # createMimePackageFile(); + # configureDesktopFiles(); +- configure_mon(); +- configure_pp(); ++# configure_mon(); ++# configure_pp(); + configure_net(); +- build_vmnet(); ++# build_vmnet(); + } + + # Create the directory for the UNIX domain sockets diff --git a/app-emulation/vmware-converter/files/4.0.0.146302.off/007_all_use-modprobe-over-insmod.patch b/app-emulation/vmware-converter/files/4.0.0.146302.off/007_all_use-modprobe-over-insmod.patch new file mode 100644 index 0000000..5509d24 --- /dev/null +++ b/app-emulation/vmware-converter/files/4.0.0.146302.off/007_all_use-modprobe-over-insmod.patch @@ -0,0 +1,12 @@ +diff -uNr vmware-server-distrib/installer/services.sh vmware-server-distrib.new/installer/services.sh +--- vmware-server-distrib/installer/services.sh 2006-02-05 00:21:25.000000000 +0000 ++++ vmware-server-distrib.new/installer/services.sh 2006-02-20 23:48:07.000000000 +0000 +@@ -538,7 +538,7 @@ + } + + vmware_load_module() { +- /sbin/insmod -s -f "/lib/modules/`uname -r`/misc/$1.o" || exit 1 ++ /sbin/modprobe -s "$1" || exit 1 + exit 0 + } + diff --git a/app-emulation/vmware-converter/files/4.0.0.146302.off/009_all_init.d-modules-warning.patch b/app-emulation/vmware-converter/files/4.0.0.146302.off/009_all_init.d-modules-warning.patch new file mode 100644 index 0000000..4eab043 --- /dev/null +++ b/app-emulation/vmware-converter/files/4.0.0.146302.off/009_all_init.d-modules-warning.patch @@ -0,0 +1,19 @@ +diff -uNr vmware-server-distrib.orig/installer/services.sh vmware-server-distrib/installer/services.sh +--- vmware-server-distrib.orig/installer/services.sh 2006-07-01 03:14:16.000000000 +0000 ++++ vmware-server-distrib/installer/services.sh 2006-07-14 11:59:28.000000000 +0000 +@@ -606,8 +606,13 @@ + start) + if [ -e "$vmware_etc_dir"/not_configured ]; then + echo "`vmware_product_name`"' is installed, but it has not been (correctly) configured' +- echo 'for the running kernel. To (re-)configure it, invoke the' +- echo 'following command: '"$vmdb_answer_BINDIR"'/vmware-config.pl.' ++ echo 'for the running kernel.' ++ echo ++ echo 'Please ensure that the modules have been compiled for this kernel:' ++ echo ' emerge --oneshot vmware-modules' ++ echo ++ echo 'Also ensure '"`vmware_product_name`"' has been configured:' ++ echo ' '"$vmdb_answer_BINDIR"'/vmware-config.pl' + echo + + exit 1 diff --git a/app-emulation/vmware-converter/files/vmware-converter.rc b/app-emulation/vmware-converter/files/vmware-converter.rc new file mode 100644 index 0000000..1bb31c4 --- /dev/null +++ b/app-emulation/vmware-converter/files/vmware-converter.rc @@ -0,0 +1,74 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/vmware-workstation/files/vmware-workstation.rc,v 1.6 2007/11/25 12:50:32 ikelos Exp $ + +depend() { + need localmount + use logger net hald + after samba +} + +vmware_prettify() { + # Yea, the code is ugly but the output is pretty + state=$1 + waserror=0 + msgtype=0 + while read line + do + [ "${line}" = "" ] && continue + if [ ${msgtype} -le 0 ] + then + if [ ${msgtype} -eq -1 ] + then + ewarn ${line} + continue + fi + case ${line} in + *:*) + einfon ${line} + echo + eend 0 + msgtype=1;; + *) + ewarn ${line} + msgtype=-1 + waserror=1;; + esac + continue + fi + + # Strip out anything after the <esc> code + message=`echo ${line} | sed -e "s/^\(.*\).*$/\1/"` + einfon " ${message}" + echo + + echo ${line} | grep -q done + status=$? + eend ${status} + + if [ ${status} -eq 0 ] + then + logger -p local0.err -t vmware-${state} "${line}" + waserror=${status} + fi + done + if [ "${msgtype}" = "-1" ] + then + eend 1 "VMware is not properly configured! See above." + fi + return ${waserror} +} + +start() { + test -x /etc/vmware-converter/init.d/vmware-converter || \ + eend 1 "vmware init script not found. Aborting" || return 1 + + /etc/vmware-converter/init.d/vmware-converter start | vmware_prettify start + return $? +} + +stop() { + /etc/vmware-converter/init.d/vmware-converter stop | vmware_prettify stop + return $? +} diff --git a/app-emulation/vmware-converter/vmware-converter-4.0.0.146302.ebuild b/app-emulation/vmware-converter/vmware-converter-4.0.0.146302.ebuild new file mode 100644 index 0000000..2143523 --- /dev/null +++ b/app-emulation/vmware-converter/vmware-converter-4.0.0.146302.ebuild @@ -0,0 +1,96 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/vmware-workstation/vmware-workstation-5.5.6.80404.ebuild,v 1.2 2008/04/26 16:29:15 ikelos Exp $ + +inherit vmware eutils versionator + +MY_P="VMware-converter-$(replace_version_separator 3 - $PV)" + +DESCRIPTION="Converts a complete PC on your PC without the usual performance overhead of most emulators" +HOMEPAGE="http://www.vmware.com/download/ws/ws5.html" +SRC_URI="${MY_P}.tar.gz" + +LICENSE="vmware" +SLOT="0" +KEYWORDS="-*" +IUSE="server client" +RESTRICT="fetch strip" + +# vmware-workstation should not use virtual/libc as this is a +# precompiled binary package thats linked to glibc. +RDEPEND="sys-libs/glibc + amd64? ( + app-emulation/emul-linux-x86-gtklibs ) + x86? ( + x11-libs/libXrandr + x11-libs/libXcursor + x11-libs/libXinerama + x11-libs/libXi + x11-libs/libXft ) + >=dev-lang/perl-5 + sys-apps/pciutils" + +S=${WORKDIR}/vmware-converter-distrib + +RUN_UPDATE="no" +ANY_ANY="" + +dir=/opt/vmware/converter +Ddir=${D}/${dir} + +src_unpack() { + vmware_src_unpack + cd ${S} + rmdir sbin + + sed -i -e "s|##{CONFDIR}##|/etc/vmware-converter|" ${S}/conf/converter-*.xml + sed -i -e "s|##{LIBDIR}##|${VMWARE_INSTALL_DIR}/lib|" ${S}/conf/converter-*.xml + sed -i -e "s|##{DATADIR}##|/var/lib/vmware-vcenter-converter-standalone|" ${S}/conf/converter-*.xml + sed -i -e "s|##{LOGDIR}##|/var/log/vmware-vcenter-converter-standalone|" ${S}/conf/converter-*.xml + sed -i -e "s|##{FORCELOCAL}##|false|" ${S}/conf/converter-*.xml + sed -i -e "s|##{STANDALONE}##|true|" ${S}/conf/converter-*.xml + sed -i -e "s|##{LOGINBOX}##|true|" ${S}/conf/converter-*.xml + sed -i -e "s|##{ENABLE_REMOTE_ACCESS}##|true|" ${S}/conf/converter-*.xml + sed -i -e "s|##{PROXY_HTTP_PORT}##|80|" ${S}/conf/converter-*.xml + sed -i -e "s|##{PROXY_HTTPS_PORT}##|443|" ${S}/conf/converter-*.xml +} + +src_install() { + # Sed and install the files in ./conf + cd ${S} + insinto /etc/${PN} + doins etc/icudt38l.dat + doins conf/* + + # mkdir libdir and copy over the common stuff + + cd ${S}/lib + dodir "${VMWARE_INSTALL_DIR}/lib" + cp -rP common/* "${D}/${VMWARE_INSTALL_DIR}/lib" || die "Failed to copy common files" + use server && ( cp -rP server/* "${D}/${VMWARE_INSTALL_DIR}/lib" || die "Failed to copy server files" ) + use client && ( cp -rP client/* "${D}/${VMWARE_INSTALL_DIR}/lib" || die "Failed to copy client files" ) + + # Symlink everything up + dodir "${VMWARE_INSTALL_DIR}/bin" + for i in ${D}/${VMWARE_INSTALL_DIR}/lib/bin/*; + do + j=$(basename ${i}) + dosym "${VMWARE_INSTALL_DIR}/lib/bin/${j}" "${VMWARE_INSTALL_DIR}/bin/${j}" + done + + if $(use server); + then + dodir /etc/${PN}/init.d + exeinto /etc/${PN}/init.d + doexe ${S}/system_etc/init.d/${PN} + newinitd ${FILESDIR}/${PN}.rc ${PN} + fi + + dosym /opt/vmware/converter/lib/configurator/pam.d/${PN} /etc/pam.d/${PN} + + # Finally, we run the "questions" + vmware_run_questions || die "running questions" + + use server && ( echo "answer INSTALL_SERVER yes" >> "${D}${config_dir}/locations" ) + echo "answer ENABLE_REMOTE_ACCESS yes" >> "${D}${config_dir}/locations" +} diff --git a/eclass/vmware.eclass b/eclass/vmware.eclass new file mode 100644 index 0000000..7d4e58e --- /dev/null +++ b/eclass/vmware.eclass @@ -0,0 +1,416 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/eclass/vmware.eclass,v 1.31 2008/04/26 13:51:40 ikelos Exp $ + +# This eclass is for all vmware-* ebuilds in the tree and should contain all +# of the common components across the multiple packages. + +# Only one package per "product" is allowed to be installed at any given time. + +inherit pax-utils eutils + +EXPORT_FUNCTIONS pkg_preinst pkg_postinst pkg_setup src_install src_unpack pkg_postrm + +DEPEND="x11-misc/shared-mime-info" + +export ANY_ANY="vmware-any-any-update115" +#export TOOLS_ANY="vmware-tools-any-update1" +export VMWARE_GROUP=${VMWARE_GROUP:-vmware} +export VMWARE_INSTALL_DIR=/opt/${PN//-//} + +vmware_create_initd() { + dodir "${config_dir}"/init.d/rc{0,1,2,3,4,5,6}.d + # 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. + keepdir "${config_dir}"/init.d/rc{0,1,2,3,4,5,6}.d +} + +vmware_run_questions() { + vmware_determine_product + # Questions: + einfo "Adding answers to ${config_dir}/locations" + locations="${D}${config_dir}/locations" + echo "answer BINDIR ${VMWARE_INSTALL_DIR}/bin" >> ${locations} + echo "answer LIBDIR ${VMWARE_INSTALL_DIR}/lib" >> ${locations} + echo "answer MANDIR ${VMWARE_INSTALL_DIR}/man" >> ${locations} + echo "answer DOCDIR ${VMWARE_INSTALL_DIR}/doc" >> ${locations} + if [ "${product}" == "vmware" -o "${product}" == "vmware-tools" ] + then + echo "answer SBINDIR ${VMWARE_INSTALL_DIR}/sbin" >> ${locations} + echo "answer RUN_CONFIGURATOR no" >> ${locations} + echo "answer INITDIR ${config_dir}/init.d" >> ${locations} + echo "answer INITSCRIPTSDIR ${config_dir}/init.d" >> ${locations} + fi +} + +vmware_determine_product() { + # Set the product category, and the category options + shortname=$(echo ${PN} | cut -d- -f2-) + case "${shortname}" in + workstation|server|player) + product="vmware" + config_program="vmware-config.pl" + ;; + server-console|esx-console|gsx-console) + product="vmware-console" + config_program="vmware-config-console.pl" + ;; + workstation-tools|esx-tools|gsx-tools|server-tools) + product="vmware-tools" + config_program="vmware-config-tools.pl" + ;; + *) + product="unknown" + ;; + esac + config_dir="/etc/${product}" + + # Set per package options + case "${shortname}" in + workstation) + FULL_NAME="Workstation" + ;; + player) + FULL_NAME="Player" + ;; + converter) + FULL_NAME="Converter" + config_dir="/etc/${PN}" + ;; + server) + FULL_NAME="Server" + ;; + server-console) + FULL_NAME="Server Console" + config_program="vmware-config-server-console.pl" + config_dir="/etc/${PN}" + ;; + esx-console) + FULL_NAME="ESX Console" + ;; + esac +} + +vmware_pkg_setup() { + vmware_determine_product +} + +vmware_src_unpack() { + vmware_determine_product + case "${product}" in + vmware-tools) + # We grab our tarball from "CD" + einfo "You will need ${TARBALL} from the VMware installation." + einfo "Select VM->Install VMware Tools from VMware's menu." + cdrom_get_cds ${TARBALL} + ;; + esac + # If there is anything to unpack, at all, then we should be using MY_P. + if [[ -n "${MY_P}" ]] + then + if [[ -e "${CDROM_ROOT}"/${MY_P}.tar.gz ]] + then + tar xzf "${CDROM_ROOT}"/${MY_P}.tar.gz + else + unpack "${MY_P}".tar.gz + fi + + if [[ -n "${ANY_ANY}" ]] + then + unpack "${ANY_ANY}".tar.gz + # Move the relevant ANY_ANY files now, so that they can be patched later... + mv -f "${ANY_ANY}"/services.sh "${S}"/installer/services.sh + # We should be able to get rid of this eventually, + # since we'll be using vmware-modules in future... + [[ "${product}" == "vmware" ]] && \ + mv -f "${ANY_ANY}"/*.tar "${S}"/lib/modules/source + [[ -e lib/bin/vmware ]] && \ + chmod 755 lib/bin/vmware + [[ -e bin/vmnet-bridge ]] && \ + chmod 755 bin/vmnet-bridge + [[ -e lib/bin/vmware-vmx ]] && \ + chmod 755 lib/bin/vmware-vmx + [[ -e lib/bin-debug/vmware-vmx ]] && \ + chmod 755 lib/bin-debug/vmware-vmx + if [[ "${RUN_UPDATE}" == "yes" ]] + then + cd "${S}"/"${ANY_ANY}" + ./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 + fi + + # Remove PAX MPROTECT flag from all applicable files in /bin, /sbin for + # the vmware package only (since modules, tools and console should not + # need to generate code on the fly in memory). + [[ "${product}" == "vmware" ]] && pax-mark -m \ + $(list-paxables ${S}/{bin{,-debug},sbin}/{vmware-serverd,vmware-vmx}) + + # Run through any patches that might need to be applied + cd "${S}" + if [[ -d "${FILESDIR}/${PV}" ]] + then + EPATCH_SUFFIX="patch" + epatch "${FILESDIR}"/${PV} + fi + if [[ -n "${PATCHES}" ]] + then + for patch in ${PATCHES} + do + epatch "${FILESDIR}"/${patch} + done + fi + # Unpack our new libs + for a in ${A} + do + case ${a} in + vmware-libssl.so.0.9.7l.tar.bz2) + unpack vmware-libssl.so.0.9.7l.tar.bz2 + ;; + vmware-libcrypto.so.0.9.7l.tar.bz2) + unpack vmware-libcrypto.so.0.9.7l.tar.bz2 + ;; + esac + done + fi +} + +vmware_src_install() { + # We won't want any perl scripts from VMware once we've finally got all + # of the configuration done, but for now, they're necessary. + #rm -f bin/*.pl + + # As backwards as this seems, we're installing our icons first. + if [[ -e lib/share/icons/48x48/apps/${PN}.png ]] + then + doicon lib/share/icons/48x48/apps/${PN}.png + elif [[ -e doc/icon48x48.png ]] + then + newicon doc/icon48x48.png ${PN}.png + elif [[ -e "${DISTDIR}/${product}.png" ]] + then + newicon "${DISTDIR}"/${product}.png ${PN}.png + fi + + # Since with Gentoo we compile everthing it doesn't make sense to keep + # the precompiled modules arround. Saves about 4 megs of disk space too. + rm -rf "${S}"/lib/modules/binary + # We also don't need to keep the icons around, or do we? + #rm -rf ${S}/lib/share/icons + + # Just like any good monkey, we install the documentation and man pages. + [[ -d doc ]] && dodoc doc/* + if [[ -d man ]] + then + cd man + for x in * + do + doman ${x}/* || die "doman" + done + fi + cd "${S}" + + # We remove the shipped libssl for bug #148682 + if [ -d "${S}"/libssl.so.0.9.7 ] + then + rm -rf "${S}"/lib/lib/libssl.so.0.9.7 + # Now, we move in our own + cp -pPR "${S}"/libssl.so.0.9.7 "${S}"/lib/lib + fi + # We remove the shipped libcrypto for bug #148682 + if [ -d "${S}"/libcrypto.so.0.9.7 ] + then + rm -rf "${S}"/lib/lib/libcrypto.so.0.9.7 + # Now, we move in our own + cp -pPR "${S}"/libcrypto.so.0.9.7 "${S}"/lib/lib + fi + + # We loop through our directories and copy everything to our system. + for x in bin lib sbin + do + if [[ -e "${S}/${x}" ]] + then + dodir "${VMWARE_INSTALL_DIR}"/${x} + cp -pPR "${S}"/${x}/* "${D}""${VMWARE_INSTALL_DIR}"/${x} \ + || die "copying ${x}" + fi + done + + # If we have an /etc directory, we copy it. + if [[ -e "${S}/etc" ]] + then + dodir "${config_dir}" + cp -pPR "${S}"/etc/* "${D}""${config_dir}" + fowners root:${VMWARE_GROUP} "${config_dir}" + fperms 770 "${config_dir}" + fi + + # If we have any helper files, we install them. First, we check for an + # init script. + if [[ -e "${FILESDIR}/${PN}.rc" ]] + then + newinitd "${FILESDIR}"/${PN}.rc ${product} || die "newinitd" + fi + # Then we check for an environment file. + if [[ -e "${FILESDIR}/90${PN}" ]] + then + doenvd "${FILESDIR}"/90${PN} || die "doenvd" + fi + # Last, we check for any mime files. + if [[ -e "${FILESDIR}/${PN}.xml" ]] + then + insinto /usr/share/mime/packages + doins "${FILESDIR}"/${PN}.xml || die "mimetypes" + fi + + # Blame bug #91191 for this one. + if [[ -e doc/EULA ]] + then + insinto "${VMWARE_INSTALL_DIR}"/doc + doins doc/EULA || die "copying EULA" + fi + + # Do we have vmware-ping/vmware-vmx? If so, make them setuid. + for p in /bin/vmware-ping /lib/bin/vmware-vmx /lib/bin-debug/vmware-vmx /lib/bin/vmware-vmx-debug /sbin/vmware-authd; + do + if [ -x "${D}${VMWARE_INSTALL_DIR}${p}" ] + then + fowners root:${VMWARE_GROUP} "${VMWARE_INSTALL_DIR}"${p} + fperms 4750 "${VMWARE_INSTALL_DIR}"${p} + fi + done + + # This removed the user/group warnings + # But also broke vmware-server with FEATURES="userpriv" since it removes + # the set-UID bit + #chown -R root:${VMWARE_GROUP} ${D} || die + + # We like desktop icons. + # TODO: Fix up the icon creation, across the board. + #make_desktop_entry ${PN} "VMware ${FULL_NAME}" ${PN}.png + + # We like symlinks for console users. + # TODO: Fix up the symlink creation, across the board. + # dosym ${VMWARE_INSTALL_DIR}/bin/${PN} /usr/bin/${PN} + + # TODO: Replace this junk + # Everything after this point will hopefully go away once we can rid + # ourselves of the evil perl configuration scripts. + + if [ "${product}" == "vmware" -o "${product}" == "vmware-tools" ] + then + + # We have to create a bunch of rc directories for the init script + vmware_create_initd || die "creating rc directories" + + # Now, we copy in our services.sh file + exeinto "${config_dir}"/init.d + newexe installer/services.sh ${product} || die "services.sh" + + # Set the name + dosed "s:%LONGNAME%:Vmware ${FULL_NAME}:" \ + "${config_dir}"/init.d/${product} + [ "${shortname}" == "server" ] && dosed "s:%SHORTNAME%:wgs:" \ + "${config_dir}"/init.d/${product} + fi + + # Finally, we run the "questions" + vmware_run_questions || die "running questions" +} + +vmware_pkg_preinst() { + # This is run here due to bug #143150 + [ -z "${product}" ] && vmware_determine_product + + # This must be done after the install to get the mtimes on each file + # right. + + #Note: it's a bit weird to use ${D} in a preinst script but it should work + #(drobbins, 1 Feb 2002) + + einfo "Generating ${config_dir}/locations file." + d=`echo ${D} | wc -c` + for x in `find ${D}${VMWARE_INSTALL_DIR} ${D}${config_dir}` ; do + x="`echo ${x} | cut -c ${d}-`" + if [ -d "${D}/${x}" ] ; then + echo "directory ${x}" >> "${D}${config_dir}"/locations + else + echo -n "file ${x}" >> "${D}${config_dir}"/locations + if [ "${x}" == "${config_dir}/locations" ] ; then + echo "" >> "${D}${config_dir}"/locations + elif [ "${x}" == "${config_dir}/not_configured" ] ; then + echo "" >> "${D}${config_dir}"/locations + else + echo -n " " >> "${D}${config_dir}"/locations + find ${D}${x} -printf %T@ >> "${D}${config_dir}"/locations + echo "" >> "${D}${config_dir}"/locations + fi + fi + done +} + +vmware_pkg_postinst() { + update-mime-database /usr/share/mime + [[ -d "${config_dir}" ]] && chown -R root:${VMWARE_GROUP} ${config_dir} + + # 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. + einfo "Updating ${config_dir}/locations" + for x in "${config_dir}"/._cfg????_locations ; do + if [ -f $x ] ; then + cat $x >> "${config_dir}"/locations + rm $x + fi + done + + echo + elog "You need to run " + elog " ${VMWARE_INSTALL_DIR}/bin/${config_program}" + elog "to complete the install." + echo + einfo "For VMware Add-Ons just visit" + einfo "http://www.vmware.com/download/downloadaddons.html" + echo + if [ "${PN}" == "vmware-player" ] + then + elog "After configuring, run vmplayer to launch" + else + elog "After configuring, run ${PN} to launch" + fi + echo + if [ "${product}" == "vmware" -o "${product}" == "vmware-tools" ] + then + elog "Also note that when you reboot you should run:" + elog " /etc/init.d/${product} start" + elog "before trying to run ${product}. Or you could just add it to" + elog "the default runlevel:" + elog " rc-update add ${product} default" + echo + ewarn "VMWare allows for the potential of overwriting files as root. Only" + ewarn "give VMWare access to trusted individuals." + echo + fi + ewarn "Remember, in order to run VMware ${FULL_NAME}, you have to" + ewarn "be in the '${VMWARE_GROUP}' group." + echo +} + +vmware_pkg_postrm() { + [ -z "${product}" ] && vmware_determine_product + local product_extras + if [ "${product}" == "vmware" ] + then + product_extras=" and /etc/init.d/${product}" + fi + if ! has_version app-emulation/${PN}; then + echo + elog "To remove all traces of ${product} you will need to remove the files" + elog "in ${config_dir}${product_extras}." + elog "If the vmware-modules package is installed, you may no longer need it." + echo + fi +} diff --git a/profiles/package.mask b/profiles/package.mask new file mode 100644 index 0000000..73c25a6 --- /dev/null +++ b/profiles/package.mask @@ -0,0 +1,5 @@ +# Mike Auty <ikelos@gentoo.org> (4 Mar 2009) +# Masked. Don't use it. Really. +# Not even for testing, this will probably never go stable. +# Almost certainly broken. +app-emulation/vmware-converter |