aboutsummaryrefslogtreecommitdiffstats
path: root/main/open-vm-tools/APKBUILD
blob: d457bdf2da96913937385367307adf78908da8ef (plain)
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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=open-vm-tools
pkgver=9.2.2_p893683
_pkgsubver=${pkgver#*_p}
_ver=${pkgver/_p/-}
pkgrel=0
pkgdesc="The Open Virtual Machine Tools are the open source implementation of VMware Tools."
url="http://open-vm-tools.sourceforge.net/"
arch="all"
license="LGPL"
subpackages="$pkgname-gtk $pkgname-dev"
install="$pkgname.pre-install"
makedepends="procps-dev libdnet-dev icu-dev glib-dev pkgconfig bash icu-dev automake 
	autoconf gtk+-dev libxext-dev libxinerama-dev libxtst-dev gtkmm-dev
	libnotify-dev libxrandr-dev libxcomposite-dev libice-dev libsm-dev fuse-dev libtool m4"
source="http://downloads.sourceforge.net/project/open-vm-tools/open-vm-tools/stable-${pkgver%.*}.x/open-vm-tools-$_ver.tar.gz
	0001-lib-misc-Recognize-Alpine-Linux.patch
	libm.patch
	werror.patch
	codeset-uclibc.patch
	iconv-uclibc.patch
	uclibc-stubs.patch
	open-vm-tools.initd
	"

[ "$ALPINE_LIBC" != "eglibc" ] && makedepends="$makedepends rpcgen"

_builddir="$srcdir"/$pkgname-$_ver

prepare() {
	cd "$_builddir"

        for patch in $source; do
                case $patch in
                # we concider patches with uclibc in its name
                # only usefull on uclibc install
                *uclibc*.patch)
                        if [ "$ALPINE_LIBC" != "eglibc" ]; then
                                msg "Applying patch $patch"
                                patch -p1 -i "$srcdir"/$patch || return 1
                        fi
                        ;;
		# we do the same for eglibc
                *eglibc*.patch)
                        if [ "$ALPINE_LIBC" = "eglibc" ]; then
                                msg "Applying patch $patch"
                                patch -p1 -i "$srcdir"/$patch || return 1
                        fi
                        ;;
                *.patch)
                        msg "Applying patch $patch"
                        patch -p1 -i "$srcdir"/$patch || return 1
                        ;;
                esac
        done

	sed -i -e 's/__unused1/st_atim.tv_nsec/g' \
		-e 's/__unused2/st_mtim.tv_nsec/g' \
		-e 's/__unused3/st_ctim.tv_nsec/g' \
		lib/file/filePosix.c lib/hgfsServer/hgfsServerLinux.c \
		|| return 1

	# workaround automake-1.10 issue
	# http://ramblingfoo.blogspot.com/2007/07/required-file-configrpath-not-found.html
	touch config/config.rpath
	aclocal -I m4 && autoconf && automake
}

build() {
	export CUSTOM_PROCPS_NAME="procps"
	export CFLAGS="$CLFAGS -Wno-unused-but-set-variable"
	cd "$_builddir"
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--disable-unity \
		--with-dnet \
		--with-icu \
		--with-procps \
		--with-x \
		--without-kernel-modules \
		--without-pam \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make install DESTDIR=$pkgdir || return 1
	install -Dm755 "$srcdir"/open-vm-tools.initd \
		"$pkgdir"/etc/init.d/open-vm-tools
	find "$pkgdir" -name '*.la' -delete
}

gtk() {
	pkgdesc="Xorg apps and plugins for open-vm-tools"
	mkdir -p "$subpkgdir"/usr/bin \
		"$subpkgdir"/usr/lib/open-vm-tools/plugins \
		"$subpkgdir"/etc/
	mv "$pkgdir"/usr/bin/vmware-user-suid-wrapper \
		"$subpkgdir"/usr/bin/
	mv "$pkgdir"/etc/xdg "$subpkgdir"/etc/
	mv "$pkgdir"/usr/lib/open-vm-tools/plugins/vmusr \
		"$subpkgdir"/usr/lib/open-vm-tools/plugins/
}

md5sums="7af505681d736d4c9ee6493b1166689f  open-vm-tools-9.2.2-893683.tar.gz
87b131c2208b32d9c0bb6fbacd7f75a9  0001-lib-misc-Recognize-Alpine-Linux.patch
7d02fc25aba5c248f3d98dac238f175b  libm.patch
e462f567cd5588d738af4cfa0dd13b3c  werror.patch
82840b6bed002284b9bd2358707ee826  codeset-uclibc.patch
89c7449323ddac4666b73a8467baf95a  iconv-uclibc.patch
30a4161baf6274ac9cceb879460cd894  uclibc-stubs.patch
905ef6a3bac87c9ba2e5d3897ca230e7  open-vm-tools.initd"