aboutsummaryrefslogtreecommitdiffstats
path: root/community/open-vm-tools/APKBUILD
blob: a7ae66eff0273e0da39890a9a7256a1182d1075f (plain) (blame)
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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
pkgname=open-vm-tools
pkgver=11.0.5
_pkgsubver=${pkgver#*_p}
_ver=${pkgver/_p/-}
pkgrel=3
pkgdesc="The Open Virtual Machine Tools are the open source implementation of VMware Tools."
url="https://github.com/vmware/open-vm-tools/"
arch="x86 x86_64"
license="LGPL-2.1-or-later"
subpackages="
	$pkgname-dbg
	$pkgname-lang
	$pkgname-deploypkg
	$pkgname-guestinfo
	$pkgname-gtk
	$pkgname-hgfs
	$pkgname-vix
	$pkgname-static
	$pkgname-timesync
	$pkgname-vmbackup
	$pkgname-plugins-all:_all:noarch
	$pkgname-dev
	$pkgname-openrc
	$pkgname-doc
	"
install="$pkgname.pre-install $pkgname.post-upgrade"
checkdepends="cunit checkbashisms"
makedepends="
	procps-dev
	autoconf
	automake
	bash
	doxygen
	fuse-dev
	glib-dev
	gtk+3.0-dev
	gtkmm3-dev
	libice-dev
	libmspack-dev
	libsm-dev
	libtirpc-dev
	libtool
	libxext-dev
	libxinerama-dev
	libxrandr-dev
	libxtst-dev
	linux-headers
	openssl-dev
	rpcgen
	"
pkggroups="vmware"
source="$pkgname-$pkgver.tar.gz::https://github.com/vmware/open-vm-tools/archive/stable-$_ver.tar.gz
	0001-lib-misc-Recognize-Alpine-Linux.patch
	0002-open-vm-tools-Add-disable-werror-configure-option.patch
	0003-Do-not-assume-that-linux-and-gnu-libc-are-the-same-t.patch
	0004-Use-configure-test-for-struct-timespec.patch
	0005-Fix-definition-of-ALLPERMS-and-ACCESSPERMS.patch
	0006-Use-configure-to-test-for-feature-instead-of-platfor.patch
	0007-Use-configure-test-for-sys-stat.h-include.patch
	0008-Rename-poll.h-to-vm_poll.h.patch
	0009-gnu-ucontext.patch
	0010-use-posix-strerror_r-unless-gnu.patch
	0011-use-off64_t-instead-of-loff_t.patch
	strerror_r.patch
	systemLinux.c-fixup-for-Alpine.patch
	mock-res_ninit-and-res_nclose.patch
	fix-mount.vmhgfs-symlink.patch
	change-default-log-dir.patch
	change-statechange.subr-location.patch
	tools.conf.patch
	use-libtirpc-nokrb.patch

	$pkgname.initd
	$pkgname.confd
	$pkgname.logrotate
	"
builddir="$srcdir/$pkgname-stable-$_ver"
options="suid"  # needed for vmware-user-suid-wrapper

_subpackages="$subpackages"  # save for func _all
_pluginsdir='usr/lib/open-vm-tools/plugins'

prepare() {
	default_prepare

	cd open-vm-tools
	autoreconf -vif
}

build() {
	export CUSTOM_PROCPS_NAME="procps"
	export CFLAGS="$CFLAGS -Wno-unused-but-set-variable -D_GNU_SOURCE"
	export CXXFLAGS="$CXXFLAGS -std=gnu++11"

	cd open-vm-tools

	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--with-x \
		--without-dnet \
		--without-xerces \
		--without-icu \
		--without-kernel-modules \
		--without-pam \
		--disable-werror \
		--disable-glibc-check
	make
}

check() {
	cd open-vm-tools

	make check

	checkbashisms scripts/linux/network
	checkbashisms scripts/common/statechange.sh
}

package() {
	local confdir="$pkgdir/etc/vmware-tools"
	local sharedir="$pkgdir/usr/share/$pkgname"
	local i

	make -C open-vm-tools install DESTDIR="$pkgdir"

	cd "$pkgdir"

	chmod -x "$confdir"/*.conf*
	mv "$confdir"/tools.conf.example "$confdir"/tools.conf

	mkdir -p ./usr/sbin
	mv "$confdir"/vm-support ./usr/sbin/vm-support

	# *-vm-default scripts are identical and they are not supposed to be
	# modified by the user, so move the script to /usr/share and symlink back.
	mkdir -p "$sharedir"
	mv "$confdir"/statechange.subr "$sharedir"/
	cp -a ./etc/vmware-tools/poweroff-vm-default "$sharedir"/statechange.sh
	local path; for path in ./etc/vmware-tools/*-vm-default; do
		cmp "$path" "$sharedir"/statechange.sh \
			|| die '*-vm-default scripts are not identical!'
		rm $path
		ln -s ../../usr/share/$pkgname/statechange.sh $path
	done

	# This script works with NetworkManager only.
	# TODO: Write network script for Alpine.
	rm -f "$confdir"/scripts/vmware/network

	# These commands allow to modify some VM's parameters or write to VM's
	# logs which is typically undesirable to be allowed to any user or
	# process. Of course, this cannot prevent users from copying and
	# running their own open-vm-tools binaries, but better than nothing...
	# See also https://github.com/vmware/open-vm-tools/issues/288.
	for i in vmtoolsd vmware-namespace-cmd vmware-rpctool \
		vmware-toolbox-cmd vmware-xferlogs;
	do
		chgrp vmware ./usr/bin/$i
		chmod 750 ./usr/bin/$i
	done

	chmod 4755 ./usr/bin/vmware-user-suid-wrapper

	install -D -m 755 "$srcdir"/$pkgname.initd ./etc/init.d/$pkgname
	install -D -m 644 "$srcdir"/$pkgname.confd ./etc/conf.d/$pkgname
	install -D -m 644 "$srcdir"/$pkgname.logrotate ./etc/logrotate.d/$pkgname
	install -d -m 750 ./var/log/vmware
}

lang() {
	pkgdesc="Languages for package $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel lang"

	amove usr/share/open-vm-tools/messages
}

deploypkg() {
	pkgdesc="DeployPkg plugin for open-vm-tools"
	depends="$pkgname=$pkgver-r$pkgrel"

	amove usr/lib/libDeployPkg.so.*
	amove $_pluginsdir/vmsvc/libdeployPkgPlugin.so
}

guestinfo() {
	pkgdesc="GuestInfo plugin for open-vm-tools"
	depends="$pkgname=$pkgver-r$pkgrel"

	amove $_pluginsdir/vmsvc/libguestInfo.so
}

gtk() {
	pkgdesc="Xorg apps and plugins for open-vm-tools"
	depends="$pkgname=$pkgver-r$pkgrel"

	amove etc/xdg

	amove usr/bin/vmware-user-suid-wrapper
	amove usr/bin/vmware-vmblock-fuse
	amove usr/bin/vmware-user

	amove usr/lib/open-vm-tools/plugins/vmusr
	amove usr/lib/open-vm-tools/plugins/vmsvc/libresolutionKMS.so
}

hgfs() {
	pkgdesc="Support for shared folders in VMware guests"
	depends="$pkgname=$pkgver-r$pkgrel"

	amove sbin/mount.vmhgfs
	amove usr/sbin/mount.vmhgfs
	amove usr/bin/vmhgfs-fuse
	amove usr/bin/vmware-hgfsclient

	amove usr/lib/libhgfs.so.*
	amove $_pluginsdir/common/libhgfsServer.so
}

timesync() {
	pkgdesc="TimeSync plugin for open-vm-tools"
	depends="$pkgname=$pkgver-r$pkgrel"

	amove $_pluginsdir/vmsvc/libtimeSync.so
}

vix() {
	pkgdesc="VIX plugin for open-vm-tools"
	depends="$pkgname=$pkgver-r$pkgrel"

	amove $_pluginsdir/common/libvix.so
}

vmbackup() {
	pkgdesc="VmBackup plugin for open-vm-tools"
	depends="$pkgname=$pkgver-r$pkgrel"

	amove $_pluginsdir/vmsvc/libvmbackup.so
}

_all() {
	pkgdesc="Meta package with all open-vm-tools plugins except gtk"
	depends=""
	local plugin

	for plugin in deploypkg guestinfo hgfs timesync vix vmbackup; do
		if ! echo "$_subpackages" | grep -qw "$pkgname-$plugin"; then
			die "plugin $plugin is missing in subpackages!"
		fi
		depends="$depends $pkgname-$plugin"
	done

	mkdir -p "$subpkgdir"
}

sha512sums="c09e5b66f318273c712880f8b8bfe9782f6302e798808eb588f643cfca763b6805d5672a95fc3c87bf18dd4549f7a0cdebf9b9ca313cf761a72864748895fab9  open-vm-tools-11.0.5.tar.gz
fe56bb4a57f228081d28dede1f25d6de73fcdb9276a704354d24711aaf47fe2399f81202afd0a33f6eeda1117067fea0cfc9e3eb97e35a3a7fddfa54056c273f  0001-lib-misc-Recognize-Alpine-Linux.patch
9188161f9bbd6572ee20855e727257b2140b39f1ba19b96879eb9878fb08cbdb7c3a5c9f5f8a4f389090acea6f71ee88fb36c7d4a74c1b8b94c9124db696a7f2  0002-open-vm-tools-Add-disable-werror-configure-option.patch
1dd0cde6ee19aec77ddf803e95b0404e803569a38c7b3d001832b4bbeae95ea15ed32c59f27bffb315130bad0c7a788a7a522df13a5f265f66c4c7c302a1966d  0003-Do-not-assume-that-linux-and-gnu-libc-are-the-same-t.patch
c647561c72b3ad919502ec4dd0a1ab736e2d479d8437b882791adce5417d8c26163ecffe9e212dab633c513bce6447cdbcb610eecf7dbb0eeeb792db16301de5  0004-Use-configure-test-for-struct-timespec.patch
6b0b9cc4a7b9837649a01aacb957b4465ec901250e48dbb273514abedf8eb3a9c16b3ad09be413a8ab897e37dff0d065a3144a2418cd7ae5aa3020bd1ed14203  0005-Fix-definition-of-ALLPERMS-and-ACCESSPERMS.patch
4d6ce73d7e3fa554e31d7956b26e1d0341b57ff477d3e1386f30d7e1acb38cf3f6d8a3f918a484f64acf3e5c0f2ef898027963b8b87949669d3308eb9c185d82  0006-Use-configure-to-test-for-feature-instead-of-platfor.patch
9d28eab3e1a40138efa05e78956a2615b171703f9689252d0960145e39b0ba5bbf0e2007479cbbca3dced89ccb45758908a57a2f5b361e4813ad67a0732e4539  0007-Use-configure-test-for-sys-stat.h-include.patch
03579b28ecc446c6a16256be8b53dcb9b5f90d05ea52aad77997f2a7957d63af546182872b2ad2ed2f99904a22be23fc64ced4ecac91a53646d9946bd6d13625  0008-Rename-poll.h-to-vm_poll.h.patch
88a8dcb785723c6120aed19e46c7f9890858a4b60db4a86e97fe4babf7b0d8babb3b3294f9d6c0004c6ae0c75860c3a624e6446f6e0d1a23bb92578f92120352  0009-gnu-ucontext.patch
6c8b99f51bc0fd114ce66a3311f151efbe56ec308d079afec837b9d0b60eae3fb42e1b5219246c1015a23fb63616398b958e1388830b80d5efdb27cce7bd6552  0010-use-posix-strerror_r-unless-gnu.patch
a38bb2ac16657be9f7e9b2a5e32d23e66db1f283284c1cb8e7ffe853e047373397e60f01e735a28ecfaa60010f285b0b5a4066465a2afbe643a9b4b9b74ac1f4  0011-use-off64_t-instead-of-loff_t.patch
5507a58198179805e4c924b6bd6ac8b026bd602c9e5e4c52213dadf6c8880a23a16ee49a4dfe2db27515c2a36009e609dd81b7ee0d560bbea1ddf6a5324eb7ac  strerror_r.patch
c18280eb3fdfe1e3ecc5aa116369908c71917bd4dd49743a9abf78e0096e8d6c7d4323057cf506ef31886b893b2e4c4839656172edd5097a347efa96aea1c86c  systemLinux.c-fixup-for-Alpine.patch
8288503c54c5a15268b1590d747d4f246fa348734ebc70f3bd56f8cec6419d032ee6bf52a7579ee088f2c80f5b0d85f050e0615d6ad6cd8da016efa2a626ce17  mock-res_ninit-and-res_nclose.patch
dbcec24beafbbe94c8ed12482f9d0c643a6bbec256198cdc898513410271a3e2c0b7e35b0997ee0e91b1567f4ed0ecf44740b8c972dd5b2fc4bf21643653153a  fix-mount.vmhgfs-symlink.patch
87057ae614d34af2e5581f31b5e028363f316bce4e255b5199438bade96891e798160424aee5804314280773de98ed514fcac7a790bec1f1ae63f3daa1fbef9c  change-default-log-dir.patch
6494fe94f332706a130dd12afa18b881f6b6c4e0523570ff866e1678e37af6bd6148c4cf7d957e12f8dc2a51b4f07aa849c4e947911bcbe20d0c81049a2b6974  change-statechange.subr-location.patch
44d4f149bdb15b364c5a11657514f432dba7d3fd35907cb58b3c47d54165f439d7775db128f8b476e9f7002d9741cb11d4cba83ce8998db003bfad761c4db710  tools.conf.patch
0feef314fc178922f86fdb072fc46ae0932aa59085b8263beecc1ad53c9bec04967b0d7fa62ab1051e65685b03bba80ccb075fe01c0ac67591c81f38131176b2  use-libtirpc-nokrb.patch
1248234f19a29b28b6a75886b39d1579d0f94d43925db1f709b7a05907582f6650b78d39155e7da335f27b6da00586b9c3dc3ca7e4cab19dba5c84cfefd1e6cb  open-vm-tools.initd
f996fc598d01ea778797674fca2a9f467d7ce7ced50e4e0343b3d53bea65770df488b1a286e42603d91e05ba85610161eb68e3fbaa5cbf1757a8aec81869a677  open-vm-tools.confd
4b79d7432f366e5ef202e69bffed5caacab8008f39475d50d54cfa5ac9f521cc0df7122d8e3a95340a4b00cb0b202717293df14f9d411d5edf41dcc7fa4c0550  open-vm-tools.logrotate"