aboutsummaryrefslogblamecommitdiffstats
path: root/community/open-vm-tools/APKBUILD
blob: c42a1a3f4a5482575c05b572ba58c982304351d5 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                   
                                               
                     
             

                        
        
                                                                                            
                                              
                         
                                                  
                           


                     

                          
                    

                     
                       


                                        



                       
                                                    
                                  









                   

                     


                    




                       

                   
         
                  
                                                                                                    







                                                                       

                                                  
                        
                                            

                                           
                                    
                                              
                        
                                
 

                      
                          
         
                                        
                                                     
 


                                                 

                       
 

                        

 
         
                                          
                                                                          
                                                
 
                        
 
                     


                                 
                                   
                          
                                
                                  
                               

                                          
                                  

                                     

 



                        
 




                                                   

                                                   
               
 
                                                       


                    
                                   
                                                              
 










                                                                                  
 

                                                     
                                               
 











                                                                              

                                                     


                                                                                 
                                          

 






                                                   














                                                      

                                                         
                                           
 







                                                                     

 
















































                                                                             
                                                                                                                                                                         
                                                                                                                                                                            



                                                                                                                                                                                                 
                                                                                                                                                                                                 
                                                                                                                                                                                      
                                                                                                                                                                       

                                                                                                                                                                            
                                                                                                                                                  
                                                                                                                                                                      

                                                                                                                                                                     
                                                                                                                                                              
                                                                                                                                                                        
                                                                                                                                                  
                                                                                                                                                          

                                                                                                                                                     
                                                                                                                                                          
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
pkgname=open-vm-tools
pkgver=11.1.0
_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="aarch64 x86 x86_64"
arch="$arch !x86" # Fails to compile with new musl
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
	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

	# *-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="6bde66b5ff854d9b07439f9641b1c62a17a0bb5b31123c7b317dcbcdbfa361e95deb3865b01c6ebceb4e2ffecae1d633058fff2b17f1aa5a5a28ea0945dc88bf  open-vm-tools-11.1.0.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
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
7413aa360c8b2d74ee92a95b4003f15da78a04fcefda59bc97c9200de5c008ad7fce71751f67d8e7d0301fbde5b262b99a7ea6d80b45623b646a522410207291  tools.conf.patch
0feef314fc178922f86fdb072fc46ae0932aa59085b8263beecc1ad53c9bec04967b0d7fa62ab1051e65685b03bba80ccb075fe01c0ac67591c81f38131176b2  use-libtirpc-nokrb.patch
1248234f19a29b28b6a75886b39d1579d0f94d43925db1f709b7a05907582f6650b78d39155e7da335f27b6da00586b9c3dc3ca7e4cab19dba5c84cfefd1e6cb  open-vm-tools.initd
f996fc598d01ea778797674fca2a9f467d7ce7ced50e4e0343b3d53bea65770df488b1a286e42603d91e05ba85610161eb68e3fbaa5cbf1757a8aec81869a677  open-vm-tools.confd
4b79d7432f366e5ef202e69bffed5caacab8008f39475d50d54cfa5ac9f521cc0df7122d8e3a95340a4b00cb0b202717293df14f9d411d5edf41dcc7fa4c0550  open-vm-tools.logrotate"