31-AUG-2000, David Mathog, mathog@caltech.edu

These notes describe how to install gnupg 1.0.2 on a VMS
system.  This port has not been extensively tested but it is known to
perform the checks section of the build correctly.  (It is very unclear if 
the rndvms.c function works - or ever gets called!)

1.  obtain from www.gnupg.org the 1.0.2 distribution of
    gnupg and unpack it on a disk (not too deep, lower
    than subdirectory level 3 may be a problem).

2.  set default to the top level of that distribution.

3.  Obtain the VMS port from 

    http://seqaxp.bio.caltech.edu/pub/SOFTWARE/gnupg1_0_2_vms.zip

    (Hopefully this is legal since this file contains no encryption
    code itself.)

4.  Unpack it in the top level of the gnupg distribution.  You will find 
    the following files:

    AAA_VMS_INSTALL.TXT         This file
    AAA_VMS_PORT_NOTES.TXT      Notes on the port
    GPG_MAN.HTML                GnuPG man page, converted to html
    MAKE_VMS.COM                Build procedure for GnuPG
    VMS_CONFIG.H                files needed for the build
    VMS_G10DEFS.H               "
    RNDVMS.C                    "
    VMS_CONSTRUCT.C             "

5.  Edit the following files to obtain these diffs, where .C_DIST is the
    unmodified form from the gnupg distribution.

$ diff PRGDISK:[SHARED.PROGRAMS.GNUPG.GNUPG-1_0_2.G10]g10.C g10.C_DIST
************
File PRGDISK:[SHARED.PROGRAMS.GNUPG.GNUPG-1_0_2.G10]G10.C;2
  628           #if defined(__VMS)
  629             opt.homedir = "/SYS$LOGIN/gnupg";
  630           #else /* __VMS */
  631             opt.homedir = "~/.gnupg";
  632           #endif /* __VMS */
  633
  634         #endif
******
File PRGDISK:[SHARED.PROGRAMS.GNUPG.GNUPG-1_0_2.G10]G10.C_DIST;1
  628           opt.homedir = "~/.gnupg";
  629         #endif
************

$ diff PRGDISK:[SHARED.PROGRAMS.GNUPG.GNUPG-1_0_2.G10]ENCR-DATA.C ENCR-DATA.C_DIST;1
************
File PRGDISK:[SHARED.PROGRAMS.GNUPG.GNUPG-1_0_2.G10]ENCR-DATA.C;3
  234   /*    size_t n, size = *ret_len; */
  235       size_t size = *ret_len;
  236       int n;
  237       int rc = 0;
******
File PRGDISK:[SHARED.PROGRAMS.GNUPG.GNUPG-1_0_2.G10]ENCR-DATA.C_DIST;1
  234       size_t n, size = *ret_len;
  235       int rc = 0;
************

$ diff PRGDISK:[SHARED.PROGRAMS.GNUPG.GNUPG-1_0_2.G10]KEYGEN.C KEYGEN.C_DIST;1
************
File PRGDISK:[SHARED.PROGRAMS.GNUPG.GNUPG-1_0_2.G10]KEYGEN.C;2
  732   /*          if( (time_t)((ulong)(curtime+interval)) < 0 ) */
  733               if( (long int)((ulong)(curtime+interval)) < 0 )
  734                   tty_printf(_("Your system can't display dates 
beyond 2038.\n"
******
File PRGDISK:[SHARED.PROGRAMS.GNUPG.GNUPG-1_0_2.G10]KEYGEN.C_DIST;1
  732               if( (time_t)((ulong)(curtime+interval)) < 0 )
  733                   tty_printf(_("Your system can't display dates 
beyond 2038.\n"
************


For the next one the comma following 61 is removed - otherwise a huge 
number of warnings result

$ diff PRGDISK:[SHARED.PROGRAMS.GNUPG.GNUPG-1_0_2.G10]PACKET.H PACKET.
H_DIST;1
************
File PRGDISK:[SHARED.PROGRAMS.GNUPG.GNUPG-1_0_2.G10]PACKET.H;2
   52           PKT_COMMENT       =61  /* new comment packet (private) */
   53   } pkttype_t;
******
File PRGDISK:[SHARED.PROGRAMS.GNUPG.GNUPG-1_0_2.G10]PACKET.H_DIST;1
   52           PKT_COMMENT       =61, /* new comment packet (private) */
   53   } pkttype_t;
************

$ diff ttyio.c .c_dist
************
File PRGDISK:[SHARED.PROGRAMS.GNUPG.GNUPG-1_0_2.UTIL]TTYIO.C;4
  123       ttyfp = batchmode? stderr : fopen(TERMDEVICE, "r+");
  124       if( !ttyfp ) {
  125           log_error("cannot open terminal%s: %s\n", TERMDEVICE,strerror(errno) );
  126           exit(2);
  127       }
  128
  129     #endif
******
File PRGDISK:[SHARED.PROGRAMS.GNUPG.GNUPG-1_0_2.UTIL]TTYIO.C_DIST;1
  123       ttyfp = batchmode? stderr : fopen("/dev/tty", "r+");
  124       if( !ttyfp ) {
  125           log_error("cannot open /dev/tty: %s\n", strerror(errno) );
  126           exit(2);
  127       }
  128     #endif
************



6.  Now build it with:

    @MAKE_VMS             (regular)
    @MAKE_VMS  anything   (debug versions)

7.  Define a symbol for gnupg

