Subject: pkg/5868: VNC doesn't work on alpha, plus v3.3.2 is out
To: None <gnats-bugs@gnats.netbsd.org>
From: J Rizzo <riz@boogers.sf.ca.us>
List: netbsd-bugs
Date: 07/28/1998 16:55:05
>Number:         5868
>Category:       pkg
>Synopsis:       VNC doesn't work on alpha, plus new version (3.3.2) is out
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          support
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 28 17:05:01 1998
>Last-Modified:
>Originator:     
>Organization:
Jeff Rizzo                                         http://boogers.sf.ca.us/~riz
>Release:        pkgsrc as of 28July1998
>Environment:
	
System: NetBSD fnord.boogers.sf.ca.us 1.3.1 NetBSD 1.3.1 (GENERIC) #0: Tue Mar 17 21:30:30 PST 1998 riz@fnord.boogers.sf.ca.us:/work/tmp/netbsd-1.3.1/sys/arch/alpha/compile/GENERIC alpha


>Description:

The vnc package (/usr/pkgsrc/net/vnc) does not compile/work on Alpha; the
3.3.1 source used for the current package is very messy, so I used the 
cleaned up 3.3.2 VNC source as a baseline to repackage.  

>How-To-Repeat:

	Attempt to compile -current VNC package on netbsd-alpha

>Fix:

Apply the following patch in /usr/pkgsrc/net to update the version of VNC 
to 3.3.2.  Tested on alpha and i386.

--
*** vnc/files/md5.orig	Wed Jun 10 04:31:03 1998
--- vnc/files/md5	Tue Jul 28 16:22:11 1998
***************
*** 1,2 ****
! MD5 (vnc-3.3.1_unixsrc.tgz) = IGNORE
! MD5 (vnc-3.3.1_doc.tgz) = IGNORE
--- 1,2 ----
! MD5 (vnc-3.3.2r2_unixsrc.tgz) = IGNORE
! MD5 (vnc-3.3.2_doc.tgz) = IGNORE
*** vnc/patches/patch-aa.orig	Wed Jun 10 04:31:05 1998
--- vnc/patches/patch-aa	Tue Jul 28 16:22:59 1998
***************
*** 1,561 ****
! diff -ruN ../old/Imakefile ./Imakefile
! --- ../old/Imakefile	Thu Jan 22 12:18:18 1998
! +++ ./Imakefile	Tue Feb 24 22:30:41 1998
! @@ -12,5 +12,5 @@
!  DependSubdirs($(SUBDIRS))
!  
!  all::
! -	(set -e; cd Xvnc; unset MAKEFLAGS MAKELEVEL; \
! +	(set +e; unset MAKEFLAGS MAKELEVEL; set -e; cd Xvnc; \
!  	 ./vncxmkmf; make Makefiles; make depend; make all )
! diff -ruN ../old/Xvnc/config/FreeBSD.cf ./Xvnc/config/FreeBSD.cf
! --- ../old/Xvnc/config/FreeBSD.cf	Wed Dec 31 16:00:00 1969
! +++ ./Xvnc/config/FreeBSD.cf	Tue Feb 24 23:42:33 1998
! @@ -0,0 +1,100 @@
! +XCOMM platform:  $XConsortium: FreeBSD.cf /main/10 1996/01/22 17:35:30 gildea $
! +
! +#ifndef OSName
! +#define OSName			FreeBSD 2.1
! +#endif
! +#ifndef OSVendor
! +#define OSVendor		Walnut Creek CD-ROM
! +#endif
! +XCOMM operating system:  OSName
! +#ifndef OSMajorVersion
! +#define OSMajorVersion		2
! +#endif
! +#ifndef OSMinorVersion
! +#define OSMinorVersion		1
! +#endif
! +#ifndef OSTeenyVersion
! +#define OSTeenyVersion		0
! +#endif
! +
! +#define HasPutenv		YES
! +#define HasBSD44Sockets	 YES
! +
! +#define CppCmd			/usr/libexec/cpp -traditional
! +#define PreProcessCmd		/usr/libexec/cpp -traditional
! +#undef  InstallCmd
! +#define InstallCmd		/usr/bin/install
! +
! +#define UseGas			YES
! +#ifndef GccUsesGas
! +# define GccUsesGas		YES
! +#endif
! +
! +#ifndef AsmDefines
! +#  define AsmDefines		-DUSE_GAS
! +#endif
! +
! +#if GccUsesGas
! +# define GccGasOption		-DGCCUSESGAS
! +#else
! +# define GccGasOption		/**/
! +#endif
! +
! +#ifndef HasGcc2
! +# define HasGcc2		YES
! +#endif
! +
! +#define MkdirHierCmd		mkdir -p
! +
! +#define CcCmd gcc
! +#ifndef DefaultCCOptions
! +#define DefaultCCOptions	-pipe
! +#endif
! +
! +#ifdef i386Architecture
! +#define OptimizedCDebugFlags	-m486 -O2 -fno-strength-reduce
! +#else
! +#define OptimizedCDebugFlags	-O2
! +#endif
! +
! +#if OSMajorVersion > 1
! +#define ServerOSDefines		XFree86ServerOSDefines
! +#define XawI18nDefines		-DUSE_XWCHAR_STRING
! +#define HasMakefileSafeInclude	YES
! +#define IncludeMakefile(file)	@@# dependencies are in .depend
! +#define DependFileName		.depend
! +#ifndef ExtraLibraries
! +#define ExtraLibraries		-lz
! +#endif
! +#else
! +#define ServerOSDefines		XFree86ServerOSDefines -DDDXTIME -DXNO_SYSCONF
! +#define XawI18nDefines		-DUSE_XWCHAR_STRING -DUSE_XMBTOWC
! +#ifndef ExtraLibraries
! +#define ExtraLibraries		/* -lmalloc */
! +#endif
! +#endif
! +
! +#define ServerExtraDefines	GccGasOption XFree86ServerDefines
! +
! +#define StandardDefines		-DCSRG_BASED
! +
! +#define TroffCmd		groff -Tps
! +#define SetTtyGroup		YES
! +#define HasNdbm			YES
! +#define HasShm			YES
! +#define HasWChar32		YES
! +
! +#define HasLibCrypt		YES
! +
! +#define AvoidNullMakeCommand	YES
! +
! +#define BuildServer		YES
! +#define XF86SVGAServer		NO
! +#define XvncServer		YES
! +#define ProjectRoot		/usr/X11R6
! +
! +#include <bsdLib.rules>
! +
! +#ifdef i386Architecture
! +#include <xfree86.cf>
! +#endif
! diff -ruN ../old/Xvnc/config/bsdLib.rules ./Xvnc/config/bsdLib.rules
! --- ../old/Xvnc/config/bsdLib.rules	Wed Dec 31 16:00:00 1969
! +++ ./Xvnc/config/bsdLib.rules	Tue Feb 24 22:30:41 1998
! @@ -0,0 +1,93 @@
! +XCOMM $XConsortium: bsdLib.rules /main/2 1996/01/24 06:38:15 kaleb $
! +
! +/*
! + * NetBSD/FreeBSD shared library rules
! + */
! +
! +#ifndef HasSharedLibraries
! +#define HasSharedLibraries YES
! +#endif
! +#ifndef SharedDataSeparation
! +#define SharedDataSeparation NO
! +#endif
! +#ifndef SharedCodeDef
! +#define SharedCodeDef
! +#endif
! +#ifndef SharedLibraryDef
! +#define SharedLibraryDef -DBSDSHLIB
! +#endif
! +#ifndef ShLibIncludeFile
! +#define ShLibIncludeFile <bsdLib.tmpl>
! +#endif
! +#ifndef SharedLibraryLoadFlags
! +#define SharedLibraryLoadFlags -Bshareable
! +#endif
! +#ifndef PositionIndependentCFlags
! +#define PositionIndependentCFlags -fpic
! +#endif
! +
! +/*
! + * InstallSharedLibrary - generate rules to install the shared library.
! + */
! +#ifndef InstallSharedLibrary
! +#define InstallSharedLibrary(libname,rev,dest)				@@\
! +install:: Concat(lib,libname.so.rev)					@@\
! +	MakeDir($(DESTDIR)dest)						@@\
! +	$(INSTALL) -c $(INSTLIBFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest 
! +@@\
! +
! +#endif /* InstallSharedLibrary */
! +
! +/*
! + * NormalSharedLibraryTarget - generate rules to create a shared library;
! + * build it into a different name so that the we do not hose people by having
! + * the library gone for long periods.
! + */
! +#ifndef SharedLibraryTarget
! +#define SharedLibraryTarget(libname,rev,solist,down,up)			@@\
! +AllTarget(Concat(lib,libname.so.rev))					@@\
! +									@@\
! +Concat(lib,libname.so.rev):  solist					@@\
! +	$(RM) $@~							@@\
! +	(cd down; $(LD) -o up/$@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS)) @@\
! +	$(RM) $@							@@\
! +	$(MV) $@~ $@							@@\
! +	LinkBuildLibrary($@)						@@\
! +									@@\
! +clean::									@@\
! +	$(RM) Concat(lib,libname.so.rev)
! +
! +#endif /* SharedLibraryTarget */
! +
! +/*
! + * SharedLibraryDataTarget - generate rules to create shlib data file;
! + */
! +#ifndef SharedLibraryDataTarget
! +#define SharedLibraryDataTarget(libname,rev,salist)
! +#endif /* SharedLibraryDataTarget */
! +
! +#ifndef InstallSharedLibraryData
! +#define InstallSharedLibraryData(libname,rev,dest)
! +#endif /* InstallSharedLibraryData */
! +
! +/*
! + * SharedLibReferences - variables for shared libraries
! + */
! +#ifndef SharedLibReferences
! +#define SharedLibReferences(varname,libname,libsource,revname,rev)	@@\
! +revname = rev								@@\
! +Concat3(DEP,varname,LIB) = SharedLibDependencies(libname,libsource,revname) @@\
! +Concat(varname,LIB) = LoaderLibPrefix Concat(-l,libname)		@@\
! +LintLibReferences(varname,libname,libsource)
! +#endif
! +
! +/*
! + * SharedDSLibReferences - variables for shared libraries
! + */
! +#ifndef SharedDSLibReferences
! +#define SharedDSLibReferences(varname,libname,libsource,revname,rev)	@@\
! +revname = rev								@@\
! +Concat3(DEP,varname,LIB) = SharedDSLibDependencies(libname,libsource,revname) @@\
! +Concat(varname,LIB) = LoaderLibPrefix Concat(-l,libname) Concat3(Shared,libname,Reqs)		@@\
! +LintLibReferences(varname,libname,libsource)
! +#endif
! diff -ruN ../old/Xvnc/config/bsdLib.tmpl ./Xvnc/config/bsdLib.tmpl
! --- ../old/Xvnc/config/bsdLib.tmpl	Wed Dec 31 16:00:00 1969
! +++ ./Xvnc/config/bsdLib.tmpl	Tue Feb 24 22:30:41 1998
! @@ -0,0 +1,15 @@
! +XCOMM $XConsortium: bsdLib.tmpl,v 1.2 95/01/23 19:07:12 kaleb Exp $
! +
! +/*
! + * NetBSD/FreeBSD shared library template
! + */
! +
! +#ifndef SharedXtReqs
! +#define SharedXtReqs /**/
! +#endif
! +#ifndef SharedXawReqs
! +#define SharedXawReqs /**/
! +#endif
! +#ifndef SharedXmuReqs
! +#define SharedXmuReqs $(LDPRELIB) $(XTOOLONLYLIB) $(XONLYLIB)
! +#endif
! diff -ruN ../old/Xvnc/lib/font/bitmap/bitmapfunc.c ./Xvnc/lib/font/bitmap/bitmapfunc.c
! --- ../old/Xvnc/lib/font/bitmap/bitmapfunc.c	Tue Jan 20 04:38:40 1998
! +++ ./Xvnc/lib/font/bitmap/bitmapfunc.c	Tue Feb 24 23:15:16 1998
! @@ -53,8 +53,11 @@
!  static BitmapFileFunctionsRec readers[] = {
!      pcfReadFont, pcfReadFontInfo,
!      pcfReadFont, pcfReadFontInfo,
! +    pcfReadFont, pcfReadFontInfo,
!      snfReadFont, snfReadFontInfo,
!      snfReadFont, snfReadFontInfo,
! +    snfReadFont, snfReadFontInfo,
! +    bdfReadFont, bdfReadFontInfo,
!      bdfReadFont, bdfReadFontInfo,
!      bdfReadFont, bdfReadFontInfo,
!  };
! @@ -71,6 +74,10 @@
!      BitmapOpenBitmap, BitmapOpenScalable,
!  	BitmapGetInfoBitmap, BitmapGetInfoScalable, 0,
!  	CAPABILITIES,
! +    ".pcf.gz", 7,
! +    BitmapOpenBitmap, BitmapOpenScalable,
! +	BitmapGetInfoBitmap, BitmapGetInfoScalable, 0,
! +	CAPABILITIES,
!      ".snf", 4,
!      BitmapOpenBitmap, BitmapOpenScalable,
!  	BitmapGetInfoBitmap, BitmapGetInfoScalable, 0,
! @@ -79,11 +86,19 @@
!      BitmapOpenBitmap, BitmapOpenScalable,
!  	BitmapGetInfoBitmap, BitmapGetInfoScalable, 0,
!  	CAPABILITIES,
! +    ".snf.gz", 7,
! +    BitmapOpenBitmap, BitmapOpenScalable,
! +	BitmapGetInfoBitmap, BitmapGetInfoScalable, 0,
! +	CAPABILITIES,
!      ".bdf", 4,
!      BitmapOpenBitmap, BitmapOpenScalable,
!  	BitmapGetInfoBitmap, BitmapGetInfoScalable, 0,
!  	CAPABILITIES,
!      ".bdf.Z", 6,
! +    BitmapOpenBitmap, BitmapOpenScalable,
! +	BitmapGetInfoBitmap, BitmapGetInfoScalable, 0,
! +	CAPABILITIES,
! +    ".bdf.gz", 7,
!      BitmapOpenBitmap, BitmapOpenScalable,
!  	BitmapGetInfoBitmap, BitmapGetInfoScalable, 0,
!  	CAPABILITIES,
! diff -ruN ../old/Xvnc/lib/font/fontfile/Imakefile ./Xvnc/lib/font/fontfile/Imakefile
! --- ../old/Xvnc/lib/font/fontfile/Imakefile	Tue Jan 20 04:38:42 1998
! +++ ./Xvnc/lib/font/fontfile/Imakefile	Tue Feb 24 23:27:48 1998
! @@ -8,10 +8,10 @@
!  #endif
!              SRCS = dirfile.c fontdir.c fontfile.c fileio.c fontscale.c \
!  	    	   defaults.c bitsource.c register.c renderers.c \
! -		   bufio.c decompress.c filewr.c
! +		   bufio.c decompress.c filewr.c gunzip.c
!              OBJS = dirfile.o fontdir.o fontfile.o fileio.o fontscale.o \
!  	    	   defaults.o bitsource.o register.o renderers.o \
! -		   bufio.o decompress.o filewr.o
! +		   bufio.o decompress.o filewr.o gunzip.o
!  
!  SubdirLibraryRule($(OBJS))
!  NormalLibraryObjectRule()
! diff -ruN ../old/Xvnc/lib/font/fontfile/fileio.c ./Xvnc/lib/font/fontfile/fileio.c
! --- ../old/Xvnc/lib/font/fontfile/fileio.c	Tue Jan 20 04:38:42 1998
! +++ ./Xvnc/lib/font/fontfile/fileio.c	Wed Feb 25 13:09:47 1998
! @@ -62,6 +62,13 @@
!  	    return 0;
!  	}
!  	raw = cooked;
! +    } else if (len > 3 && !strcmp(name + len - 3, ".gz")) {
! +	cooked = BufFilePushZIP (raw);
! +	if (!cooked) {
! +	    BufFileClose (raw, TRUE);
! +	    return 0;
! +	}
! +	raw = cooked;
!      }
!      return (FontFilePtr) raw;
!  }
! diff -ruN ../old/Xvnc/lib/font/fontfile/gunzip.c ./Xvnc/lib/font/fontfile/gunzip.c
! --- ../old/Xvnc/lib/font/fontfile/gunzip.c	Wed Dec 31 16:00:00 1969
! +++ ./Xvnc/lib/font/fontfile/gunzip.c	Tue Feb 24 23:12:36 1998
! @@ -0,0 +1,224 @@
! +/* $XConsortium: gunzip.c /main/1 1996/11/03 19:33:23 kaleb $ */
! +/* lib/font/fontfile/gunzip.c
! +   written by Mark Eichin <eichin@kitten.gen.ma.us> September 1996.
! +   intended for inclusion in X11 public releases. */
! +
! +#include "fontmisc.h"
! +#include <bufio.h>
! +#include <zlib.h>
! +
! +typedef struct _xzip_buf {
! +  z_stream z;
! +  int zstat;
! +  BufChar b[BUFFILESIZE];
! +  BufChar b_in[BUFFILESIZE];
! +  BufFilePtr f;
! +} xzip_buf;
! +
! +static int BufZipFileSkip();	/* f, count */
! +static int BufZipFileFill();	/* read: f;  write: char, f */
! +static int BufZipFileClose();	/* f, flag */
! +static int BufCheckZipHeader();	/* f */
! +
! +BufFilePtr
! +BufFilePushZIP (f)
! +    BufFilePtr	f;
! +{
! +  xzip_buf *x;
! +
! +  x = (xzip_buf *) xalloc (sizeof (xzip_buf));
! +  if (!x) return 0;
! +  /* these are just for raw calloc/free */
! +  x->z.zalloc = Z_NULL;
! +  x->z.zfree = Z_NULL;
! +  x->z.opaque = Z_NULL;
! +  x->f = f;
! +
! +  /* force inflateInit to allocate it's own history buffer */
! +  x->z.next_in = Z_NULL;
! +  x->z.next_out = Z_NULL;
! +  x->z.avail_in = x->z.avail_out = 0;
! +
! +  /* using negative windowBits sets "nowrap" mode, which turns off
! +     zlib header checking [undocumented, for gzip compatibility only?] */
! +  x->zstat = inflateInit2(&(x->z), -MAX_WBITS);
! +  if (x->zstat != Z_OK) {
! +    xfree(x);
! +    return 0;
! +  }
! +
! +  /* now that the history buffer is allocated, we provide the data buffer */
! +  x->z.next_out = x->b;
! +  x->z.avail_out = BUFFILESIZE;
! +  x->z.next_out = x->b_in;
! +  x->z.avail_in = 0;
! +
! +  if (BufCheckZipHeader(x->f)) {
! +    xfree(x);
! +    return 0;
! +  }
! +
! +  return BufFileCreate(x,
! +		       BufZipFileFill,
! +		       BufZipFileSkip,
! +		       BufZipFileClose);
! +}
! +
! +static int BufZipFileClose(f, flag)
! +     BufFilePtr f;
! +     int flag;
! +{
! +  xzip_buf *x = (xzip_buf *)f->private;
! +  inflateEnd (&(x->z));
! +  BufFileClose (x->f, flag);
! +  xfree (x);
! +  return 1;
! +}
! +
! +/* here's the real work. 
! +   -- we need to put stuff in f.buffer, update f.left and f.bufp,
! +      then return the first byte (or BUFFILEEOF).
! +   -- to do this, we need to get stuff into avail_in, and next_in, 
! +      and call inflate appropriately.
! +   -- we may also need to add CRC maintenance - if inflate tells us
! +      Z_STREAM_END, we then have 4bytes CRC and 4bytes length...
! +   gzio.c:gzread shows most of the mechanism.
! +   */
! +static int BufZipFileFill (f)
! +    BufFilePtr	    f;
! +{
! +  xzip_buf *x = (xzip_buf *)f->private;
! +
! +  /* we only get called when left == 0... */
! +  /* but just in case, deal */
! +  if (f->left >= 0) {
! +    f->left--;
! +    return *(f->bufp++);
! +  }
! +  /* did we run out last time? */
! +  switch (x->zstat) {
! +  case Z_OK:
! +    break;
! +  case Z_STREAM_END:
! +  case Z_DATA_ERROR:
! +  case Z_ERRNO:
! +    return BUFFILEEOF;
! +  default:
! +    return BUFFILEEOF;
! +  }
! +  /* now we work to consume what we can */
! +  /* let zlib know what we can handle */
! +  x->z.next_out = x->b;
! +  x->z.avail_out = BUFFILESIZE;
! +
! +  /* and try to consume all of it */
! +  while (x->z.avail_out > 0) {
! +    /* if we don't have anything to work from... */
! +    if (x->z.avail_in == 0) {
! +      /* ... fill the z buf from underlying file */
! +      int i, c;
! +      for (i = 0; i < sizeof(x->b_in); i++) {
! +	c = BufFileGet(x->f);
! +	if (c == BUFFILEEOF) break;
! +	x->b_in[i] = c;
! +      }
! +      x->z.avail_in += i;
! +      x->z.next_in = x->b_in;
! +    }
! +    /* so now we have some output space and some input data */
! +    x->zstat = inflate(&(x->z), Z_NO_FLUSH);
! +    /* the inflation output happens in the f buffer directly... */
! +    if (x->zstat == Z_STREAM_END) {
! +      /* deal with EOF, crc */
! +      break;
! +    }
! +    if (x->zstat != Z_OK) {
! +      break;
! +    }
! +  }
! +  f->bufp = x->b;
! +  f->left = BUFFILESIZE - x->z.avail_out;  
! +
! +  if (f->left >= 0) {
! +    f->left--;
! +    return *(f->bufp++);
! +  } else {
! +    return BUFFILEEOF;
! +  }
! +}
! +
! +/* there should be a BufCommonSkip... */
! +static int BufZipFileSkip (f, c)
! +     BufFilePtr	f;
! +     int c;
! +{
! +  /* BufFileRawSkip returns the count unchanged.
! +     BufCompressedSkip returns 0.
! +     That means it probably never gets called... */
! +  int retval = c;
! +  while(c--) {
! +    int get = BufFileGet(f);
! +    if (get == BUFFILEEOF) return get;
! +  }
! +  return retval;
! +}
! +
! +/* now we need to duplicate check_header */
! +/* contents:
! +     0x1f, 0x8b	-- magic number
! +     1 byte	-- method (Z_DEFLATED)
! +     1 byte	-- flags (mask with RESERVED -> fail)
! +     4 byte	-- time (discard)
! +     1 byte	-- xflags (discard)
! +     1 byte	-- "os" code (discard)
! +     [if flags & EXTRA_FIELD:
! +         2 bytes -- LSBfirst length n
! +	 n bytes -- extra data (discard)]
! +     [if flags & ORIG_NAME:
! +	 n bytes -- null terminated name (discard)]
! +     [if flags & COMMENT:
! +	 n bytes -- null terminated comment (discard)]
! +     [if flags & HEAD_CRC:
! +         2 bytes -- crc of headers? (discard)]
! + */
! +
! +/* gzip flag byte -- from gzio.c */
! +#define ASCII_FLAG   0x01 /* bit 0 set: file probably ascii text */
! +#define HEAD_CRC     0x02 /* bit 1 set: header CRC present */
! +#define EXTRA_FIELD  0x04 /* bit 2 set: extra field present */
! +#define ORIG_NAME    0x08 /* bit 3 set: original file name present */
! +#define COMMENT      0x10 /* bit 4 set: file comment present */
! +#define RESERVED     0xE0 /* bits 5..7: reserved */
! +
! +#define GET(f) do {c = BufFileGet(f); if (c == BUFFILEEOF) return c;} while(0)
! +static int BufCheckZipHeader(f)
! +     BufFilePtr f;
! +{
! +  int c, flags;
! +  GET(f); if (c != 0x1f) return 1; /* magic 1 */
! +  GET(f); if (c != 0x8b) return 2; /* magic 2 */
! +  GET(f); if (c != Z_DEFLATED) return 3; /* method */
! +  GET(f); if (c & RESERVED) return 4; /* reserved flags */
! +  flags = c;
! +  GET(f); GET(f); GET(f); GET(f); /* time */
! +  GET(f);			/* xflags */
! +  GET(f);			/* os code */
! +  if (flags & EXTRA_FIELD) {
! +    int len;
! +    GET(f); len = c;
! +    GET(f); len += (c<<8);
! +    while (len-- >= 0) {
! +      GET(f);
! +    }
! +  }
! +  if (flags & ORIG_NAME) {
! +    do { GET(f); } while (c != 0);
! +  }
! +  if (flags & COMMENT) {
! +    do { GET(f); } while (c != 0);
! +  }
! +  if (flags & HEAD_CRC) {
! +    GET(f); GET(f);		/* header crc */
! +  }
! +  return 0;
! +}
! diff -ruN ../old/Xvnc/lib/font/include/bufio.h ./Xvnc/lib/font/include/bufio.h
! --- ../old/Xvnc/lib/font/include/bufio.h	Tue Jan 20 04:38:42 1998
! +++ ./Xvnc/lib/font/include/bufio.h	Tue Feb 24 23:16:12 1998
! @@ -55,6 +55,7 @@
!  extern BufFilePtr   BufFileCreate ();
!  extern BufFilePtr   BufFileOpenRead (), BufFileOpenWrite ();
!  extern BufFilePtr   BufFilePushCompressed ();
! +extern BufFilePtr   BufFilePushZip ();
!  extern int	    BufFileClose ();
!  extern int	    BufFileFlush ();
!  #define BufFileGet(f)	((f)->left-- ? *(f)->bufp++ : (*(f)->io) (f))
! diff -ruN ../old/Xvnc/programs/Xserver/hw/vnc/auth.c ./Xvnc/programs/Xserver/hw/vnc/auth.c
! --- ../old/Xvnc/programs/Xserver/hw/vnc/auth.c	Wed Jan 21 10:12:44 1998
! +++ ./Xvnc/programs/Xserver/hw/vnc/auth.c	Tue Feb 24 22:30:41 1998
! @@ -24,6 +24,9 @@
!   *  USA.
!   */
!  
! +#ifdef __FreeBSD__
! +# include <sys/types.h>
! +#endif
!  #include <stdio.h>
!  #include <stdlib.h>
!  #include <netinet/in.h>
--- 1,15 ----
! *** Xvnc/config/cf/NetBSD.cf.orig	Tue Jul 28 14:19:10 1998
! --- Xvnc/config/cf/NetBSD.cf	Tue Jul 28 12:45:19 1998
! ***************
! *** 373,377 ****
!    * Definition for compiling on Alpha machines
!    */
!   #ifdef AlphaArchitecture
! ! #define	BuildServer	NO
!   #endif
! --- 373,377 ----
!    * Definition for compiling on Alpha machines
!    */
!   #ifdef AlphaArchitecture
! ! #define	BuildServer	YES
!   #endif
*** vnc/patches/patch-ab.orig	Wed Jun 10 04:31:05 1998
--- vnc/patches/patch-ab	Tue Jul 28 16:22:59 1998
***************
*** 1,115 ****
! --- /dev/null	Fri Jun  5 15:30:38 1998
! +++ Xvnc/config/NetBSD.cf	Fri Jun  5 15:36:14 1998
! @@ -0,0 +1,101 @@
! +XCOMM platform:  $XFree86: xc/config/cf/NetBSD.cf,v 3.49.2.9 1997/07/26 06:30:39 dawes Exp $
! +
! +#ifndef OSName
! +#define OSName		NetBSD 1.3
! +#endif
! +#ifndef OSVendor
! +#define	OSVendor	The NetBSD Foundation, Inc.
! +#endif
! +#ifndef OSMajorVersion
! +#define OSMajorVersion		1
! +#endif
! +#ifndef OSMinorVersion
! +#define OSMinorVersion		3
! +#endif
! +#ifndef OSTeenyVersion
! +#define OSTeenyVersion		0
! +#endif
! +
! +XCOMM operating system:  OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion)
! +
! +#define HasPutenv		YES
! +#define HasBSD44Sockets	 YES
! +
! +#define CppCmd			/usr/libexec/cpp -traditional
! +#define PreProcessCmd		/usr/libexec/cpp -traditional
! +#undef  InstallCmd
! +#define InstallCmd		/usr/bin/install
! +
! +#define UseGas			YES
! +#ifndef GccUsesGas
! +# define GccUsesGas		YES
! +#endif
! +
! +#ifndef AsmDefines
! +#  define AsmDefines		-DUSE_GAS
! +#endif
! +
! +#if GccUsesGas
! +# define GccGasOption		-DGCCUSESGAS
! +#else
! +# define GccGasOption		/**/
! +#endif
! +
! +#ifndef HasGcc2
! +# define HasGcc2		YES
! +#endif
! +
! +#define MkdirHierCmd		mkdir -p
! +
! +#define CcCmd gcc
! +#ifndef DefaultCCOptions
! +#define DefaultCCOptions	-pipe
! +#endif
! +
! +#ifdef i386Architecture
! +#define OptimizedCDebugFlags	-m486 -O2 -fno-strength-reduce
! +#else
! +#define OptimizedCDebugFlags	-O2
! +#endif
! +
! +#if OSMajorVersion >= 1
! +#define ServerOSDefines		XFree86ServerOSDefines
! +#define XawI18nDefines		-DUSE_XWCHAR_STRING
! +#define HasMakefileSafeInclude	YES
! +#define IncludeMakefile(file)	@@# dependencies are in .depend
! +#define DependFileName		.depend
! +#ifndef ExtraLibraries
! +#define ExtraLibraries		-lz
! +#endif
! +#else
! +#define ServerOSDefines		XFree86ServerOSDefines -DDDXTIME -DXNO_SYSCONF
! +#define XawI18nDefines		-DUSE_XWCHAR_STRING -DUSE_XMBTOWC
! +#ifndef ExtraLibraries
! +#define ExtraLibraries		/**/
! +#endif
! +#endif
! +
! +#define ServerExtraDefines	GccGasOption XFree86ServerDefines
! +
! +#define StandardDefines		-DCSRG_BASED
! +
! +#define TroffCmd		groff -Tps
! +#define SetTtyGroup		YES
! +#define HasNdbm			YES
! +#define HasShm			YES
! +#define HasWChar32		YES
! +
! +#define HasLibCrypt		YES
! +
! +#define AvoidNullMakeCommand	YES
! +
! +#define BuildServer		YES
! +#define XF86SVGAServer		NO
! +#define XvncServer		YES
! +#define ProjectRoot		/usr/X11R6
! +
! +#include <bsdLib.rules>
! +
! +#ifdef i386Architecture
! +#include <xfree86.cf>
! +#endif
! --- Xvnc/lib/font/Type1/t1funcs.c	1998/06/05 15:02:02	1.1
! +++ Xvnc/lib/font/Type1/t1funcs.c	1998/06/05 15:02:29
! @@ -84,6 +84,8 @@
!  from the X Consortium.
!  
!  */
! +
! +#include <sys/types.h>
    
!  #include <string.h>
!  #ifdef _XOPEN_SOURCE
--- 1,20 ----
! *** Imakefile.orig	Mon May 18 06:18:46 1998
! --- Imakefile	Tue Jul 28 14:57:53 1998
! ***************
! *** 9,16 ****
!   	make all
!   	@echo ""
!   	@echo Built $(SUBDIRS).
! ! 	@echo 'To build Xvnc, do "cd Xvnc", followed by "make World"'
! ! 	@echo ""
    
!   MakeSubdirs($(SUBDIRS))
!   DependSubdirs($(SUBDIRS))
! --- 9,15 ----
!   	make all
!   	@echo ""
!   	@echo Built $(SUBDIRS).
! ! 	(cd Xvnc && make World)
!   
!   MakeSubdirs($(SUBDIRS))
!   DependSubdirs($(SUBDIRS))
*** /dev/null	Tue Jul 28 16:08:13 1998
--- vnc/patches/patch-ac	Tue Jul 28 16:22:59 1998
***************
*** 0 ****
--- 1,21 ----
+ *** vncserver.orig	Tue Jul 28 16:16:07 1998
+ --- vncserver	Tue Jul 28 16:17:02 1998
+ ***************
+ *** 144,151 ****
+   
+   # Add font path and color database stuff here, e.g.:
+   #
+ ! # $cmd .= " -fp /usr/lib/X11/fonts/misc/,/usr/lib/X11/fonts/75dpi/";
+ ! # $cmd .= " -co /usr/lib/X11/rgb";
+   #
+   
+   foreach $arg (@ARGV) {
+ --- 144,151 ----
+   
+   # Add font path and color database stuff here, e.g.:
+   #
+ ! $cmd .= " -fp /usr/X11R6/lib/X11/fonts/misc/,/usr/lib/X11/fonts/75dpi/";
+ ! $cmd .= " -co /usr/X11R6/lib/X11/rgb";
+   #
+   
+   foreach $arg (@ARGV) {
*** vnc/pkg/PLIST.orig	Wed Jun 10 04:31:07 1998
--- vnc/pkg/PLIST	Tue Jul 28 16:23:28 1998
***************
*** 3,87 ****
  bin/vncviewer
  bin/vncpasswd
  bin/vncserver
! share/doc/vnc/_private/_vti_cnf/sidebar.html
! share/doc/vnc/_private/_vti_cnf/header.html
! share/doc/vnc/_private/_vti_cnf/footer.html
! share/doc/vnc/_private/footer.html
! share/doc/vnc/_private/header.html
! share/doc/vnc/_private/sidebar.html
! share/doc/vnc/_vti_cnf/howitworks.html
! share/doc/vnc/_vti_cnf/gpl.html
! share/doc/vnc/_vti_cnf/free.html
! share/doc/vnc/_vti_cnf/download.htm
! share/doc/vnc/_vti_cnf/docs.html
! share/doc/vnc/_vti_cnf/intouch.html
! share/doc/vnc/_vti_cnf/internalversion.html
! share/doc/vnc/_vti_cnf/index.html
! share/doc/vnc/_vti_cnf/protocol.html
! share/doc/vnc/_vti_cnf/javavncviewer.html
! share/doc/vnc/_vti_cnf/rfbproto.pdf
! share/doc/vnc/_vti_cnf/xvncviewer.html
! share/doc/vnc/_vti_cnf/xvnc.html
! share/doc/vnc/_vti_cnf/winvncviewer.html
! share/doc/vnc/_vti_cnf/winvnc.html
! share/doc/vnc/_vti_cnf/styles.css
! share/doc/vnc/_vti_cnf/start.html
! share/doc/vnc/_vti_cnf/screenshots.html
! share/doc/vnc/_vti_cnf/rfbprotoheader.pdf
! share/doc/vnc/_vti_pvt/diskweb.cnf
! share/doc/vnc/_vti_pvt/frontpg.lck
! share/doc/vnc/_vti_pvt/services.cnf
! share/doc/vnc/_vti_pvt/bots.cnf
! share/doc/vnc/_vti_pvt/botinfs.cnf
! share/doc/vnc/_vti_pvt/service.lck
! share/doc/vnc/_vti_pvt/service.cnf
! share/doc/vnc/_vti_pvt/access.cnf
! share/doc/vnc/_vti_pvt/doctodep.btr
! share/doc/vnc/_vti_pvt/deptodoc.btr
! share/doc/vnc/_vti_pvt/writeto.cnf
! share/doc/vnc/_vti_pvt/linkinfo.cnf
! share/doc/vnc/_vti_pvt/structure.cnf
! share/doc/vnc/_vti_pvt/_vti_cnf/_x_todoh.htm
! share/doc/vnc/_vti_pvt/_vti_cnf/_x_todo.htm
! share/doc/vnc/_vti_pvt/_x_todo.htm
! share/doc/vnc/_vti_pvt/_x_todoh.htm
! share/doc/vnc/docs.html
! share/doc/vnc/download.htm
! share/doc/vnc/free.html
! share/doc/vnc/gpl.html
! share/doc/vnc/howitworks.html
! share/doc/vnc/images/_vti_cnf/clientserver.gif
! share/doc/vnc/images/_vti_cnf/cdplay.gif
! share/doc/vnc/images/_vti_cnf/bluepix.gif
! share/doc/vnc/images/_vti_cnf/badgeshad.gif
! share/doc/vnc/images/_vti_cnf/backbutton.gif
! share/doc/vnc/images/_vti_cnf/collage.gif
! share/doc/vnc/images/_vti_cnf/homebutton.gif
! share/doc/vnc/images/_vti_cnf/freebutton.gif
! share/doc/vnc/images/_vti_cnf/downloadbutton.gif
! share/doc/vnc/images/_vti_cnf/docbutton.gif
! share/doc/vnc/images/_vti_cnf/conndlg.gif
! share/doc/vnc/images/_vti_cnf/collagesmaller.gif
! share/doc/vnc/images/_vti_cnf/newlogosmall2.gif
! share/doc/vnc/images/_vti_cnf/intouchbutton.gif
! share/doc/vnc/images/_vti_cnf/ie1_small.gif
! share/doc/vnc/images/_vti_cnf/ie1.gif
! share/doc/vnc/images/_vti_cnf/ns1.gif
! share/doc/vnc/images/_vti_cnf/Xvnc.gif
! share/doc/vnc/images/_vti_cnf/winvnctray.GIF
! share/doc/vnc/images/_vti_cnf/winviewer1_small.gif
! share/doc/vnc/images/_vti_cnf/vnc.gif
! share/doc/vnc/images/_vti_cnf/winviewer1.gif
! share/doc/vnc/images/_vti_cnf/vinci1_small.gif
! share/doc/vnc/images/_vti_cnf/vinci1.gif
! share/doc/vnc/images/_vti_cnf/startbutton.gif
! share/doc/vnc/images/_vti_cnf/spacer.gif
! share/doc/vnc/images/_vti_cnf/sidebarbg.gif
! share/doc/vnc/images/_vti_cnf/screenbutton.gif
! share/doc/vnc/images/_vti_cnf/orlbutton.gif
! share/doc/vnc/images/_vti_cnf/ns1_small.gif
! share/doc/vnc/images/backbutton.gif
! share/doc/vnc/images/badgeshad.gif
  share/doc/vnc/images/bluepix.gif
  share/doc/vnc/images/cdplay.gif
  share/doc/vnc/images/clientserver.gif
--- 3,25 ----
  bin/vncviewer
  bin/vncpasswd
  bin/vncserver
! share/doc/vnc/images/photos/.lastinstall
! share/doc/vnc/images/photos/vncce1_small.jpg
! share/doc/vnc/images/photos/vncce2.jpg
! share/doc/vnc/images/photos/vncce2_small.jpg
! share/doc/vnc/images/photos/vncce3.jpg
! share/doc/vnc/images/photos/vncce3_small.jpg
! share/doc/vnc/images/photos/makefile
! share/doc/vnc/images/photos/makefile~
! share/doc/vnc/images/photos/vncce1.jpg
! share/doc/vnc/images/people/.lastinstall
! share/doc/vnc/images/people/jnw.jpg
! share/doc/vnc/images/people/krw.jpg
! share/doc/vnc/images/people/pmw.jpg
! share/doc/vnc/images/people/qsf.jpg
! share/doc/vnc/images/people/tjr.jpg
! share/doc/vnc/images/people/makefile
! share/doc/vnc/images/people/ach.jpg
  share/doc/vnc/images/bluepix.gif
  share/doc/vnc/images/cdplay.gif
  share/doc/vnc/images/clientserver.gif
***************
*** 99,126 ****
  share/doc/vnc/images/ns1.gif
  share/doc/vnc/images/ns1_small.gif
  share/doc/vnc/images/orlbutton.gif
- share/doc/vnc/images/sidebarbg.gif
  share/doc/vnc/images/screenbutton.gif
  share/doc/vnc/images/spacer.gif
  share/doc/vnc/images/startbutton.gif
  share/doc/vnc/images/vinci1.gif
  share/doc/vnc/images/vinci1_small.gif
- share/doc/vnc/images/vnc.gif
  share/doc/vnc/images/winviewer1.gif
  share/doc/vnc/images/winviewer1_small.gif
  share/doc/vnc/images/winvnctray.GIF
  share/doc/vnc/images/Xvnc.gif
  share/doc/vnc/index.html
  share/doc/vnc/internalversion.html
  share/doc/vnc/intouch.html
  share/doc/vnc/javavncviewer.html
  share/doc/vnc/protocol.html
  share/doc/vnc/rfbproto.pdf
  share/doc/vnc/rfbprotoheader.pdf
  share/doc/vnc/screenshots.html
  share/doc/vnc/start.html
  share/doc/vnc/styles.css
  share/doc/vnc/winvnc.html
  share/doc/vnc/winvncviewer.html
  share/doc/vnc/xvnc.html
  share/doc/vnc/xvncviewer.html
--- 37,106 ----
  share/doc/vnc/images/ns1.gif
  share/doc/vnc/images/ns1_small.gif
  share/doc/vnc/images/orlbutton.gif
  share/doc/vnc/images/screenbutton.gif
+ share/doc/vnc/images/vnc.gif
+ share/doc/vnc/images/sidebarbg.gif
  share/doc/vnc/images/spacer.gif
  share/doc/vnc/images/startbutton.gif
  share/doc/vnc/images/vinci1.gif
  share/doc/vnc/images/vinci1_small.gif
  share/doc/vnc/images/winviewer1.gif
  share/doc/vnc/images/winviewer1_small.gif
  share/doc/vnc/images/winvnctray.GIF
  share/doc/vnc/images/Xvnc.gif
+ share/doc/vnc/images/makefile
+ share/doc/vnc/images/.lastinstall
+ share/doc/vnc/images/makefile~
+ share/doc/vnc/images/faqbutton.gif
+ share/doc/vnc/images/vncpeoplebutton.gif
+ share/doc/vnc/images/helpbutton.gif
+ share/doc/vnc/images/viewertray.gif
+ share/doc/vnc/images/iemacwin.gif
+ share/doc/vnc/images/iemacwin_small.gif
+ share/doc/vnc/images/iemacx.gif
+ share/doc/vnc/images/iemacx_small.gif
+ share/doc/vnc/images/contribbutton.gif
+ share/doc/vnc/images/sideblank.gif
+ share/doc/vnc/images/sidelogo.gif
+ share/doc/vnc/images/searchbutton.gif
+ share/doc/vnc/images/videos1.jpg
+ share/doc/vnc/images/videos2.jpg
+ share/doc/vnc/images/backbutton.gif
+ share/doc/vnc/images/videos3.jpg
+ share/doc/vnc/images/badgeshad.gif
+ share/doc/vnc/_vti_pvt/_x_todo.htm
+ share/doc/vnc/_vti_pvt/_x_todoh.htm
+ share/doc/vnc/_private/footer.html
+ share/doc/vnc/_private/header.html
+ share/doc/vnc/_private/sidebar.html
+ share/doc/vnc/download.htm
+ share/doc/vnc/download.htm~
+ share/doc/vnc/faq.html
+ share/doc/vnc/free.html
+ share/doc/vnc/gpl.html
+ share/doc/vnc/help.html
+ share/doc/vnc/howitworks.html
  share/doc/vnc/index.html
  share/doc/vnc/internalversion.html
  share/doc/vnc/intouch.html
  share/doc/vnc/javavncviewer.html
+ share/doc/vnc/makefile
+ share/doc/vnc/oldcontribs.html
+ share/doc/vnc/oldfaq.html
  share/doc/vnc/protocol.html
  share/doc/vnc/rfbproto.pdf
  share/doc/vnc/rfbprotoheader.pdf
  share/doc/vnc/screenshots.html
  share/doc/vnc/start.html
  share/doc/vnc/styles.css
+ share/doc/vnc/twmideas.html
+ share/doc/vnc/videos.html
+ share/doc/vnc/vnchistory.html
+ share/doc/vnc/vncpeople.html
+ share/doc/vnc/winhistory.html
  share/doc/vnc/winvnc.html
  share/doc/vnc/winvncviewer.html
  share/doc/vnc/xvnc.html
  share/doc/vnc/xvncviewer.html
+ share/doc/vnc/contribs.html
+ share/doc/vnc/docs.html
*** vnc/Makefile.orig	Tue Jul 28 16:23:47 1998
--- vnc/Makefile	Tue Jul 28 16:23:59 1998
***************
*** 2,13 ****
  # FreeBSD Id: Makefile,v 1.2 1998/03/19 01:54:59 msmith Exp
  #
  
! DISTNAME=       	vnc-3.3.1_unixsrc
! PKGNAME=        	vnc-3.1.1
  CATEGORIES=		net x11
  MASTER_SITES=   	http://www.orl.co.uk/vnc/dist/
! DISTFILES=		vnc-3.3.1_unixsrc.tgz \
! 			vnc-3.3.1_doc.tgz
  
  MAINTAINER=	 	packages@netbsd.org
  
--- 2,13 ----
  # FreeBSD Id: Makefile,v 1.2 1998/03/19 01:54:59 msmith Exp
  #
  
! DISTNAME=       	vnc-3.3.2r2_unixsrc
! PKGNAME=        	vnc-3.3.2
  CATEGORIES=		net x11
  MASTER_SITES=   	http://www.orl.co.uk/vnc/dist/
! DISTFILES=		vnc-3.3.2r2_unixsrc.tgz \
! 			vnc-3.3.2_doc.tgz
  
  MAINTAINER=	 	packages@netbsd.org
  
***************
*** 15,21 ****
  
  USE_PERL5=		yes
  
! EXTRACT_ONLY=		vnc-3.3.1_unixsrc.tgz
  
  # Is this for real? The code was developed in the UK,
  # but the DES parts came from the USA in the first place.
--- 15,21 ----
  
  USE_PERL5=		yes
  
! EXTRACT_ONLY=		vnc-3.3.2r2_unixsrc.tgz
  
  # Is this for real? The code was developed in the UK,
  # but the DES parts came from the USA in the first place.
***************
*** 26,32 ****
  USE_IMAKE=		yes
  NO_INSTALL_MANPAGES=	yes
  
! ALL_TARGET=    		world
  
  # We have to frob a few things, and we want our own permissions, so it's easier
  # to do the install ourselves.
--- 26,32 ----
  USE_IMAKE=		yes
  NO_INSTALL_MANPAGES=	yes
  
! ALL_TARGET=    		World
  
  # We have to frob a few things, and we want our own permissions, so it's easier
  # to do the install ourselves.
***************
*** 35,47 ****
  	${INSTALL_PROGRAM} ${WRKDIR}/vncviewer/vncviewer ${PREFIX}/bin/vncviewer
  	${INSTALL_PROGRAM} ${WRKDIR}/vncpasswd/vncpasswd ${PREFIX}/bin/vncpasswd
  	${SED} -e 's|/usr/local/vnc/classes|${X11BASE}/share/vnc/classes|g' \
! 		-e 's|/usr/local/bin/perl|${LOCALBASE}/bin/perl|g' \
  		< ${WRKDIR}/vncserver \
  		> ${WRKDIR}/vncserver.local
  	${INSTALL_SCRIPT} ${WRKDIR}/vncserver.local ${PREFIX}/bin/vncserver
  # The documentation comes with bogus ownerships; this is a little leaky security-wise
  	${MKDIR} ${PREFIX}/share/doc/vnc
! 	tar -C ${PREFIX}/share/doc/vnc -xzf ${DISTDIR}/vnc-3.3.1_doc.tgz
  	chown -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/share/doc/vnc
  
  .include "../../mk/bsd.pkg.mk"
--- 35,47 ----
  	${INSTALL_PROGRAM} ${WRKDIR}/vncviewer/vncviewer ${PREFIX}/bin/vncviewer
  	${INSTALL_PROGRAM} ${WRKDIR}/vncpasswd/vncpasswd ${PREFIX}/bin/vncpasswd
  	${SED} -e 's|/usr/local/vnc/classes|${X11BASE}/share/vnc/classes|g' \
! 		-e 's|/usr/bin/perl|${LOCALBASE}/bin/perl|g' \
  		< ${WRKDIR}/vncserver \
  		> ${WRKDIR}/vncserver.local
  	${INSTALL_SCRIPT} ${WRKDIR}/vncserver.local ${PREFIX}/bin/vncserver
  # The documentation comes with bogus ownerships; this is a little leaky security-wise
  	${MKDIR} ${PREFIX}/share/doc/vnc
! 	tar -C ${PREFIX}/share/doc/vnc -xzf ${DISTDIR}/vnc-3.3.2_doc.tgz
  	chown -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/share/doc/vnc
  
  .include "../../mk/bsd.pkg.mk"
*** vnc/README.html.orig	Wed Jul 22 08:54:34 1998
--- vnc/README.html	Tue Jul 28 16:24:11 1998
***************
*** 26,32 ****
  "net/vnc"
  directory. It can be manipulated using the packaging tools,
  working on the
! vnc-3.1.1
  package.
  For a summary on how to use the package collection, go to the
  <a href="../../README.html">top of the packages tree</a>.
--- 26,32 ----
  "net/vnc"
  directory. It can be manipulated using the packaging tools,
  working on the
! vnc-3.3.2
  package.
  For a summary on how to use the package collection, go to the
  <a href="../../README.html">top of the packages tree</a>.
>Audit-Trail:
>Unformatted: