aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/open-vm-tools-grsec/APKBUILD61
-rw-r--r--main/open-vm-tools-grsec/vmware-modules.initd25
-rw-r--r--main/open-vm-tools/APKBUILD99
-rw-r--r--main/open-vm-tools/codeset-uclibc.patch20
-rw-r--r--main/open-vm-tools/ecvt.patch205
-rw-r--r--main/open-vm-tools/getloadavg-uclibc.patch19
-rw-r--r--main/open-vm-tools/iconv-uclibc.patch13
-rw-r--r--main/open-vm-tools/libm.patch18
-rw-r--r--main/open-vm-tools/open-vm-tools.desktop7
-rw-r--r--main/open-vm-tools/open-vm-tools.initd76
-rw-r--r--main/open-vm-tools/procmgrposix.patch11
11 files changed, 554 insertions, 0 deletions
diff --git a/main/open-vm-tools-grsec/APKBUILD b/main/open-vm-tools-grsec/APKBUILD
new file mode 100644
index 0000000000..064f8be877
--- /dev/null
+++ b/main/open-vm-tools-grsec/APKBUILD
@@ -0,0 +1,61 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+
+_flavor=grsec
+
+# source the kernel version
+if [ -f ../../main/linux-${_flavor}/APKBUILD ]; then
+ . ../../main/linux-${_flavor}/APKBUILD
+fi
+
+_kernelver="$pkgver-r$pkgrel"
+_abi_release=${pkgver}-${_flavor}
+_kpkgrel=$pkgrel
+_realname=open-vm-tools
+
+pkgname=open-vm-tools-$_flavor
+pkgver=2011.01.24
+_pkgsubver=354108
+pkgrel=1
+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=""
+depends="linux-${_flavor}=${_kernelver}"
+makedepends="glib-dev gettext-dev linux-${_flavor}-dev=${_kernelver}"
+source="http://downloads.sourceforge.net/open-vm-tools/open-vm-tools-$pkgver-$_pkgsubver.tar.gz
+ vmware-modules.initd
+ "
+
+_builddir="$srcdir/$_realname-$pkgver-$_pkgsubver"
+
+prepare() {
+ cd "$_builddir"
+}
+
+build() {
+ cd "$_builddir"
+ ./configure --without-pam \
+ --without-x \
+ --without-dnet \
+ --without-icu \
+ --without-procps \
+ --with-kernel-release="$_abi_release" \
+ || return 1
+ cd "$_builddir"/modules
+ make -j1 modules || return 1
+}
+
+package() {
+ cd "$_builddir"
+ install -D -m755 "$srcdir"/vmware-modules.initd \
+ "$pkgdir"/etc/init.d/vmware-modules || return 1
+ mkdir -p $pkgdir/lib/modules/$_abi_release/misc/
+ cd "$_builddir"/modules
+ for module in `find -type f -name '*.ko'`; do
+ install -D -m644 $module "$pkgdir/lib/modules/$_abi_release/misc/"
+ done
+}
+
+md5sums="b324efa55bb3f1198100cad838e9272b open-vm-tools-2011.01.24-354108.tar.gz
+f16058de6e4251a509f87017f1684887 vmware-modules.initd"
diff --git a/main/open-vm-tools-grsec/vmware-modules.initd b/main/open-vm-tools-grsec/vmware-modules.initd
new file mode 100644
index 0000000000..4977aee7c4
--- /dev/null
+++ b/main/open-vm-tools-grsec/vmware-modules.initd
@@ -0,0 +1,25 @@
+#!/sbin/runscript
+
+MODULES="vmblock vmci vmhgfs vmsync vmxnet vsock"
+
+depend() {
+ before open-vm-tools
+}
+
+
+start() {
+ ebegin "Loading VMware kernel modules"
+ for mod in $MODULES; do
+ modprobe -q $mod
+ done
+ eend $?
+}
+
+stop() {
+ ebegin "Unloading VMware kernel modules"
+ for mod in $MODULES; do
+ rmmod $mod
+ done
+ eend $?
+}
+
diff --git a/main/open-vm-tools/APKBUILD b/main/open-vm-tools/APKBUILD
new file mode 100644
index 0000000000..99e65e5c92
--- /dev/null
+++ b/main/open-vm-tools/APKBUILD
@@ -0,0 +1,99 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=open-vm-tools
+pkgver=2011.01.24
+_pkgsubver=354108
+pkgrel=2
+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"
+makedepends="procps-dev libdnet-dev icu-dev glib-dev pkgconfig bash
+ libtirpc-dev rpcgen icu-dev automake autoconf
+ gtk+-dev libxext-dev libxinerama-dev libxtst-dev gtkmm-dev
+ libnotify-dev libxrandr-dev
+ "
+source="http://downloads.sourceforge.net/open-vm-tools/open-vm-tools-$pkgver-$_pkgsubver.tar.gz
+ getloadavg-uclibc.patch
+ codeset-uclibc.patch
+ ecvt.patch
+ iconv-uclibc.patch
+ libm.patch
+ open-vm-tools.initd
+ procmgrposix.patch
+ "
+
+_builddir="$srcdir"/$pkgname-$pkgver-$_pkgsubver
+
+prepare() {
+ cd "$_builddir"
+ for i in "$srcdir"/*.patch; do
+ [ -r "$i" ] || continue
+ patch -p1 -i "$i" || return 1
+ 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() {
+ cd "$_builddir"
+ ./configure --prefix=/usr \
+ --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
+
+ # one of the plugins seems to be linked to libhgfsServer
+ # create a link to abuild gets happy
+ ln -s open-vm-tools/plugins/vmsvc/libhgfsServer.so \
+ "$pkgdir"/usr/lib/libhgfsServer.so.0
+
+ # dont bother create a -dev package
+ rm -f "$pkgdir"/usr/lib/*.a "$pkgdir"/usr/lib/*.la
+ install -Dm644 "$srcdir"/open-vm-tools.desktop \
+ "$pkgdir"/etc/xdg/open-vm-tools.desktop
+ install -Dm755 "$srcdir"/open-vm-tools.initd \
+ "$pkgdir"/etc/init.d/open-vm-tools
+}
+
+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-toolbox \
+ "$pkgdir"/usr/bin/vmware-user \
+ "$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="b324efa55bb3f1198100cad838e9272b open-vm-tools-2011.01.24-354108.tar.gz
+49e2e394d0b567fa71fcd295e96bc1c8 getloadavg-uclibc.patch
+82840b6bed002284b9bd2358707ee826 codeset-uclibc.patch
+840e4d6ff3f53fc22bdedf4d64aabc91 ecvt.patch
+89c7449323ddac4666b73a8467baf95a iconv-uclibc.patch
+7d02fc25aba5c248f3d98dac238f175b libm.patch
+c96644aa42d611fae853a3a2095efc47 open-vm-tools.initd
+7b833102a56009bdfc2fef2fb9ffa297 procmgrposix.patch"
diff --git a/main/open-vm-tools/codeset-uclibc.patch b/main/open-vm-tools/codeset-uclibc.patch
new file mode 100644
index 0000000000..b26df16611
--- /dev/null
+++ b/main/open-vm-tools/codeset-uclibc.patch
@@ -0,0 +1,20 @@
+--- ./lib/misc/codesetOld.c.orig
++++ ./lib/misc/codesetOld.c
+@@ -723,7 +723,7 @@
+ {
+ char *codeset;
+
+-#if defined(__linux__)
++#if defined(__linux__) && !defined(__UCLIBC__)
+
+ locale_t new = newlocale(LC_CTYPE_MASK, "", NULL);
+ if (!new) {
+@@ -739,7 +739,7 @@
+ codeset = Util_SafeStrdup(nl_langinfo_l(CODESET, new));
+ freelocale(new);
+
+-#elif defined(sun)
++#elif defined(sun) || defined(__UCLIBC__)
+
+ char *locale = setlocale(LC_CTYPE, NULL);
+ if (!setlocale(LC_CTYPE, "")) {
diff --git a/main/open-vm-tools/ecvt.patch b/main/open-vm-tools/ecvt.patch
new file mode 100644
index 0000000000..53e88e9989
--- /dev/null
+++ b/main/open-vm-tools/ecvt.patch
@@ -0,0 +1,205 @@
+commit e996e91ca5951c50769dcaa8e074daa973006849
+Author: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu Jul 8 06:39:36 2010 +0000
+
+ add ecvt() implementation
+
+diff --git a/lib/string/Makefile.am b/lib/string/Makefile.am
+index 1edab81..5f2e7ab 100644
+--- a/lib/string/Makefile.am
++++ b/lib/string/Makefile.am
+@@ -23,6 +23,7 @@ libString_la_SOURCES += bsd_vsnprintf.c
+ libString_la_SOURCES += bsd_vsnwprintf.c
+ libString_la_SOURCES += convertutf.c
+ libString_la_SOURCES += str.c
++libString_la_SOURCES += ecvt.c
+
+ AM_CFLAGS = @LIB_STRING_CPPFLAGS@
+
+diff --git a/lib/string/bsd_output_shared.c b/lib/string/bsd_output_shared.c
+index 3616947..321d6f1 100644
+--- a/lib/string/bsd_output_shared.c
++++ b/lib/string/bsd_output_shared.c
+@@ -64,6 +64,9 @@
+
+ #ifndef NO_FLOATING_POINT
+
++extern char* ecvt(double arg, int ndigits, int *decptp, int *signp);
++extern char* fcvt(double arg, int ndigits, int *decptp, int *signp);
++
+ /*
+ *-----------------------------------------------------------------------------
+ *
+diff --git a/lib/string/ecvt.c b/lib/string/ecvt.c
+new file mode 100644
+index 0000000..1979c3d
+--- /dev/null
++++ b/lib/string/ecvt.c
+@@ -0,0 +1,167 @@
++/*
++ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
++ *
++ * @APPLE_LICENSE_HEADER_START@
++ *
++ * This file contains Original Code and/or Modifications of Original Code
++ * as defined in and that are subject to the Apple Public Source License
++ * Version 2.0 (the 'License'). You may not use this file except in
++ * compliance with the License. Please obtain a copy of the License at
++ * http://www.opensource.apple.com/apsl/ and read it before using this
++ * file.
++ *
++ * The Original Code and all software distributed under the License are
++ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
++ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
++ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
++ * Please see the License for the specific language governing rights and
++ * limitations under the License.
++ *
++ * @APPLE_LICENSE_HEADER_END@
++ */
++/*
++ * ecvt converts to decimal
++ * the number of digits is specified by ndigit
++ * decptp is set to the position of the decimal point
++ * signp is set to 0 for positive, 1 for negative
++ */
++
++
++static double ecvt_rint(double x);
++
++static char *cvt();
++
++/* big enough to handle %.20f conversion of 1e308 */
++#define NDIG 350
++
++char*
++ecvt(arg, ndigits, decptp, signp)
++double arg;
++int ndigits, *decptp, *signp;
++{
++ return(cvt(arg, ndigits, decptp, signp, 1));
++}
++
++char*
++fcvt(arg, ndigits, decptp, signp)
++double arg;
++int ndigits, *decptp, *signp;
++{
++ return(cvt(arg, ndigits, decptp, signp, 0));
++}
++
++static char*
++cvt(arg, ndigits, decptp, signp, eflag)
++double arg;
++int ndigits, *decptp, *signp;
++int eflag;
++{
++ register int decpt;
++ double fi, fj;
++ register char *p, *p1;
++ static char buf[NDIG] = { 0 };
++ double modf();
++
++ if (ndigits < 0)
++ ndigits = 0;
++ if (ndigits >= NDIG-1)
++ ndigits = NDIG-2;
++
++ decpt = 0;
++ *signp = 0;
++ p = &buf[0];
++
++ if (arg == 0) {
++ *decptp = 0;
++ while (p < &buf[ndigits])
++ *p++ = '0';
++ *p = '\0';
++ return(buf);
++ } else if (arg < 0) {
++ *signp = 1;
++ arg = -arg;
++ }
++
++ arg = modf(arg, &fi);
++ p1 = &buf[NDIG];
++
++ /*
++ * Do integer part
++ */
++ if (fi != 0) {
++ while (fi != 0) {
++ fj = modf(fi/10, &fi);
++ /**--p1 = (int)((fj+.03)*10) + '0';*/
++ *--p1 = (int)ecvt_rint((fj)*10) + '0';
++ decpt++;
++ }
++ while (p1 < &buf[NDIG])
++ *p++ = *p1++;
++ } else if (arg > 0) {
++ while ((fj = arg*10) < 1) {
++ arg = fj;
++ decpt--;
++ }
++ }
++ *decptp = decpt;
++
++ /*
++ * do fraction part
++ * p pts to where fraction should be concatenated
++ * p1 is how far conversion must go to
++ */
++ p1 = &buf[ndigits];
++ if (eflag==0) {
++ /* fcvt must provide ndigits after decimal pt */
++ p1 += decpt;
++ /* if decpt was negative, we might done for fcvt */
++ if (p1 < &buf[0]) {
++ buf[0] = '\0';
++ return(buf);
++ }
++ }
++ while (p <= p1 && p < &buf[NDIG]) {
++ arg *= 10;
++ arg = modf(arg, &fj);
++ *p++ = (int)fj + '0';
++ }
++ /*
++ * if we converted all the way to the end of the
++ * buf, don't mess with rounding since there's nothing
++ * significant out here anyway
++ */
++ if (p1 >= &buf[NDIG]) {
++ buf[NDIG-1] = '\0';
++ return(buf);
++ }
++ /*
++ * round by adding 5 to last digit and propagating
++ * carries
++ */
++ p = p1;
++ *p1 += 5;
++ while (*p1 > '9') {
++ *p1 = '0';
++ if (p1 > buf)
++ ++*--p1;
++ else {
++ *p1 = '1';
++ (*decptp)++;
++ if (eflag == 0) {
++ if (p > buf)
++ *p = '0';
++ p++;
++ }
++ }
++ }
++ *p = '\0';
++ return(buf);
++}
++
++static double ecvt_rint(double x)
++{
++ asm("frndint" : "=t" (x) : "0" (x));
++ return(x);
++}
++
diff --git a/main/open-vm-tools/getloadavg-uclibc.patch b/main/open-vm-tools/getloadavg-uclibc.patch
new file mode 100644
index 0000000000..ccc4c388ed
--- /dev/null
+++ b/main/open-vm-tools/getloadavg-uclibc.patch
@@ -0,0 +1,19 @@
+--- a/lib/misc/hostinfoPosix.c
++++ b/lib/misc/hostinfoPosix.c
+@@ -1398,7 +1398,15 @@
+ float *avg1, // IN/OUT:
+ float *avg2) // IN/OUT:
+ {
+-#if defined(__linux__) || defined(__APPLE__)
++#if defined(__UCLIBC__)
++ FILE *f;
++ if ((f = fopen("/proc/loadavg", "r")) == NULL)
++ return FALSE;
++ fscanf(f, "%f %f %f", avg0, avg1, avg2);
++ fclose(f);
++ return TRUE;
++
++#elif defined(GLIBC_VERSION_22) || defined(__APPLE__)
+ double avg[3];
+ int res;
+
diff --git a/main/open-vm-tools/iconv-uclibc.patch b/main/open-vm-tools/iconv-uclibc.patch
new file mode 100644
index 0000000000..2588125fb8
--- /dev/null
+++ b/main/open-vm-tools/iconv-uclibc.patch
@@ -0,0 +1,13 @@
+--- ./configure.ac
++++ ./configure.ac
+@@ -1085,6 +1085,9 @@
+ AC_DEFINE([NO_MULTIMON], 1, [Define to 1 if building without multimon support.])
+ fi
+
++AM_ICONV
++LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD $LIBICONV"
++
+ LIB_AUTH_CPPFLAGS="$LIB_AUTH_CPPFLAGS $PAM_CPPFLAGS"
+ if test "$HAVE_CRYPT" = "yes"; then
+ LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lcrypt"
+
diff --git a/main/open-vm-tools/libm.patch b/main/open-vm-tools/libm.patch
new file mode 100644
index 0000000000..cd013f4d20
--- /dev/null
+++ b/main/open-vm-tools/libm.patch
@@ -0,0 +1,18 @@
+--- a/hgfsmounter/Makefile.am
++++ b/hgfsmounter/Makefile.am
+@@ -23,6 +23,7 @@
+ mount_vmhgfs_LDADD += ../lib/panicDefault/libPanicDefault.la
+ mount_vmhgfs_LDADD += ../lib/panic/libPanic.la
+ mount_vmhgfs_LDADD += ../lib/stubs/libStubs.la
++mount_vmhgfs_LDADD += -lm
+
+ mount_vmhgfs_SOURCES =
+ mount_vmhgfs_SOURCES += hgfsmounter.c
+--- a/rpctool/Makefile.am
++++ b/rpctool/Makefile.am
+@@ -25,4 +25,5 @@
+ vmware_rpctool_LDADD += ../lib/message/libMessage.la
+ vmware_rpctool_LDADD += ../lib/backdoor/libBackdoor.la
+ vmware_rpctool_LDADD += ../lib/string/libString.la
++vmware_rpctool_LDADD += -lm
+
diff --git a/main/open-vm-tools/open-vm-tools.desktop b/main/open-vm-tools/open-vm-tools.desktop
new file mode 100644
index 0000000000..2107a62e0b
--- /dev/null
+++ b/main/open-vm-tools/open-vm-tools.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Application
+Exec=vmware-user
+Name=VMware User Agent
+X-KDE-autostart-phase=1
+NoDisplay=true
diff --git a/main/open-vm-tools/open-vm-tools.initd b/main/open-vm-tools/open-vm-tools.initd
new file mode 100644
index 0000000000..e54b84aaff
--- /dev/null
+++ b/main/open-vm-tools/open-vm-tools.initd
@@ -0,0 +1,76 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/open-vm-tools/files/open-vm-tools.initd,v 1.2 2009/12/20 14:05:43 vadimk Exp $
+
+DND_TMPDIR="/tmp/VMwareDnD"
+USER_GROUP="root:vmware"
+DND_TMPDIR_PERMS="1777"
+GUESTD_BIN="/usr/bin/vmtoolsd"
+PIDFILE="/var/run/vmtoolsd.pid"
+MOUNTPOINT="/proc/fs/vmblock/mountPoint"
+
+depend() {
+ before net X
+}
+
+start() {
+ if [ "${VM_DRAG_AND_DROP}" == "yes" ];
+ then
+
+ if ! grep -q -w vmblock /proc/modules;
+ then
+ ebegin "Loading vmblock module"
+ modprobe vmblock
+ eend $?
+ sleep 0.25
+ fi
+
+ if [[ ! -d "${DND_TMPDIR}" ]];
+ then
+ # einfo "Creating the VM drag and drop directory"
+ mkdir "${DND_TMPDIR}"
+ chown "${USER_GROUP}" "${DND_TMPDIR}"
+ chmod "${DND_TMPDIR_PERMS}" "${DND_TMPDIR}"
+ fi
+
+ # DnD_TMPDIR must exist before vmblock can be mounted
+ ebegin "Mounting vmblock device"
+ mount -t vmblock none ${MOUNTPOINT}
+ eend $?
+ fi
+
+ ebegin "Starting vmtoolsd"
+ start-stop-daemon --chuid "${USER_GROUP}" --start --quiet --background --make-pidfile --pidfile "${PIDFILE}" --exec ${GUESTD_BIN}
+ eend $?
+}
+
+stop() {
+ local ret
+
+ if [ "${VM_DRAG_AND_DROP}" == "yes" ];
+ then
+ ebegin "Cleaning the contents of ${DND_TMPDIR}"
+ # First check, whether ${DND_TMPDIR} isn valid... we shouldn't risk deleting the content of ""/*
+ if [[ ! -z "${DND_TMPDIR}" ]] && [[ "${DND_TMPDIR}" != "/" ]];
+ then
+ rm -rf ${DND_TMPDIR}/*
+ ret=0
+ else
+ eerror "Not cleaning up ${DND_TMPDIR}, please check definition of variable"
+ ret=1
+ fi
+ eend $ret
+
+ ebegin "Unmounting vmblock device"
+ if grep -q -w "${MOUNTPOINT}" /proc/mounts;
+ then
+ umount ${MOUNTPOINT} 1>&2 > /dev/null
+ fi
+ eend 0
+ fi
+
+ ebegin "Stopping vmtoolsd"
+ start-stop-daemon --stop --quiet --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/main/open-vm-tools/procmgrposix.patch b/main/open-vm-tools/procmgrposix.patch
new file mode 100644
index 0000000000..510c48a722
--- /dev/null
+++ b/main/open-vm-tools/procmgrposix.patch
@@ -0,0 +1,11 @@
+--- a/lib/procMgr/procMgrPosix.c
++++ b/lib/procMgr/procMgrPosix.c
+@@ -114,7 +114,7 @@
+ #define SOLARIS_BASH_PATH "/usr/bin/bash"
+ #endif
+
+-#if defined(linux) && !defined(GLIBC_VERSION_23)
++#if defined(linux) && !defined(GLIBC_VERSION_23) && !defined(__UCLIBC__)
+ /*
+ * Implements the system calls (they are not wrapped by glibc til 2.3.2).
+ *