-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPKGBUILD
329 lines (269 loc) · 12.6 KB
/
PKGBUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
# Maintainer: Vladimir Demenev <[email protected]>
# NOTE: https://wiki.archlinux.org/index.php/VMware
# https://aur.archlinux.org/packages/vmware-workstation/
#
# For compile package run:
# $ updpkgsums && makepkg -fs
#
# Upgrade or add package into system:
# $ sudo pacman -U package_name.pkg.tar.xz
#
# Remove package from system:
# sudo pacman -Rn package_name
#
#-------------------------------------------------------------------
pkgname=vmware-player
pkgdesc='The industry standard for running multiple operating systems as virtual machines on a single Linux PC.'
pkgver=16.2.4
_pkgver=$(echo "${pkgver}" | sed 's/\.//g')
pkgbuild=20089737
pkgrel=1
arch=('x86_64')
url='https://www.vmware.com/products/workstation-for-linux.html'
license=('custom: commercial')
install="vmware-player.install" # Pre-Post installation scripts for pacman: https://wiki.archlinux.org/index.php/PKGBUILD#install
#-------------------------------------------------------------------
conflicts=(
vmware-player
vmware-player-bin
vmware-workstation-bin
vmware-workstation
vmware-modules-dkms
vmware-ovftool
vmware-patch
vmware-systemd-services
)
provides=(
vmware-ovftool
)
depends=(
# dkms
# ncurses5-compat-libs # needed by the --console installer https://aur.archlinux.org/packages/ncurses5-compat-libs/
fuse2 # for vmware-vmblock-fuse
gtkmm3 # for the GUI
libcanberra # for event sounds
libaio
pcsclite
hicolor-icon-theme
gtk3 # It need for using Arch GTK3 library (for theme integration)
gcr
git # for download kernel patches. Uses in post scripts of package
)
optdepends=(
'linux-headers: build modules against Arch kernel'
)
makedepends=(
sqlite
)
backup=(
'etc/vmware/config'
'etc/conf.d/vmware'
'etc/vmware/hostd/authorization.xml'
'etc/vmware/hostd/config.xml'
'etc/vmware/hostd/datastores.xml'
'etc/vmware/hostd/dispatcher.xml'
'etc/vmware/hostd/proxy.xml'
'etc/vmware/hostd/tagExtractor.xml'
'etc/vmware/netmap.conf'
'etc/vmware/ssl/hostd.ssl.config'
'etc/pam.d/vmware-authd'
)
#-------------------------------------------------------------------
source_x86_64=(
"VMware-Player-Full-${pkgver}-${pkgbuild}.${CARCH}.bundle::https://download3.vmware.com/software/WKST-PLAYER-${_pkgver}/VMware-Player-Full-${pkgver}-${pkgbuild}.${CARCH}.bundle"
vmware-bootstrap
vmware-config # Main file configuration, installing to /etc/vmware/config
vmware-configure-initscript.sh
vmware-networks-configuration.service
vmware-networks.service
vmware-usbarbitrator.service
vmware-environment.sh
)
# For update/generate MD5 sum for source files, run `updpkgsums`
md5sums_x86_64=('d8da1dda9969c4013967ec66f00a2b52'
'9d2c6433034063b0f1d5bbd415200b4a'
'ddaeb8d78bb152311e30b86bf2534c19'
'f4b02ac9152d6572d56f3b0243ca6935'
'454e8a92404c1955d5219b283e4b6762'
'fcd2864ee465b1925592c65eb8e65ca3'
'5a64ef908a36f1ce2638ed08fd7d12fb'
'480dc85034f960d428e4b4601578eec6')
options=(!strip emptydirs)
_copy_files () {
echo "==> Copying files"
############################## Creating new empty directories in the package directory
# instead command `install -d -m 755` you can use `mkdir -p`
install -d -m 755 \
"${pkgdir}/etc"/{cups,pam.d,modprobe.d,thnuclnt,vmware,vmware-installer} \
"${pkgdir}/usr"/{bin,lib/{modules-load.d,cups/filter},share/licenses/${pkgname}} \
"${pkgdir}/usr/lib/systemd"/{system,scripts} \
"${pkgdir}/usr/lib/vmware"/{bin,lib,setup,isoimages,modules} \
"${pkgdir}/usr/lib/vmware-ovftool"/{certs,env,schemas} \
"${pkgdir}/usr/lib/vmware-installer/${vmware_installer_version}"/{bin,cdsHelper,lib,python,sopython,vmis}
############################## Installing files
cp -r \
"${srcdir}/extracted/vmware-player-app/share"/* \
"${pkgdir}/usr/share"
cp -r \
"${srcdir}/extracted/vmware-player-app/doc"/*open_source_licenses.txt \
"${pkgdir}/usr/share/licenses/${pkgname}"
cp -T \
"${srcdir}/extracted/vmware-player/doc/EULA" \
"${pkgdir}/usr/share/licenses/${pkgname}/VMware Player - EULA.txt"
cp -r \
"${srcdir}/extracted/vmware-player-app/bin"/* \
"${srcdir}/extracted/vmware-vmx"/{,s}bin/* \
"${pkgdir}/usr/bin"
cp -r \
"${srcdir}/extracted/vmware-player-app/lib"/* \
"${srcdir}/extracted/vmware-vmx"/{lib/*,roms} \
"${srcdir}/extracted/vmware-usbarbitrator/bin" \
"${srcdir}/extracted/vmware-network-editor/lib" \
"${pkgdir}/usr/lib/vmware"
cp -r \
"${srcdir}/extracted/vmware-player-setup/vmware-config" \
"${pkgdir}/usr/lib/vmware/setup"
cp -r "${srcdir}/extracted/vmware-ovftool"/* "${pkgdir}/usr/lib/vmware-ovftool"
mv "${pkgdir}/usr/lib/vmware-ovftool/vmware.eula" "${pkgdir}/usr/share/licenses/${pkgname}/VMware OVF Tool - EULA.txt"
mv "${pkgdir}/usr/lib/vmware-ovftool/"/open_source_licenses.txt "$pkgdir/usr/share/licenses/${pkgname}/VMware Workstation open source license.txt"
rm "${pkgdir}/usr/lib/vmware-ovftool"/{vmware-eula.rtf,manifest.xml}
cp -r \
"${srcdir}/extracted/vmware-installer"/{bin,cdsHelper,lib,python,sopython,vmis,vmis-launcher,vmware-installer,vmware-installer.py} \
"${pkgdir}/usr/lib/vmware-installer/${vmware_installer_version}"
cp -r \
"${srcdir}/extracted/vmware-player-app/etc/cups"/* \
"${pkgdir}/etc/cups"
cp -r \
"${srcdir}/extracted/vmware-player-app/extras/.thnumod" \
"${pkgdir}/etc/thnuclnt"
cp -r \
"${srcdir}/extracted/vmware-player-app/extras/thnucups" \
"${pkgdir}/usr/lib/cups/filter"
cp -r \
"${srcdir}/extracted/vmware-virtual-printer"/VirtualPrinter-*.iso \
"${pkgdir}/usr/lib/vmware/isoimages"
install -d -m 755 "${pkgdir}/usr/lib/vmware-installer/${vmware_installer_version}"/{lib/lib,artwork}
install -m 755 \
"${srcdir}/vmware-configure-initscript.sh" \
"${pkgdir}/usr/lib/vmware-installer/${vmware_installer_version}/bin/configure-initscript.sh"
install -Dm 644 \
"${srcdir}/extracted/vmware-vmx/etc/modprobe.d/modprobe-vmware-fuse.conf" \
"${pkgdir}/etc/modprobe.d/vmware-fuse.conf"
install -Dm 644 \
"${srcdir}/extracted/vmware-vmx/extra/modules.xml" \
"${pkgdir}/usr/lib/vmware/modules/modules.xml"
install -Dm 644 \
"${srcdir}/extracted/vmware-installer/bootstrap" \
"${pkgdir}/etc/vmware-installer/bootstrap"
install -Dm 644 \
"${srcdir}/vmware-bootstrap" \
"${pkgdir}/etc/vmware/bootstrap"
install -Dm 644 \
"${srcdir}/vmware-config" \
"${pkgdir}/etc/vmware/config"
install -m 755 \
"${srcdir}/extracted/vmware-vmx/etc/init.d/vmware" \
"${pkgdir}/usr/lib/systemd/scripts/vmware"
# Installation a config file of auto load kernel modules: https://www.freedesktop.org/software/systemd/man/modules-load.d.html
echo -e "vmw_vmci\nvmmon" > "${pkgdir}/usr/lib/modules-load.d/vmware.conf"
# Installation Service files:
for service_file in \
vmware-networks-configuration.service \
vmware-networks.service \
vmware-usbarbitrator.service
do
install -Dm 644 \
"${srcdir}/${service_file}" \
"${pkgdir}/usr/lib/systemd/system/${service_file}"
done
############################## Applying permissions where necessary
chmod +x \
"${pkgdir}/usr/bin"/* \
"${pkgdir}/usr/lib/vmware/bin"/* \
"${pkgdir}/usr/lib/vmware/setup"/* \
"${pkgdir}/usr/lib/vmware/lib/libvmware-gksu.so/gksu-run-helper" \
"${pkgdir}/usr/lib/vmware-ovftool"/{ovftool,ovftool.bin} \
"${pkgdir}/usr/lib/vmware-installer/${vmware_installer_version}"/{vmware-installer,vmis-launcher} \
"${pkgdir}/usr/lib/cups/filter"/* \
"${pkgdir}/etc/thnuclnt/.thnumod"
# chmod -R 600 "${pkgdir}/etc/vmware/ssl"
chmod +s \
"${pkgdir}/usr/bin/vmware-authd" \
"${pkgdir}/usr/lib/vmware/bin"/{vmware-vmx,vmware-vmx-debug,vmware-vmx-stats}
############################## Adding symlinks that the installer would create
for link in licenseTool vmplayer vmware vmware-app-control vmware-enter-serial \
vmware-fuseUI vmware-gksu vmware-modconfig vmware-modconfig-console \
vmware-mount vmware-netcfg vmware-setup-helper vmware-vmblock-fuse \
vmware-vprobe vmware-zenity
do
ln -s /usr/lib/vmware/bin/appLoader "${pkgdir}/usr/lib/vmware/bin/${link}"
done
for link in \
vmrest
do
ln -s /usr/lib/vmware/bin/appLoader "${pkgdir}/usr/bin/${link}"
done
for link in \
vmware-fuseUI \
vmware-mount \
vmware-netcfg \
vmware-usbarbitrator
do
ln -s /usr/lib/vmware/bin/${link} "${pkgdir}/usr/bin/${link}"
done
ln -s /usr/lib/vmware/icu "${pkgdir}/etc/vmware/icu"
ln -s /usr/lib/vmware-ovftool/ovftool "${pkgdir}/usr/bin/ovftool"
ln -s /usr/lib/vmware-installer/${vmware_installer_version}/vmware-installer "${pkgdir}/usr/bin/vmware-installer"
# Alternative of install of ncurses5-compat-libs for the GUI vmware-installer wich uses ncurses5-compat-libs
ln -s libncursesw.so.6 "${pkgdir}/usr/lib/libncursesw.so.5"
ln -s libncursesw.so.6 "${pkgdir}/usr/lib/libtinfo.so.5"
# Define some environment variables for VMware and remove the tests about kernel modules
install -Dm 644 "${srcdir}/vmware-environment.sh" "${pkgdir}/etc/conf.d/vmware"
for program in vmplayer; do
sed -e '/export PRODUCT_NAME/asource /etc/conf.d/vmware' \
-e 's/if "$BINDIR"\/vmware-modconfig --appname=.*/if true ||/' \
-i "$pkgdir/usr/bin/$program"
done
}
_patch_files () {
echo "==> Patching files"
### Replace placeholder "variables" with real paths:
sed -i 's,@@LIBCONF_DIR@@,/usr/lib/vmware/libconf,g' "${pkgdir}/usr/lib/vmware/libconf/etc/gtk-3.0/gdk-pixbuf.loaders"
sed -i 's,@@BINARY@@,/usr/bin/vmplayer,' "${pkgdir}/usr/share/applications/vmware-player.desktop"
sed -e "s/@@VERSION@@/$vmware_installer_version/" \
-e "s,@@VMWARE_INSTALLER@@,/usr/lib/vmware-installer/$vmware_installer_version," \
-i "${pkgdir}/etc/vmware-installer/bootstrap"
sed -e "/^player.product.version/s/=.*$/= \"$pkgver\"/" \
-e "/^product.buildNumber/s/=.*$/= \"$pkgbuild\"/" \
-i "${pkgdir}/etc/vmware/config"
# Add StartupWMClass attribute to desktop files:
sed -i '/^StartupNotify=.*/a StartupWMClass=vmplayer' "$pkgdir/usr/share/applications/vmware-player.desktop"
}
_create_db_file () {
echo "==> Creating database file"
# Create a database which contains the list of guest tools (necessary to avoid that vmware try to download them)
local database_filename="$pkgdir/etc/vmware-installer/database"
echo -n "" > "$database_filename"
sqlite3 "$database_filename" "CREATE TABLE settings(key VARCHAR PRIMARY KEY, value VARCHAR NOT NULL, component_name VARCHAR NOT NULL);"
sqlite3 "$database_filename" "INSERT INTO settings(key,value,component_name) VALUES('db.schemaVersion','2','vmware-installer');"
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);"
}
prepare() {
# VMware-Player-*.bundle is a bash executable script (binary data).
# You can verify this with the `file` utility: $ file VMware-Player-*.bundle
extracted_dir="${srcdir}/extracted"
[[ -d "$extracted_dir" ]] && rm -r "$extracted_dir"
bash "$(readlink -f "${srcdir}/VMware-Player-Full-${pkgver}-${pkgbuild}.${CARCH}.bundle")" --extract "$extracted_dir"
}
package() {
# Setting global variables
vmware_installer_version=$(grep -oPm1 "(?<=<version>)[^<]+" "${srcdir}/extracted/vmware-installer/manifest.xml")
vmware_usbarbitrator_version=$(grep -oPm1 "(?<=<version>)[^<]+" "${srcdir}/extracted/vmware-usbarbitrator/manifest.xml")
vmware_ovftool_version=$(grep -oPm1 "(?<=<version>)[^<]+" "${srcdir}/extracted/vmware-ovftool/manifest.xml")
vmware_ovftool_build=$(grep -oPm1 "(?<=<buildNumber>)[^<]+" "${srcdir}/extracted/vmware-ovftool/manifest.xml")
_copy_files
_patch_files
_create_db_file
}