| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/app-emulation/vmware-workstation/vmware-workstation-7.1.5.491717.ebuild,v 1.3 2012/03/24 13:50:09 vadimk Exp $
|
| 4 |
|
| 5 |
EAPI="2"
|
| 6 |
|
| 7 |
inherit eutils versionator fdo-mime gnome2-utils vmware-bundle
|
| 8 |
|
| 9 |
MY_PN="VMware-Workstation"
|
| 10 |
MY_PV="$(replace_version_separator 3 - $PV)"
|
| 11 |
MY_P="${MY_PN}-${MY_PV}"
|
| 12 |
|
| 13 |
DESCRIPTION="Emulate a complete PC on your PC without the usual performance overhead of most emulators"
|
| 14 |
HOMEPAGE="http://www.vmware.com/products/workstation/"
|
| 15 |
SRC_URI="
|
| 16 |
x86? ( ${MY_P}.i386.bundle )
|
| 17 |
amd64? ( ${MY_P}.x86_64.bundle )
|
| 18 |
"
|
| 19 |
|
| 20 |
LICENSE="vmware"
|
| 21 |
SLOT="0"
|
| 22 |
KEYWORDS="-* ~amd64 ~x86"
|
| 23 |
IUSE="doc vix +vmware-tools"
|
| 24 |
RESTRICT="binchecks fetch mirror strip"
|
| 25 |
|
| 26 |
# vmware-workstation should not use virtual/libc as this is a
|
| 27 |
# precompiled binary package thats linked to glibc.
|
| 28 |
RDEPEND="dev-cpp/cairomm
|
| 29 |
dev-cpp/glibmm:2
|
| 30 |
dev-cpp/gtkmm:2.4
|
| 31 |
dev-cpp/libgnomecanvasmm
|
| 32 |
dev-cpp/libsexymm
|
| 33 |
dev-cpp/pangomm
|
| 34 |
dev-libs/atk
|
| 35 |
dev-libs/glib:2
|
| 36 |
dev-libs/libaio
|
| 37 |
dev-libs/libsigc++
|
| 38 |
dev-libs/libxml2
|
| 39 |
=dev-libs/openssl-0.9.8*
|
| 40 |
dev-libs/xmlrpc-c
|
| 41 |
gnome-base/libgnomecanvas
|
| 42 |
gnome-base/libgtop:2
|
| 43 |
gnome-base/librsvg:2
|
| 44 |
gnome-base/orbit
|
| 45 |
media-libs/fontconfig
|
| 46 |
media-libs/freetype
|
| 47 |
media-libs/libart_lgpl
|
| 48 |
=media-libs/libpng-1.2*
|
| 49 |
net-misc/curl
|
| 50 |
sys-devel/gcc
|
| 51 |
sys-fs/fuse
|
| 52 |
sys-libs/glibc
|
| 53 |
sys-libs/zlib
|
| 54 |
x11-libs/cairo
|
| 55 |
x11-libs/gtk+:2
|
| 56 |
x11-libs/libgksu
|
| 57 |
x11-libs/libICE
|
| 58 |
x11-libs/libsexy
|
| 59 |
x11-libs/libSM
|
| 60 |
>=x11-libs/libview-0.6.6
|
| 61 |
x11-libs/libX11
|
| 62 |
x11-libs/libXau
|
| 63 |
x11-libs/libxcb
|
| 64 |
x11-libs/libXcomposite
|
| 65 |
x11-libs/libXcursor
|
| 66 |
x11-libs/libXdamage
|
| 67 |
x11-libs/libXdmcp
|
| 68 |
x11-libs/libXext
|
| 69 |
x11-libs/libXfixes
|
| 70 |
x11-libs/libXft
|
| 71 |
x11-libs/libXi
|
| 72 |
x11-libs/libXinerama
|
| 73 |
x11-libs/libXrandr
|
| 74 |
x11-libs/libXrender
|
| 75 |
x11-libs/libXtst
|
| 76 |
x11-libs/pango
|
| 77 |
x11-libs/startup-notification
|
| 78 |
x11-themes/hicolor-icon-theme
|
| 79 |
!app-emulation/vmware-player"
|
| 80 |
PDEPEND="~app-emulation/vmware-modules-238.5
|
| 81 |
vmware-tools? ( app-emulation/vmware-tools )"
|
| 82 |
|
| 83 |
S=${WORKDIR}
|
| 84 |
VM_INSTALL_DIR="/opt/vmware"
|
| 85 |
|
| 86 |
pkg_nofetch() {
|
| 87 |
local bundle
|
| 88 |
|
| 89 |
if use x86; then
|
| 90 |
bundle="${MY_P}.i386.bundle"
|
| 91 |
elif use amd64; then
|
| 92 |
bundle="${MY_P}.x86_64.bundle"
|
| 93 |
fi
|
| 94 |
|
| 95 |
einfo "Please download ${bundle}"
|
| 96 |
einfo "from ${HOMEPAGE}"
|
| 97 |
einfo "and place it in ${DISTDIR}"
|
| 98 |
}
|
| 99 |
|
| 100 |
src_unpack() {
|
| 101 |
vmware-bundle_extract-bundle-component "${DISTDIR}/${A}" vmware-player-app
|
| 102 |
vmware-bundle_extract-bundle-component "${DISTDIR}/${A}" vmware-player-setup
|
| 103 |
vmware-bundle_extract-bundle-component "${DISTDIR}/${A}" vmware-workstation
|
| 104 |
if use vix; then
|
| 105 |
vmware-bundle_extract-bundle-component "${DISTDIR}/${A}" vmware-vix
|
| 106 |
fi
|
| 107 |
}
|
| 108 |
|
| 109 |
src_prepare() {
|
| 110 |
rm -rf "${S}"/vmware-player-app/bin/vmware-modconfig
|
| 111 |
rm -rf "${S}"/vmware-player-app/lib/modules/binary
|
| 112 |
|
| 113 |
# remove superfluous libraries
|
| 114 |
ebegin 'Removing superfluous libraries'
|
| 115 |
cd vmware-player-app/lib/lib || die
|
| 116 |
# exclude OpenSSL from unbundling until the AES-NI patch gets into the tree
|
| 117 |
# see http://forums.gentoo.org/viewtopic-t-835867.html
|
| 118 |
ldconfig -p | sed 's:^\s\+\([^(]*[^( ]\).*=> /.*$:\1:g;t;d' | fgrep -vx 'libcrypto.so.0.9.8
|
| 119 |
libssl.so.0.9.8' | xargs -d'\n' -r rm -rf
|
| 120 |
cd ../../../vmware-workstation/lib/lib || die
|
| 121 |
ldconfig -p | sed 's:^\s\+\([^(]*[^( ]\).*=> /.*$:\1:g;t;d' | fgrep -vx 'libcrypto.so.0.9.8
|
| 122 |
libssl.so.0.9.8' | xargs -d'\n' -r rm -rf
|
| 123 |
eend
|
| 124 |
}
|
| 125 |
|
| 126 |
src_install() {
|
| 127 |
local major_minor_revision=$(get_version_component_range 1-3 "${PV}")
|
| 128 |
local build=$(get_version_component_range 4 "${PV}")
|
| 129 |
|
| 130 |
cd "${S}"/vmware-player-app
|
| 131 |
|
| 132 |
# install the binaries
|
| 133 |
into "${VM_INSTALL_DIR}"
|
| 134 |
dobin bin/*
|
| 135 |
dosbin sbin/*
|
| 136 |
|
| 137 |
# install the libraries
|
| 138 |
insinto "${VM_INSTALL_DIR}"/lib/vmware
|
| 139 |
doins -r lib/*
|
| 140 |
|
| 141 |
# install the ancillaries
|
| 142 |
insinto /usr
|
| 143 |
doins -r share
|
| 144 |
|
| 145 |
# commented out until Portage gets OpenSSL 0.9.8 with AES-NI support
|
| 146 |
# see http://forums.gentoo.org/viewtopic-t-835867.html
|
| 147 |
## these two libraries do not like to load from /usr/lib*
|
| 148 |
#local each ; for each in libcrypto.so.0.9.8 libssl.so.0.9.8 ; do
|
| 149 |
# if [[ ! -f "${VM_INSTALL_DIR}/lib/vmware/lib/${each}" ]] ; then
|
| 150 |
# dosym "/usr/$(get_libdir)/${each}" \
|
| 151 |
# "${VM_INSTALL_DIR}/lib/vmware/lib/${each}/${each}"
|
| 152 |
# fi
|
| 153 |
#done
|
| 154 |
|
| 155 |
# install vmware-config
|
| 156 |
cd "${S}"/vmware-player-setup
|
| 157 |
insinto "${VM_INSTALL_DIR}"/lib/vmware/setup
|
| 158 |
doins vmware-config
|
| 159 |
|
| 160 |
# install vmware-workstation
|
| 161 |
cd "${S}"/vmware-workstation
|
| 162 |
|
| 163 |
# install the binaries
|
| 164 |
into "${VM_INSTALL_DIR}"
|
| 165 |
dobin bin/*
|
| 166 |
|
| 167 |
# install the libraries
|
| 168 |
insinto "${VM_INSTALL_DIR}"/lib/vmware
|
| 169 |
doins -r lib/*
|
| 170 |
|
| 171 |
# install the ancillaries
|
| 172 |
insinto /usr
|
| 173 |
doins -r share
|
| 174 |
|
| 175 |
# install documentation
|
| 176 |
doman man/man1/vmware.1.gz
|
| 177 |
|
| 178 |
if use doc; then
|
| 179 |
dodoc doc/open_source_licenses.txt
|
| 180 |
dodoc doc/vmware-vmci/samples/*
|
| 181 |
fi
|
| 182 |
|
| 183 |
# install vmware-vix
|
| 184 |
if use vix; then
|
| 185 |
cd "${S}"/vmware-vix
|
| 186 |
|
| 187 |
# install the binary
|
| 188 |
into "${VM_INSTALL_DIR}"
|
| 189 |
dobin bin/*
|
| 190 |
|
| 191 |
# install the libraries
|
| 192 |
insinto "${VM_INSTALL_DIR}"/lib/vmware-vix
|
| 193 |
doins -r lib/*
|
| 194 |
|
| 195 |
dosym vmware-vix/libvixAllProducts.so "${VM_INSTALL_DIR}"/lib/libbvixAllProducts.so
|
| 196 |
|
| 197 |
# install headers
|
| 198 |
insinto /usr/include/vmware-vix
|
| 199 |
doins include/*
|
| 200 |
|
| 201 |
if use doc; then
|
| 202 |
dohtml -r doc/*
|
| 203 |
fi
|
| 204 |
fi
|
| 205 |
|
| 206 |
# create symlinks for the various tools
|
| 207 |
local tool ; for tool in vmware vmplayer{,-daemon} \
|
| 208 |
vmware-{acetool,gksu,fuseUI,modconfig{,-console},netcfg,tray,unity-helper} ; do
|
| 209 |
dosym appLoader "${VM_INSTALL_DIR}"/lib/vmware/bin/"${tool}"
|
| 210 |
done
|
| 211 |
dosym "${VM_INSTALL_DIR}"/lib/vmware/bin/vmplayer "${VM_INSTALL_DIR}"/bin/vmplayer
|
| 212 |
dosym "${VM_INSTALL_DIR}"/lib/vmware/bin/vmware "${VM_INSTALL_DIR}"/bin/vmware
|
| 213 |
|
| 214 |
# fix up permissions
|
| 215 |
chmod 0755 "${D}${VM_INSTALL_DIR}"/lib/vmware/{bin/*,lib/wrapper-gtk24.sh,setup/*}
|
| 216 |
chmod 04711 "${D}${VM_INSTALL_DIR}"/sbin/vmware-authd
|
| 217 |
chmod 04711 "${D}${VM_INSTALL_DIR}"/lib/vmware/bin/vmware-vmx*
|
| 218 |
if use vix; then
|
| 219 |
chmod 0755 "${D}${VM_INSTALL_DIR}"/lib/vmware-vix/setup/*
|
| 220 |
fi
|
| 221 |
|
| 222 |
# create the environment
|
| 223 |
local envd="${T}/90vmware"
|
| 224 |
cat > "${envd}" <<-EOF
|
| 225 |
PATH='${VM_INSTALL_DIR}/bin'
|
| 226 |
ROOTPATH='${VM_INSTALL_DIR}/bin'
|
| 227 |
EOF
|
| 228 |
doenvd "${envd}"
|
| 229 |
|
| 230 |
# create the configuration
|
| 231 |
dodir /etc/vmware
|
| 232 |
|
| 233 |
cat > "${D}"/etc/vmware/bootstrap <<-EOF
|
| 234 |
BINDIR='${VM_INSTALL_DIR}/bin'
|
| 235 |
LIBDIR='${VM_INSTALL_DIR}/lib'
|
| 236 |
EOF
|
| 237 |
|
| 238 |
cat > "${D}"/etc/vmware/config <<-EOF
|
| 239 |
bindir = "${VM_INSTALL_DIR}/bin"
|
| 240 |
libdir = "${VM_INSTALL_DIR}/lib/vmware"
|
| 241 |
initscriptdir = "/etc/init.d"
|
| 242 |
authd.fullpath = "${VM_INSTALL_DIR}/sbin/vmware-authd"
|
| 243 |
gksu.rootMethod = "su"
|
| 244 |
VMCI_CONFED = "yes"
|
| 245 |
VMBLOCK_CONFED = "yes"
|
| 246 |
VSOCK_CONFED = "yes"
|
| 247 |
NETWORKING = "yes"
|
| 248 |
player.product.version = "${major_minor_revision}"
|
| 249 |
product.buildNumber = "${build}"
|
| 250 |
product.name = "VMware Workstation"
|
| 251 |
workstation.product.version = "${major_minor_revision}"
|
| 252 |
EOF
|
| 253 |
|
| 254 |
if use vix; then
|
| 255 |
cat >> "${D}"/etc/vmware/config <<-EOF
|
| 256 |
vmware.fullpath = "${VM_INSTALL_DIR}/bin/vmware"
|
| 257 |
vix.libdir = "${VM_INSTALL_DIR}/lib/vmware-vix"
|
| 258 |
vix.config.version = "1"
|
| 259 |
EOF
|
| 260 |
fi
|
| 261 |
|
| 262 |
# install the init.d script
|
| 263 |
local initscript="${T}/vmware.rc"
|
| 264 |
sed -e "s:@@BINDIR@@:${VM_INSTALL_DIR}/bin:g" \
|
| 265 |
"${FILESDIR}/vmware-7.0.rc" > ${initscript}
|
| 266 |
newinitd "${initscript}" vmware
|
| 267 |
|
| 268 |
# fill in variable placeholders
|
| 269 |
sed -e "s:@@LIBCONF_DIR@@:${VM_INSTALL_DIR}/lib/vmware/libconf:g" \
|
| 270 |
-i "${D}${VM_INSTALL_DIR}"/lib/vmware/libconf/etc/{gtk-2.0/{gdk-pixbuf.loaders,gtk.immodules},pango/pango{.modules,rc}}
|
| 271 |
sed -e "s:@@BINARY@@:${VM_INSTALL_DIR}/bin/vmware:g" \
|
| 272 |
-i "${D}/usr/share/applications/${PN}.desktop"
|
| 273 |
sed -e "s:@@BINARY@@:${VM_INSTALL_DIR}/bin/vmplayer:g" \
|
| 274 |
-i "${D}/usr/share/applications/vmware-player.desktop"
|
| 275 |
sed -e "s:@@BINARY@@:${VM_INSTALL_DIR}/bin/vmware-netcfg:g" \
|
| 276 |
-i "${D}/usr/share/applications/vmware-netcfg.desktop"
|
| 277 |
}
|
| 278 |
|
| 279 |
pkg_config() {
|
| 280 |
"${VM_INSTALL_DIR}"/bin/vmware-networks --postinstall ${PN},old,new
|
| 281 |
}
|
| 282 |
|
| 283 |
pkg_preinst() {
|
| 284 |
gnome2_icon_savelist
|
| 285 |
}
|
| 286 |
|
| 287 |
pkg_postinst() {
|
| 288 |
fdo-mime_desktop_database_update
|
| 289 |
gnome2_icon_cache_update
|
| 290 |
|
| 291 |
ewarn "/etc/env.d was updated. Please run:"
|
| 292 |
ewarn "env-update && source /etc/profile"
|
| 293 |
ewarn ""
|
| 294 |
ewarn "Before you can use vmware-player, you must configure a default network setup."
|
| 295 |
ewarn "You can do this by running 'emerge --config ${PN}'."
|
| 296 |
}
|
| 297 |
|
| 298 |
pkg_prerm() {
|
| 299 |
einfo "Stopping ${PN} for safe unmerge"
|
| 300 |
/etc/init.d/vmware stop
|
| 301 |
}
|
| 302 |
|
| 303 |
pkg_postrm() {
|
| 304 |
fdo-mime_desktop_database_update
|
| 305 |
gnome2_icon_cache_update
|
| 306 |
}
|