talimat 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. # Tanım: Vmware sanal makine uygulaması
  2. # URL: https://www.vmware.com/products/workstation-for-linux.html
  3. # Paketçi: milisarge
  4. # Gerekler: sqlite3 xorg-app
  5. # Grup: sistem
  6. isim=vmware
  7. surum=14.1.1
  8. devir=1
  9. _derlemeno=7528167
  10. _surum=${surum}_${_derlemeno}
  11. kaynak=(https://download3.vmware.com/software/wkst/file/VMware-Workstation-Full-${_surum/_/-}.x86_64.bundle
  12. vmware-vix-bootstrap
  13. config
  14. bootstrap
  15. pam.d-vmware-authd
  16. vmware-environment.sh
  17. config.xml
  18. datastores.xml
  19. environments.xml
  20. proxy.xml
  21. Makefile
  22. vmmon.patch
  23. vmnet.patch)
  24. derle() {
  25. extracted_dir="$SRC/extracted"
  26. [[ -d "$extracted_dir" ]] && rm -r "$extracted_dir"
  27. bash $(readlink -f "$SRC/VMware-Workstation-Full-${_surum/_/-}.x86_64.bundle") --extract "$extracted_dir"
  28. local vmware_installer_version=$(cat "$SRC/extracted/vmware-installer/manifest.xml" | grep -oPm1 "(?<=<version>)[^<]+")
  29. mkdir -p \
  30. "$PKG/etc"/{cups,pam.d,modprobe.d,profile.d,thnuclnt,vmware} \
  31. "$PKG/usr"/{share,bin} \
  32. "$PKG/usr/include/vmware-vix" \
  33. "$PKG/usr/lib"/{vmware/{setup,lib/libvmware-vim-cmd.so},vmware-vix,vmware-ovftool,vmware-installer/"$vmware_installer_version",cups/filter,modules-load.d} \
  34. "$PKG/usr/share"/{doc/vmware-vix,licenses/"$isim"} \
  35. "$PKG/var/lib/vmware/Shared VMs"
  36. cd "$SRC/extracted"
  37. cp -r \
  38. vmware-workstation/share/* \
  39. vmware-workstation/man \
  40. vmware-network-editor-ui/share/* \
  41. vmware-player-app/share/* \
  42. "$PKG/usr/share"
  43. cp -r \
  44. vmware-workstation/bin/* \
  45. vmware-vmx/{,s}bin/* \
  46. vmware-vix-core/bin/* \
  47. vmware-vprobe/bin/* \
  48. vmware-workstation-server/{vmware-hostd,vmware-vim-cmd,vmware-wssc-adminTool} \
  49. vmware-network-editor-ui/bin/* \
  50. vmware-player-app/bin/* \
  51. "$PKG/usr/bin"
  52. cp -r \
  53. vmware-workstation/lib/* \
  54. vmware-player-app/lib/* \
  55. vmware-vmx/{lib/*,roms} \
  56. vmware-vprobe/lib/* \
  57. vmware-workstation-server/{bin,lib,hostd} \
  58. vmware-usbarbitrator/bin \
  59. vmware-network-editor/lib \
  60. "$PKG/usr/lib/vmware"
  61. cp -r \
  62. vmware-player-setup/vmware-config \
  63. "$PKG/usr/lib/vmware/setup"
  64. cp -rL \
  65. vmware-workstation-server/config/etc/vmware/* \
  66. vmware-workstation-server/etc/vmware/* \
  67. "$SRC"/{bootstrap,config} \
  68. "$PKG/etc/vmware"
  69. cp -r \
  70. vmware-vix-lib-Workstation1400/lib/Workstation-14.0.0 \
  71. vmware-vix-core/{lib/*,vixwrapper-config.txt} \
  72. "$PKG/usr/lib/vmware-vix"
  73. cp vmware-vix-core/vix-perl.tar.nogz "$PKG/usr/lib/vmware-vix/vix-perl.tar.gz"
  74. cp -r \
  75. vmware-vix-core/doc/* \
  76. "$PKG/usr/share/doc/vmware-vix"
  77. cp -r \
  78. vmware-ovftool/* \
  79. "$PKG/usr/lib/vmware-ovftool"
  80. cp -r \
  81. vmware-installer/{python,sopython,vmis,vmis-launcher,vmware-installer,vmware-installer.py} \
  82. "$PKG/usr/lib/vmware-installer/$vmware_installer_version"
  83. cp -r \
  84. vmware-player-app/etc/cups/* \
  85. "$PKG/etc/cups"
  86. cp -r \
  87. vmware-player-app/extras/.thnumod \
  88. "$PKG/etc/thnuclnt"
  89. cp -r \
  90. vmware-player-app/extras/thnucups \
  91. "$PKG/usr/lib/cups/filter"
  92. cp -r \
  93. vmware-vix-core/include/* \
  94. "$PKG/usr/include/vmware-vix"
  95. install -Dm 644 "vmware-workstation/doc/EULA" "$PKG/usr/share/licenses/$isim/VMware Workstation - EULA.txt"
  96. install -Dm 644 "vmware-workstation/doc"/*open_source_licenses.txt "$PKG/usr/share/licenses/$isim"
  97. mv "$PKG/usr/lib/vmware-ovftool/vmware.eula" "$PKG/usr/share/licenses/$isim/VMware OVF Tool component for Linux - EULA.txt"
  98. rm "$PKG/usr/lib/vmware-ovftool"/{vmware-eula.rtf,open_source_licenses.txt,manifest.xml}
  99. install -Dm 644 "vmware-vmx/etc/modprobe.d/modprobe-vmware-fuse.conf" "$PKG/etc/modprobe.d/vmware-fuse.conf"
  100. install -Dm 644 vmware-player-app/lib/isoimages/tools-key.pub "$PKG/usr/lib/vmware/isoimages/tools-key.pub"
  101. install -Dm 644 vmware-vmx/extra/modules.xml "$PKG/usr/lib/vmware/modules/modules.xml"
  102. install -Dm 644 vmware-installer/bootstrap "$PKG/etc/vmware-installer/bootstrap"
  103. install -Dm 644 "$SRC/vmware-vix-bootstrap" "$PKG/etc/vmware-vix/bootstrap"
  104. for hostd_file in config datastores environments proxy; do
  105. install -Dm 644 "$SRC/$hostd_file.xml" "$PKG/etc/vmware/hostd/$hostd_file.xml"
  106. done
  107. install -Dm 644 "$SRC/pam.d-vmware-authd" "$PKG/etc/pam.d/vmware-authd"
  108. echo -e "vmw_vmci\nvmmon" > "$PKG/usr/lib/modules-load.d/vmware.conf"
  109. chmod +x \
  110. "$PKG/usr/bin"/* \
  111. "$PKG/usr/lib/vmware/bin"/* \
  112. "$PKG/usr/lib/vmware/setup"/* \
  113. "$PKG/usr/lib/vmware/lib"/libvmware-gksu.so/gksu-run-helper \
  114. "$PKG/usr/lib/vmware-ovftool"/{ovftool,ovftool.bin} \
  115. "$PKG/usr/lib/vmware-installer/$vmware_installer_version"/{vmware-installer,vmis-launcher} \
  116. "$PKG/usr/lib/cups/filter"/* \
  117. "$PKG/usr/lib/vmware-vix/setup"/* \
  118. "$PKG/etc/thnuclnt/.thnumod"
  119. chmod -R 600 "$PKG/etc/vmware/ssl"
  120. chmod +s \
  121. "$PKG/usr/bin"/vmware-authd \
  122. "$PKG/usr/lib/vmware/bin"/{vmware-vmx,vmware-vmx-debug,vmware-vmx-stats}
  123. # Add symlinks the installer would create.
  124. for link in \
  125. licenseTool \
  126. vmplayer \
  127. vmware \
  128. vmware-app-control \
  129. vmware-enter-serial \
  130. vmware-fuseUI \
  131. vmware-gksu \
  132. vmware-hostd \
  133. vmware-modconfig \
  134. vmware-modconfig-console \
  135. vmware-mount \
  136. vmware-netcfg \
  137. vmware-tray \
  138. vmware-vim-cmd \
  139. vmware-vmblock-fuse \
  140. vmware-vprobe \
  141. vmware-wssc-adminTool \
  142. vmware-zenity
  143. do
  144. ln -s /usr/lib/vmware/bin/appLoader "$PKG/usr/lib/vmware/bin/$link"
  145. done
  146. for link in \
  147. vmware-mount \
  148. vmware-usbarbitrator
  149. do
  150. ln -s /usr/lib/vmware/bin/$link "$PKG/usr/bin/$link"
  151. done
  152. ln -s /usr/lib/vmware/icu "$PKG/etc/vmware/icu"
  153. ln -s /usr/lib/vmware/lib/diskLibWrapper.so/diskLibWrapper.so "$PKG/usr/lib/diskLibWrapper.so"
  154. ln -s /usr/lib/vmware/lib/libvmware-hostd.so/libvmware-hostd.so "$PKG/usr/lib/vmware/lib/libvmware-vim-cmd.so/libvmware-vim-cmd.so"
  155. ln -s /usr/lib/vmware-ovftool/ovftool "$PKG/usr/bin/ovftool"
  156. ln -s /usr/lib/vmware-vix/libvixAllProducts.so "$PKG/usr/lib/libvixAllProducts.so"
  157. # Replace placeholder "variables" with real paths.
  158. for file in \
  159. gtk-3.0/gdk-pixbuf.loaders
  160. do
  161. sed -i 's,@@LIBCONF_DIR@@,/usr/lib/vmware/libconf,g' "$PKG/usr/lib/vmware/libconf/etc/$file"
  162. done
  163. sed -i 's,@@BINARY@@,/usr/bin/vmware,' "$PKG/usr/share/applications/vmware-workstation.desktop"
  164. sed -i 's,@@BINARY@@,/usr/bin/vmplayer,' "$PKG/usr/share/applications/vmware-player.desktop"
  165. sed -i 's,@@BINARY@@,/usr/bin/vmware-netcfg,' "$PKG/usr/share/applications/vmware-netcfg.desktop"
  166. sed -i 's,@@AUTHD_PORT@@,902,' "$PKG/usr/lib/vmware/hostd/docroot/client/clients.xml"
  167. sed \
  168. -e "s/@@VERSION@@/$vmware_installer_version/" \
  169. -e "s,@@VMWARE_INSTALLER@@,/usr/lib/vmware-installer/$vmware_installer_version," \
  170. -i "$PKG/etc/vmware-installer/bootstrap"
  171. # Patch up the VMware kernel sources
  172. dkms_dir="$PKG/usr/src/$isim-$_surum"
  173. install -Dm 644 "$SRC/Makefile" "$dkms_dir/Makefile"
  174. for module in vmmon vmnet; do # vmblock vmci vsock
  175. tar -xf "vmware-vmx/lib/modules/source/$module.tar" -C "$dkms_dir"
  176. patch -p2 --read-only=ignore --directory="$dkms_dir/$module-only" < "$SRC/$module.patch"
  177. done
  178. rm -r "$PKG/usr/lib/vmware/modules/source"
  179. local database_filename="$PKG/etc/vmware-installer/database"
  180. echo -n "" > "$database_filename"
  181. sqlite3 "$database_filename" "CREATE TABLE settings(key VARCHAR PRIMARY KEY, value VARCHAR NOT NULL, component_name VARCHAR NOT NULL);"
  182. sqlite3 "$database_filename" "INSERT INTO settings(key,value,component_name) VALUES('db.schemaVersion','2','vmware-installer');"
  183. sqlite3 "$database_filename" "CREATE TABLE components(id INTEGER PRIMARY KEY, name VARCHAR NOT NULL, version VARCHAR NOT NULL, buildNumber INTEGER NOT NULL, component_core_id INTEGER NOT NULL, longName VARCHAR NOT NULL, description VARCHAR, type INTEGER NOT NULL);"
  184. # Define some environment variables for VMware and remove the tests about kernel modules
  185. install -Dm 644 "$SRC/vmware-environment.sh" "$PKG/etc/conf.d/vmware"
  186. for program in vmware vmplayer vmware-netcfg vmware-tray; do
  187. sed -e '/export PRODUCT_NAME/asource /etc/conf.d/vmware' \
  188. -e 's/if "$BINDIR"\/vmware-modconfig --appname=.*/if true ||/' \
  189. -i "$PKG/usr/bin/$program"
  190. done
  191. }