# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/app-emulation/vmware-server/vmware-server-2.0.2.203138-r1.ebuild,v 1.4 2010/05/13 22:33:47 vadimk Exp $ # Unlike many other binary packages the user doesn't need to agree to a licence # to download VMWare. The agreeing to a licence is part of the configure step # which the user must run manually. EAPI="2" inherit eutils pam pax-utils versionator MY_PV=$(replace_version_separator 3 '-' ) MY_PN="VMware-server-${MY_PV}" DESCRIPTION="VMware Server for Linux" HOMEPAGE="http://www.vmware.com/" DOWNLOAD_URL="http://downloads.vmware.com/d/info/datacenter_downloads/vmware_server/2_0" SRC_URI=" x86? ( mirror://vmware/software/server/${MY_PN}.i386.tar.gz ) amd64? ( mirror://vmware/software/server/${MY_PN}.x86_64.tar.gz ) " LICENSE="vmware" IUSE="" SLOT="0" KEYWORDS="-* ~x86 ~amd64" RESTRICT="strip" CDEPEND=" >=dev-lang/perl-5 >=sys-libs/glibc-2.3.5 sys-apps/pciutils" DEPEND="${CDEPEND} sys-apps/findutils x11-misc/shared-mime-info virtual/os-headers" # vmware-server should not use virtual/libc as this is a # precompiled binary package thats linked to glibc. RDEPEND="${CDEPEND} ~app-emulation/vmware-modules-208.2 dev-libs/expat dev-libs/glib dev-libs/libxml2 =media-libs/libpng-1.2* sys-apps/hal sys-fs/fuse sys-libs/zlib virtual/pam x11-libs/libICE x11-libs/libSM x11-libs/libX11 x11-libs/libXau x11-libs/libXdmcp x11-libs/libXext x11-libs/libXft x11-libs/libXt x11-libs/libXtst x11-misc/xdg-utils !> ${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} 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} echo "answer VMCI_CONFED yes" >> ${locations} echo "answer VSOCK_CONFED yes" >> ${locations} } pkg_config() { einfo "Running ${VMWARE_INSTALL_DIR}/bin/vmware-config.pl" "${VMWARE_INSTALL_DIR}/bin/vmware-config.pl" } pkg_preinst() { # 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 } 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 ewarn "Use " ewarn " emerge vmware-server --config" ewarn "to configure your installation of ${product_name}." ewarn "In order to run ${product_name}, you have to" ewarn "be in the '${VMWARE_GROUP}' group." #ewarn "By default xinetd only allows connections from localhost" #ewarn "To allow external users access to vmware-server you must edit" #ewarn " /etc/xinetd.d/vmware-authd" #ewarn "and specify a new 'only_from' line" ewarn "VMWare Server also has issues when running on a JFS filesystem. For more" ewarn "information see http://bugs.gentoo.org/show_bug.cgi?id=122500#c94" } pkg_prerm() { einfo "Stopping ${product_name} for safe unmerge" /etc/init.d/vmware stop } pkg_postrm() { if ! has_version app-emulation/${PN}; then elog "To remove all traces of ${product} you will need to remove the files" elog "in ${config_dir} and /etc/init.d/${product}." elog "If the vmware-modules package is installed, you may no longer need it." fi }