OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src openpkg-web openpkg$ Date: 26-Dec-2003 10:47:56
Branch: HEAD Handle: 2003122609475204
Added files:
openpkg-re/vcheck vc.vmware-console
openpkg-src/vmware-console
vmware-console.c vmware-console.mk
vmware-console.sh vmware-console.spec
Modified files:
openpkg-web news.txt
Log:
new package: vmware-console 2.5.1.6192 (VMWare GSX/ESX Remote Console)
Summary:
Revision Changes Path
1.1 +10 -0 openpkg-re/vcheck/vc.vmware-console
1.1 +301 -0 openpkg-src/vmware-console/vmware-console.c
1.1 +19 -0 openpkg-src/vmware-console/vmware-console.mk
1.1 +16 -0 openpkg-src/vmware-console/vmware-console.sh
1.1 +125 -0 openpkg-src/vmware-console/vmware-console.spec
1.7892 +1 -0 openpkg-web/news.txt
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-re/vcheck/vc.vmware-console
============================================================================
$ cvs diff -u -r0 -r1.1 vc.vmware-console
--- /dev/null 2003-12-26 10:47:52.000000000 +0100
+++ vc.vmware-console 2003-12-26 10:47:52.000000000 +0100
@@ -0,0 +1,10 @@
+config = {
+}
+
+prog vmware-console = {
+ disabled
+ version = 2.5.1-6192
+ url = http://www.vmware.com/
+ regex = vmware-console-(__VER__)\.tar\.gz
+}
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/vmware-console/vmware-console.c
============================================================================
$ cvs diff -u -r0 -r1.1 vmware-console.c
--- /dev/null 2003-12-26 10:47:56.000000000 +0100
+++ vmware-console.c 2003-12-26 10:47:56.000000000 +0100
@@ -0,0 +1,301 @@
+/*
+** vmware-console.c -- VMWare GSX Server Remote Console binary RTLD wrapper
+*/
+
+#define CONFIG_OLD_PATHSTR "/etc/vmware-console/config"
+#define CONFIG_NEW_ENVVAR "VMWARE_CONSOLE_CONFIG"
+
+#define fopen remove_fopen
+#include <stdio.h>
+#undef fopen
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <unistd.h>
+#include <limits.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#if defined(PATH_MAX)
+#define PATH_ADJUST_MAXLEN PATH_MAX
+#elif defined(MAXPATHLEN)
+#define PATH_ADJUST_MAXLEN MAXPATHLEN
+#else
+#define PATH_ADJUST_MAXLEN 1024
+#endif
+
+static void path_adjust(const char *func, char *buf, size_t buflen, const char
*path)
+{
+ size_t pathlen;
+ char *cp;
+
+ /* special case first */
+ if (path == NULL) {
+ buf[0] = '\0';
+ return;
+ }
+
+ /* take over path into buffer */
+ pathlen = strlen(path);
+ if (pathlen > buflen)
+ pathlen = buflen;
+ strncpy(buf, path, pathlen);
+ buf[pathlen] = '\0';
+
+ /* apply path adjustments */
+ if (strcmp(buf, CONFIG_OLD_PATHSTR) == 0) {
+ if ((cp = getenv(CONFIG_NEW_ENVVAR)) != NULL)
+ strcpy(buf, cp);
+ }
+
+ return;
+}
+
+#include <features.h>
+#define __USE_GNU
+#include <dlfcn.h>
+#undef __USE_GNU
+#include <fcntl.h>
+
+static int
+myopen(
+ const char *func_name,
+ int (**func_ptr)(const char *, int, ...),
+ char *buf,
+ size_t buflen,
+ const char *path,
+ int flags,
+ va_list ap)
+{
+ int rv;
+ int mode;
+
+ /* initially resolve original open(2) like function */
+ if (*func_ptr == NULL) {
+ if ((*func_ptr = dlsym(RTLD_NEXT, func_name)) == NULL) {
+ fprintf(stderr, "vmware-console.so: unable to resolve function
\"%s\"\n", func_name);
+ abort();
+ }
+ }
+
+ /* adjust path */
+ path_adjust(func_name, buf, buflen, path);
+
+ /* execute original function */
+ if (flags & O_CREAT) {
+ mode = (int)va_arg(ap, int);
+ rv = (*func_ptr)(buf, flags, mode);
+ }
+ else
+ rv = (*func_ptr)(buf, flags);
+
+ /* pass-through return value */
+ return rv;
+}
+
+#define genstub_open(name) \
+int name(const char *path, int flags, ...) \
+{ \
+ static int (*func)(const char *, int, ...) = NULL; \
+ char path_adjusted[PATH_ADJUST_MAXLEN]; \
+ va_list ap; \
+ int rv; \
+\
+ va_start(ap, flags); \
+ rv = myopen(#name, &func, path_adjusted, sizeof(path_adjusted), path, flags,
ap); \
+ va_end(ap); \
+ return rv; \
+}
+
+genstub_open(open)
+genstub_open(open64)
+genstub_open(__open)
+genstub_open(__open64)
+genstub_open(__libc_open)
+genstub_open(__libc_open64)
+
+static int
+mystat(
+ const char *func_name,
+ int (**func_ptr)(const char *, struct stat *),
+ char *buf,
+ size_t buflen,
+ const char *path,
+ struct stat *sb)
+{
+ int rv;
+
+ /* initially resolve original stat(2) like function */
+ if (*func_ptr == NULL) {
+ if ((*func_ptr = dlsym(RTLD_NEXT, func_name)) == NULL) {
+ fprintf(stderr, "vmware-console.so: unable to resolve function
\"%s\"\n", func_name);
+ abort();
+ }
+ }
+
+ /* adjust path */
+ path_adjust(func_name, buf, buflen, path);
+
+ /* execute original function */
+ rv = (*func_ptr)(buf, sb);
+
+ /* pass-through return value */
+ return rv;
+}
+
+#define genstub_stat(name) \
+int name(const char *path, struct stat *sb) \
+{ \
+ static int (*func)(const char *, struct stat *sb) = NULL; \
+ char path_adjusted[PATH_ADJUST_MAXLEN]; \
+ int rv; \
+\
+ rv = mystat(#name, &func, path_adjusted, sizeof(path_adjusted), path, sb); \
+ return rv; \
+}
+
+genstub_stat(stat)
+genstub_stat(stat64)
+genstub_stat(__stat)
+genstub_stat(__stat64)
+genstub_stat(__libc_stat)
+genstub_stat(__libc_stat64)
+
+static int
+myaccess(
+ const char *func_name,
+ int (**func_ptr)(const char *, int mode),
+ char *buf,
+ size_t buflen,
+ const char *path,
+ int mode)
+{
+ int rv;
+
+ /* initially resolve original access(2) like function */
+ if (*func_ptr == NULL) {
+ if ((*func_ptr = dlsym(RTLD_NEXT, func_name)) == NULL) {
+ fprintf(stderr, "vmware-console.so: unable to resolve function
\"%s\"\n", func_name);
+ abort();
+ }
+ }
+
+ /* adjust path */
+ path_adjust(func_name, buf, buflen, path);
+
+ /* execute original function */
+ rv = (*func_ptr)(buf, mode);
+
+ /* pass-through return value */
+ return rv;
+}
+
+#define genstub_access(name) \
+int name(const char *path, int mode) \
+{ \
+ static int (*func)(const char *, int mode) = NULL; \
+ char path_adjusted[PATH_ADJUST_MAXLEN]; \
+ int rv; \
+\
+ rv = myaccess(#name, &func, path_adjusted, sizeof(path_adjusted), path, mode); \
+ return rv; \
+}
+
+genstub_access(access)
+genstub_access(access64)
+genstub_access(__access)
+genstub_access(__access64)
+genstub_access(__libc_access)
+genstub_access(__libc_access64)
+
+static FILE *
+myfopen(
+ const char *func_name,
+ FILE *(**func_ptr)(const char *, const char *),
+ char *buf,
+ size_t buflen,
+ const char *path,
+ const char *mode)
+{
+ FILE *rv;
+
+ /* initially resolve original fopen(3) like function */
+ if (*func_ptr == NULL) {
+ if ((*func_ptr = dlsym(RTLD_NEXT, func_name)) == NULL) {
+ fprintf(stderr, "vmware-console.so: unable to resolve function
\"%s\"\n", func_name);
+ abort();
+ }
+ }
+
+ /* adjust path */
+ path_adjust(func_name, buf, buflen, path);
+
+ /* execute original function */
+ rv = (*func_ptr)(buf, mode);
+
+ /* pass-through return value */
+ return rv;
+}
+
+#define genstub_fopen(name) \
+FILE *name(const char *path, const char *mode) \
+{ \
+ static FILE *(*func)(const char *, const char *mode) = NULL; \
+ char path_adjusted[PATH_ADJUST_MAXLEN]; \
+ FILE *rv; \
+\
+ rv = myfopen(#name, &func, path_adjusted, sizeof(path_adjusted), path, mode); \
+ return rv; \
+}
+
+genstub_fopen(fopen)
+genstub_fopen(__fopen)
+genstub_fopen(__libc_fopen)
+
+static int
+myxstat(
+ const char *func_name,
+ int (**func_ptr)(int, const char *, struct stat *),
+ char *buf,
+ size_t buflen,
+ int ver, const char *path, struct stat *sb)
+{
+ int rv;
+
+ /* initially resolve original __xstat(2) like function */
+ if (*func_ptr == NULL) {
+ if ((*func_ptr = dlsym(RTLD_NEXT, func_name)) == NULL) {
+ fprintf(stderr, "vmware-console.so: unable to resolve function
\"%s\"\n", func_name);
+ abort();
+ }
+ }
+
+ /* adjust path */
+ path_adjust(func_name, buf, buflen, path);
+
+ /* execute original function */
+ rv = (*func_ptr)(ver, buf, sb);
+
+ /* pass-through return value */
+ return rv;
+}
+
+#define genstub_xstat(name) \
+int name(int ver, const char *path, struct stat *sb) \
+{ \
+ static int (*func)(int, const char *, struct stat *sb) = NULL; \
+ char path_adjusted[PATH_ADJUST_MAXLEN]; \
+ int rv; \
+\
+ rv = myxstat(#name, &func, path_adjusted, sizeof(path_adjusted), ver, path,
sb); \
+ return rv; \
+}
+
+genstub_xstat(xstat)
+genstub_xstat(xstat64)
+genstub_xstat(__xstat)
+genstub_xstat(__xstat64)
+genstub_xstat(__libc_xstat)
+genstub_xstat(__libc_xstat64)
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/vmware-console/vmware-console.mk
============================================================================
$ cvs diff -u -r0 -r1.1 vmware-console.mk
--- /dev/null 2003-12-26 10:47:56.000000000 +0100
+++ vmware-console.mk 2003-12-26 10:47:56.000000000 +0100
@@ -0,0 +1,19 @@
+
+CC = gcc
+CPPFLAGS =
+CFLAGS = -Wall -fpic
+LD = gcc
+LDFLAGS = -shared
+LIBS = -ldl
+
+all: vmware-console.so
+
+vmware-console.o: vmware-console.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c -o vmware-console.o vmware-console.c
+
+vmware-console.so: vmware-console.o
+ $(LD) $(LDFLAGS) -o vmware-console.so vmware-console.o $(LIBS)
+
+clean:
+ rm -f vmware-console.so vmware-console.o
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/vmware-console/vmware-console.sh
============================================================================
$ cvs diff -u -r0 -r1.1 vmware-console.sh
--- /dev/null 2003-12-26 10:47:56.000000000 +0100
+++ vmware-console.sh 2003-12-26 10:47:56.000000000 +0100
@@ -0,0 +1,16 @@
+#!/bin/sh
+##
+## vmware-console -- VMWare GSX Server Remote Console binary wrapper
+##
+
+# force path to VMWare config file
+VMWARE_CONSOLE_CONFIG="@l_prefix@/etc/vmware-console/config"
+export VMWARE_CONSOLE_CONFIG
+
+# force DSO to be pre-loaded
+LD_PRELOAD="@l_prefix@/lib/vmware-console/bin/vmware-console.so"
+export LD_PRELOAD
+
+# execute original executable
+exec @l_prefix@/lib/vmware-console/bin/vmware-console ${1+"$@"}
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/vmware-console/vmware-console.spec
============================================================================
$ cvs diff -u -r0 -r1.1 vmware-console.spec
--- /dev/null 2003-12-26 10:47:56.000000000 +0100
+++ vmware-console.spec 2003-12-26 10:47:56.000000000 +0100
@@ -0,0 +1,125 @@
+##
+## vmware-console.spec -- OpenPKG RPM Specification
+## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
+## Copyright (c) 2000-2003 Ralf S. Engelschall <[EMAIL PROTECTED]>
+## Copyright (c) 2000-2003 Cable & Wireless <http://www.cw.com/>
+##
+## Permission to use, copy, modify, and distribute this software for
+## any purpose with or without fee is hereby granted, provided that
+## the above copyright notice and this permission notice appear in all
+## copies.
+##
+## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+## SUCH DAMAGE.
+##
+
+# package version
+%define V_version 2.5.1
+%define V_built 6192
+
+# package information
+Name: vmware-console
+Summary: VMWare GSX/ESX Remote Console
+URL: http://www.vmware.com/
+Vendor: VMWare, Inc.
+Packager: The OpenPKG Project
+Distribution: OpenPKG [EVAL]
+Group: System
+License: Commercial
+Version: %{V_version}.%{V_built}
+Release: 20031226
+
+# list of sources
+Source0: http://www.vmware.com/::/VMware-console-%{V_version}-%{V_built}.tar.gz
+Source1: vmware-console.sh
+Source2: vmware-console.mk
+Source3: vmware-console.c
+Source4: vmware-console.so
+%NoSource 0
+
+# build information
+Prefix: %{l_prefix}
+BuildRoot: %{l_buildroot}
+BuildPreReq: OpenPKG, openpkg >= 20030103, perl
+PreReq: OpenPKG, openpkg >= 20030103, X11
+AutoReq: no
+AutoReqProv: no
+
+%description
+ This is the Linux/X11 based remote console for VMWare GSX/ESX Server
+ virtual machines. It can be used under Linux/ix86 and FreeBSD/ix86.
+
+%prep
+ %setup -q -n vmware-console-distrib
+ # rpmlint workarounds: %{SOURCE vmware-console.mk} %{SOURCE vmware-console.c}
+
+%build
+ # check for suppirted platforms
+ case "%{l_platform -t}" in
+ i?86-freebsd* ) target="freebsd" ;;
+ i?86-linux* ) target="linux" ;;
+ * ) echo "Platform \"%{l_platform -t}\" not supported"; exit 1 ;;
+ esac
+
+%install
+ # execute VMWare standard installer
+ rm -rf $RPM_BUILD_ROOT
+ %{l_shtool} subst -v \
+ -e 's;$> == 0;1;' \
+ -e
"s;/etc/services;$RPM_BUILD_ROOT%{l_prefix}/etc/vmware-console/services;g" \
+ -e "s;/etc/vmware-api;$RPM_BUILD_ROOT%{l_prefix}/etc/vmware-console;g" \
+ -e "s;/etc/vmware-console;$RPM_BUILD_ROOT%{l_prefix}/etc/vmware-console;g" \
+ -e
"s;/etc/vmware\\([^-]\\);$RPM_BUILD_ROOT%{l_prefix}/etc/vmware-console\\1;g" \
+ bin/vmware-uninstall-console.pl
+ %{l_shtool} mkdir -f -p -m 755 \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/vmware-console
+ export PAGER=cat
+ ( echo ""; echo "yes"
+ echo "$RPM_BUILD_ROOT%{l_prefix}/bin"; echo "yes"
+ echo ""; echo "yes"
+ echo ""; echo "yes"
+ echo ""; echo "yes"
+ echo ""
+ ) | %{l_prefix}/bin/perl vmware-install.pl
+
+ # post-adjust installation files
+ %{l_gzip} -d $RPM_BUILD_ROOT%{l_prefix}/man/man1/vmware-console.1.gz
+ %{l_shtool} subst \
+ -e "s;$RPM_BUILD_ROOT%{l_prefix};%{l_prefix};g" \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/vmware-console/config \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/vmware-console/locations
+
+ # strip down installation
+ rm -rf $RPM_BUILD_ROOT%{l_prefix}/doc
+ rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/vmware-console/perl
+ rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/vmware-console/installer.sh
+ rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/vmware-uninstall-console.pl
+
+ # install open(2) wrapper
+ mv $RPM_BUILD_ROOT%{l_prefix}/bin/vmware-console \
+ $RPM_BUILD_ROOT%{l_prefix}/lib/vmware-console/bin/vmware-console
+ %{l_shtool} install -c -m 755 %{l_value -s -a} \
+ %{SOURCE vmware-console.sh} \
+ $RPM_BUILD_ROOT%{l_prefix}/bin/vmware-console
+ %{l_shtool} install -c -m 755 \
+ %{SOURCE vmware-console.so} \
+ $RPM_BUILD_ROOT%{l_prefix}/lib/vmware-console/bin/vmware-console.so
+
+ # determine installation files
+ %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
+
+%files -f files
+
+%clean
+ rm -rf $RPM_BUILD_ROOT
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-web/news.txt
============================================================================
$ cvs diff -u -r1.7891 -r1.7892 news.txt
--- openpkg-web/news.txt 26 Dec 2003 07:58:48 -0000 1.7891
+++ openpkg-web/news.txt 26 Dec 2003 09:47:53 -0000 1.7892
@@ -1,3 +1,4 @@
+26-Dec-2003: New package: P<vmware-console-2.5.1.6192-20031226>
26-Dec-2003: Upgraded package: P<postgresql-7.4-20031226>
26-Dec-2003: Upgraded package: P<libxml-2.6.4-20031226>
26-Dec-2003: Upgraded package: P<gd-2.0.17-20031226>
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]