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