vmware-workstation-9.0.3.1410761.ebuild 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  4. inherit eutils versionator fdo-mime systemd gnome2-utils pam vmware-bundle
  5. MY_PN="VMware-Workstation"
  6. MY_PV=$(get_version_component_range 1-3)
  7. PV_MINOR=$(get_version_component_range 3)
  8. PV_BUILD=$(get_version_component_range 4)
  9. MY_P="${MY_PN}-${MY_PV}-${PV_BUILD}"
  10. SYSTEMD_UNITS_TAG="gentoo-01"
  11. DESCRIPTION="Emulate a complete PC without the performance overhead of most emulators"
  12. HOMEPAGE="http://www.vmware.com/products/workstation/"
  13. BASE_URI="https://softwareupdate.vmware.com/cds/vmw-desktop/ws/${MY_PV}/${PV_BUILD}/linux/core/"
  14. SRC_URI="
  15. x86? ( ${BASE_URI}${MY_P}.i386.bundle.tar )
  16. amd64? ( ${BASE_URI}${MY_P}.x86_64.bundle.tar )
  17. https://github.com/akhuettel/systemd-vmware/archive/${SYSTEMD_UNITS_TAG}.tar.gz
  18. "
  19. LICENSE="vmware GPL-2"
  20. SLOT="0"
  21. KEYWORDS="-* ~amd64 ~x86"
  22. IUSE="cups doc ovftool server vix vmware-tools"
  23. RESTRICT="mirror strip"
  24. # vmware-workstation should not use virtual/libc as this is a
  25. # precompiled binary package thats linked to glibc.
  26. RDEPEND="dev-cpp/cairomm
  27. dev-cpp/glibmm:2
  28. dev-cpp/gtkmm:2.4
  29. dev-cpp/libgnomecanvasmm
  30. dev-cpp/pangomm
  31. dev-libs/atk
  32. dev-libs/glib:2
  33. dev-libs/icu
  34. dev-libs/expat
  35. dev-libs/libaio
  36. dev-libs/libsigc++
  37. dev-libs/libxml2
  38. =dev-libs/openssl-0.9.8*
  39. dev-libs/xmlrpc-c
  40. gnome-base/libgnomecanvas
  41. gnome-base/libgtop:2
  42. gnome-base/librsvg:2
  43. gnome-base/orbit
  44. media-libs/fontconfig
  45. media-libs/freetype
  46. media-libs/libart_lgpl
  47. =media-libs/libpng-1.2*
  48. media-libs/libpng
  49. net-misc/curl
  50. cups? ( net-print/cups )
  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/libSM
  60. x11-libs/libX11
  61. x11-libs/libXau
  62. x11-libs/libxcb
  63. x11-libs/libXcomposite
  64. x11-libs/libXcursor
  65. x11-libs/libXdamage
  66. x11-libs/libXdmcp
  67. x11-libs/libXext
  68. x11-libs/libXfixes
  69. x11-libs/libXft
  70. x11-libs/libXi
  71. x11-libs/libXinerama
  72. x11-libs/libXrandr
  73. x11-libs/libXrender
  74. x11-libs/libXtst
  75. x11-libs/pango
  76. x11-libs/startup-notification
  77. x11-themes/hicolor-icon-theme
  78. !app-emulation/vmware-player"
  79. PDEPEND="~app-emulation/vmware-modules-271.${PV_MINOR}
  80. vmware-tools? ( app-emulation/vmware-tools )"
  81. S=${WORKDIR}
  82. VM_INSTALL_DIR="/opt/vmware"
  83. VM_DATA_STORE_DIR="/var/lib/vmware/Shared VMs"
  84. VM_HOSTD_USER="root"
  85. src_unpack() {
  86. default
  87. local bundle
  88. use amd64 && bundle=${MY_P}.x86_64.bundle
  89. use x86 && bundle=${MY_P}.i386.bundle
  90. local component; for component in \
  91. vmware-vmx \
  92. vmware-player-app \
  93. vmware-player-setup \
  94. vmware-workstation \
  95. vmware-network-editor \
  96. vmware-network-editor-ui \
  97. vmware-usbarbitrator \
  98. vmware-vprobe
  99. do
  100. vmware-bundle_extract-bundle-component "${bundle}" "${component}" "${S}"
  101. done
  102. if use server; then
  103. vmware-bundle_extract-bundle-component "${bundle}" vmware-workstation-server #"${S}"
  104. fi
  105. if use vix; then
  106. vmware-bundle_extract-bundle-component "${bundle}" vmware-vix-core vmware-vix
  107. vmware-bundle_extract-bundle-component "${bundle}" vmware-vix-lib-Workstation900andvSphere510 vmware-vix
  108. fi
  109. if use ovftool; then
  110. vmware-bundle_extract-bundle-component "${bundle}" vmware-ovftool
  111. fi
  112. }
  113. src_prepare() {
  114. rm -f bin/vmware-modconfig
  115. rm -rf lib/modules/binary
  116. # Bug 459566
  117. mv lib/libvmware-netcfg.so lib/lib/
  118. if use server; then
  119. rm -f vmware-workstation-server/bin/{openssl,configure-hostd.sh}
  120. fi
  121. find "${S}" -name '*.a' -delete
  122. # clean_bundled_libs
  123. }
  124. clean_bundled_libs() {
  125. ebegin 'Removing superfluous libraries'
  126. cd lib/lib || die
  127. ldconfig -p | \
  128. sed 's:^\s\+\([^(]*[^( ]\).*=> /.*$:\1:g;t;d' | \
  129. fgrep -vx 'libcrypto.so.0.9.8
  130. libssl.so.0.9.8i
  131. libgcr.so.0
  132. libglib-2.0.so.0' |
  133. xargs -d'\n' -r rm -rf
  134. eend
  135. }
  136. src_install() {
  137. local major_minor=$(get_version_component_range 1-2 "${PV}")
  138. local major_minor_revision=$(get_version_component_range 1-3 "${PV}")
  139. local build=$(get_version_component_range 4 "${PV}")
  140. # install the binaries
  141. into "${VM_INSTALL_DIR}"
  142. dobin bin/*
  143. # install the libraries
  144. insinto "${VM_INSTALL_DIR}"/lib/vmware
  145. doins -r lib/*
  146. # Bug 432918
  147. dosym "${VM_INSTALL_DIR}"/lib/vmware/lib/libcrypto.so.0.9.8/libcrypto.so.0.9.8 \
  148. "${VM_INSTALL_DIR}"/lib/vmware/lib/libvmwarebase.so.0/libcrypto.so.0.9.8
  149. dosym "${VM_INSTALL_DIR}"/lib/vmware/lib/libssl.so.0.9.8/libssl.so.0.9.8 \
  150. "${VM_INSTALL_DIR}"/lib/vmware/lib/libvmwarebase.so.0/libssl.so.0.9.8
  151. # install the ancillaries
  152. insinto /usr
  153. doins -r share
  154. if use cups; then
  155. exeinto $(cups-config --serverbin)/filter
  156. doexe extras/thnucups
  157. insinto /etc/cups
  158. doins -r etc/cups/*
  159. fi
  160. insinto /etc/xdg
  161. doins -r etc/xdg/*
  162. # install documentation
  163. doman man/man1/vmware.1.gz
  164. if use doc; then
  165. dodoc doc/*
  166. fi
  167. insinto "${VM_INSTALL_DIR}"/lib/vmware/setup
  168. doins vmware-config
  169. # install vmware workstation server
  170. if use server; then
  171. dosbin sbin/*
  172. cd "${S}"/vmware-workstation-server
  173. # install binaries
  174. into "${VM_INSTALL_DIR}"/lib/vmware
  175. dobin bin/*
  176. dobin "${FILESDIR}"/configure-hostd.sh
  177. dobin "${FILESDIR}"/configure-hostd.sh
  178. # install the libraries
  179. insinto "${VM_INSTALL_DIR}"/lib/vmware/lib
  180. doins -r lib/*
  181. into "${VM_INSTALL_DIR}"
  182. for tool in vmware-{hostd,wssc-adminTool} ; do
  183. cat > "${T}/${tool}" <<-EOF
  184. #!/usr/bin/env bash
  185. set -e
  186. . /etc/vmware/bootstrap
  187. exec "${VM_INSTALL_DIR}/lib/vmware/lib/wrapper-gtk24.sh" \\
  188. "${VM_INSTALL_DIR}/lib/vmware/lib" \\
  189. "${VM_INSTALL_DIR}/lib/vmware/bin/${tool}" \\
  190. "${VM_INSTALL_DIR}/lib/vmware/libconf" "\$@"
  191. EOF
  192. dobin "${T}/${tool}"
  193. done
  194. insinto "${VM_INSTALL_DIR}"/lib/vmware
  195. doins -r hostd
  196. # create the configuration
  197. insinto /etc/vmware/hostd
  198. doins -r config/etc/vmware/hostd/*
  199. doins -r etc/vmware/hostd/*
  200. insinto /etc/vmware/ssl
  201. doins etc/vmware/ssl/*
  202. # pam
  203. pamd_mimic_system vmware-authd auth account
  204. # create directory for shared virtual machines.
  205. keepdir "${VM_DATA_STORE_DIR}"
  206. keepdir /var/log/vmware
  207. fi
  208. # install vmware-vix
  209. if use vix; then
  210. cd "${S}"/vmware-vix
  211. # install the binary
  212. into "${VM_INSTALL_DIR}"
  213. dobin bin/*
  214. # install the libraries
  215. insinto "${VM_INSTALL_DIR}"/lib/vmware-vix
  216. doins -r lib/*
  217. dosym vmware-vix/libvixAllProducts.so "${VM_INSTALL_DIR}"/lib/libbvixAllProducts.so
  218. # install headers
  219. insinto /usr/include/vmware-vix
  220. doins include/*
  221. if use doc; then
  222. dohtml -r doc/*
  223. fi
  224. fi
  225. # install ovftool
  226. if use ovftool; then
  227. cd "${S}"
  228. insinto "${VM_INSTALL_DIR}"/lib/vmware-ovftool
  229. doins -r vmware-ovftool/*
  230. chmod 0755 "${D}${VM_INSTALL_DIR}"/lib/vmware-ovftool/{ovftool,ovftool.bin}
  231. dosym "${D}${VM_INSTALL_DIR}"/lib/vmware-ovftool/ovftool "${VM_INSTALL_DIR}"/bin/ovftool
  232. fi
  233. # create symlinks for the various tools
  234. local tool ; for tool in thnuclnt vmware vmplayer{,-daemon} \
  235. vmware-{acetool,enter-serial,gksu,fuseUI,modconfig{,-console},netcfg,tray,unity-helper} ; do
  236. dosym appLoader "${VM_INSTALL_DIR}"/lib/vmware/bin/"${tool}"
  237. done
  238. dosym "${VM_INSTALL_DIR}"/lib/vmware/bin/vmplayer "${VM_INSTALL_DIR}"/bin/vmplayer
  239. dosym "${VM_INSTALL_DIR}"/lib/vmware/bin/vmware "${VM_INSTALL_DIR}"/bin/vmware
  240. dosym "${VM_INSTALL_DIR}"/lib/vmware/icu /etc/vmware/icu
  241. # fix permissions
  242. fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/bin/{appLoader,fusermount,launcher.sh,mkisofs,vmware-remotemks}
  243. fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/lib/{wrapper-gtk24.sh,libgksu2.so.0/gksu-run-helper}
  244. fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/setup/vmware-config
  245. fperms 4711 "${VM_INSTALL_DIR}"/bin/vmware-mount
  246. fperms 4711 "${VM_INSTALL_DIR}"/lib/vmware/bin/vmware-vmx{,-debug,-stats}
  247. if use server; then
  248. fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/bin/vmware-{hostd,wssc-adminTool}
  249. fperms 4711 "${VM_INSTALL_DIR}"/sbin/vmware-authd
  250. fperms 1777 "${VM_DATA_STORE_DIR}"
  251. fi
  252. if use vix; then
  253. fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware-vix/setup/vmware-config
  254. fi
  255. # create the environment
  256. local envd="${T}/90vmware"
  257. cat > "${envd}" <<-EOF
  258. PATH='${VM_INSTALL_DIR}/bin'
  259. ROOTPATH='${VM_INSTALL_DIR}/bin'
  260. EOF
  261. doenvd "${envd}"
  262. # create the configuration
  263. dodir /etc/vmware
  264. cat > "${D}"/etc/vmware/bootstrap <<-EOF
  265. BINDIR='${VM_INSTALL_DIR}/bin'
  266. LIBDIR='${VM_INSTALL_DIR}/lib'
  267. EOF
  268. cat > "${D}"/etc/vmware/config <<-EOF
  269. bindir = "${VM_INSTALL_DIR}/bin"
  270. libdir = "${VM_INSTALL_DIR}/lib/vmware"
  271. initscriptdir = "/etc/init.d"
  272. authd.fullpath = "${VM_INSTALL_DIR}/sbin/vmware-authd"
  273. gksu.rootMethod = "su"
  274. VMCI_CONFED = "yes"
  275. VMBLOCK_CONFED = "yes"
  276. VSOCK_CONFED = "yes"
  277. NETWORKING = "yes"
  278. player.product.version = "${major_minor_revision}"
  279. product.version = "${major_minor_revision}"
  280. product.buildNumber = "${build}"
  281. product.name = "VMware Workstation"
  282. workstation.product.version = "${major_minor_revision}"
  283. EOF
  284. if use vix; then
  285. cat >> "${D}"/etc/vmware/config <<-EOF
  286. vmware.fullpath = "${VM_INSTALL_DIR}/bin/vmware"
  287. vix.libdir = "${VM_INSTALL_DIR}/lib/vmware-vix"
  288. vix.config.version = "1"
  289. EOF
  290. fi
  291. if use server; then
  292. cat >> "${D}"/etc/vmware/config <<-EOF
  293. authd.client.port = "902"
  294. authd.proxy.nfc = "vmware-hostd:ha-nfc"
  295. authd.soapserver = "TRUE"
  296. EOF
  297. fi
  298. # install the init.d script
  299. local initscript="${T}/vmware.rc"
  300. sed -e "s:@@BINDIR@@:${VM_INSTALL_DIR}/bin:g" \
  301. "${FILESDIR}/vmware-${major_minor}.rc" > ${initscript}
  302. newinitd "${initscript}" vmware
  303. if use server; then
  304. # install the init.d script
  305. local initscript="${T}/vmware-workstation-server.rc"
  306. sed -e "s:@@ETCDIR@@:/etc/vmware:g" \
  307. -e "s:@@PREFIX@@:${VM_INSTALL_DIR}:g" \
  308. -e "s:@@BINDIR@@:${VM_INSTALL_DIR}/bin:g" \
  309. -e "s:@@LIBDIR@@:${VM_INSTALL_DIR}/lib/vmware:g" \
  310. "${FILESDIR}/vmware-server-${major_minor}.rc" > ${initscript}
  311. newinitd "${initscript}" vmware-workstation-server
  312. fi
  313. # fill in variable placeholders
  314. sed -e "s:@@LIBCONF_DIR@@:${VM_INSTALL_DIR}/lib/vmware/libconf:g" \
  315. -i "${D}${VM_INSTALL_DIR}"/lib/vmware/libconf/etc/{gtk-2.0/{gdk-pixbuf.loaders,gtk.immodules},pango/pango{.modules,rc}}
  316. sed -e "s:@@BINARY@@:${VM_INSTALL_DIR}/bin/vmware:g" \
  317. -e "/^Encoding/d" \
  318. -i "${D}/usr/share/applications/${PN}.desktop"
  319. sed -e "s:@@BINARY@@:${VM_INSTALL_DIR}/bin/vmplayer:g" \
  320. -e "/^Encoding/d" \
  321. -i "${D}/usr/share/applications/vmware-player.desktop"
  322. sed -e "s:@@BINARY@@:${VM_INSTALL_DIR}/bin/vmware-netcfg:g" \
  323. -e "/^Encoding/d" \
  324. -i "${D}/usr/share/applications/vmware-netcfg.desktop"
  325. if use server; then
  326. # Configuration for vmware-workstation-server
  327. local hostdUser="${VM_HOSTD_USER:-root}"
  328. sed -e "/ACEDataUser/s:root:${hostdUser}:g" \
  329. -i "${D}/etc/vmware/hostd/authorization.xml" || die
  330. # Shared VMs Path: [standard].
  331. sed -e "s:##{DS_NAME}##:standard:g" \
  332. -e "s:##{DS_PATH}##:${VM_DATA_STORE_DIR}:g" \
  333. -i "${D}/etc/vmware/hostd/datastores.xml" || die
  334. sed -e "s:##{HTTP_PORT}##:-1:g" \
  335. -e "s:##{HTTPS_PORT}##:443:g" \
  336. -e "s:##{PIPE_PREFIX}##:/var/run/vmware/:g" \
  337. -i "${D}/etc/vmware/hostd/proxy.xml" || die
  338. # See vmware-workstation-server.py for more details.
  339. sed -e "s:##{BUILD_CFGDIR}##:/etc/vmware/hostd/:g" \
  340. -e "s:##{CFGALTDIR}##:/etc/vmware/hostd/:g" \
  341. -e "s:##{CFGDIR}##:/etc/vmware/:g" \
  342. -e "s:##{ENABLE_AUTH}##:true:g" \
  343. -e "s:##{HOSTDMODE}##:ws:g" \
  344. -e "s:##{HOSTD_CFGDIR}##:/etc/vmware/hostd/:g" \
  345. -e "s:##{HOSTD_MOCKUP}##:false:g" \
  346. -e "s:##{LIBDIR}##:${VM_INSTALL_DIR}/lib/vmware:g" \
  347. -e "s:##{LIBDIR_INSTALLED}##:${VM_INSTALL_DIR}/lib/vmware/:g" \
  348. -e "s:##{LOGDIR}##:/var/log/vmware/:g" \
  349. -e "s:##{LOGLEVEL}##:verbose:g" \
  350. -e "s:##{MOCKUP}##:mockup-host-config.xml:g" \
  351. -e "s:##{PLUGINDIR}##:./:g" \
  352. -e "s:##{SHLIB_PREFIX}##:lib:g" \
  353. -e "s:##{SHLIB_SUFFIX}##:.so:g" \
  354. -e "s:##{USE_BLKLISTSVC}##:false:g" \
  355. -e "s:##{USE_CBRCSVC}##:false:g" \
  356. -e "s:##{USE_CIMSVC}##:false:g" \
  357. -e "s:##{USE_DIRECTORYSVC}##:false:g" \
  358. -e "s:##{USE_DIRECTORYSVC_MOCKUP}##:false:g" \
  359. -e "s:##{USE_DYNAMIC_PLUGIN_LOADING}##:false:g" \
  360. -e "s:##{USE_DYNAMO}##:false:g" \
  361. -e "s:##{USE_DYNSVC}##:false:g" \
  362. -e "s:##{USE_GUESTSVC}##:false:g" \
  363. -e "s:##{USE_HBRSVC}##:false:g" \
  364. -e "s:##{USE_HBRSVC_MOCKUP}##:false:g" \
  365. -e "s:##{USE_HOSTSVC_MOCKUP}##:false:g" \
  366. -e "s:##{USE_HTTPNFCSVC}##:false:g" \
  367. -e "s:##{USE_HTTPNFCSVC_MOCKUP}##:false:g" \
  368. -e "s:##{USE_LICENSESVC_MOCKUP}##:false:g" \
  369. -e "s:##{USE_NFCSVC}##:true:g" \
  370. -e "s:##{USE_NFCSVC_MOCKUP}##:false:g" \
  371. -e "s:##{USE_OVFMGRSVC}##:true:g" \
  372. -e "s:##{USE_PARTITIONSVC}##:false:g" \
  373. -e "s:##{USE_SECURESOAP}##:false:g" \
  374. -e "s:##{USE_SNMPSVC}##:false:g" \
  375. -e "s:##{USE_SOLO_MOCKUP}##:false:g" \
  376. -e "s:##{USE_STATSSVC_MOCKUP}##:false:g" \
  377. -e "s:##{USE_VCSVC_MOCKUP}##:false:g" \
  378. -e "s:##{USE_VDISKSVC}##:false:g" \
  379. -e "s:##{USE_VDISKSVC_MOCKUP}##:false:g" \
  380. -e "s:##{USE_VMSVC_MOCKUP}##:false:g" \
  381. -e "s:##{VM_INVENTORY}##:vmInventory.xml:g" \
  382. -e "s:##{VM_RESOURCES}##:vmResources.xml:g" \
  383. -e "s:##{WEBSERVER_PORT_ENTRY}##::g" \
  384. -e "s:##{WORKINGDIR}##:./:g" \
  385. -i "${D}/etc/vmware/hostd/config.xml" || die
  386. sed -e "s:##{ENV_LOCATION}##:/etc/vmware/hostd/env/:g" \
  387. -i "${D}/etc/vmware/hostd/environments.xml" || die
  388. # @@VICLIENT_URL@@=XXX
  389. sed -e "s:@@AUTHD_PORT@@:902:g" \
  390. -i "${D}${VM_INSTALL_DIR}/lib/vmware/hostd/docroot/client/clients.xml" || die
  391. fi
  392. # install systemd unit files
  393. systemd_dounit "${WORKDIR}/systemd-vmware-${SYSTEMD_UNITS_TAG}"/*.{service,target}
  394. }
  395. pkg_config() {
  396. "${VM_INSTALL_DIR}"/bin/vmware-networks --postinstall ${PN},old,new
  397. }
  398. pkg_preinst() {
  399. gnome2_icon_savelist
  400. }
  401. pkg_postinst() {
  402. fdo-mime_desktop_database_update
  403. gnome2_icon_cache_update
  404. ewarn "/etc/env.d was updated. Please run:"
  405. ewarn "env-update && source /etc/profile"
  406. ewarn ""
  407. ewarn "Before you can use vmware workstation, you must configure a default network setup."
  408. ewarn "You can do this by running 'emerge --config ${PN}'."
  409. }
  410. pkg_prerm() {
  411. einfo "Stopping ${PN} for safe unmerge"
  412. /etc/init.d/vmware stop
  413. }
  414. pkg_postrm() {
  415. fdo-mime_desktop_database_update
  416. gnome2_icon_cache_update
  417. }