From xemacs-m  Mon Jan  6 20:11:22 1997
Received: from venus.Sun.COM (venus.Sun.COM [192.9.25.5])
          by xemacs.cs.uiuc.edu (8.8.4/8.8.4) with SMTP
	  id UAA02007 for <xemacs-beta@xemacs.org>; Mon, 6 Jan 1997 20:11:21 -0600 (CST)
Received: from Eng.Sun.COM ([129.146.1.25]) by venus.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id SAA17747; Mon, 6 Jan 1997 18:10:54 -0800
Received: from kindra.eng.sun.com by Eng.Sun.COM (SMI-8.6/SMI-5.3)
	id SAA25239; Mon, 6 Jan 1997 18:10:52 -0800
Received: from xemacs.eng.sun.com by kindra.eng.sun.com (SMI-8.6/SMI-SVR4)
	id SAA00549; Mon, 6 Jan 1997 18:10:50 -0800
Received: by xemacs.eng.sun.com (SMI-8.6/SMI-SVR4)
	id SAA12515; Mon, 6 Jan 1997 18:10:49 -0800
Date: Mon, 6 Jan 1997 18:10:49 -0800
Message-Id: <199701070210.SAA12515@xemacs.eng.sun.com>
From: Martin Buchholz <mrb@Eng.Sun.COM>
To: Steven L Baur <steve@miranova.com>
Cc: xemacs-beta@xemacs.org
Subject: Re: Build report: 20.0b34 on Linux 2.0.27
In-Reply-To: <m2rajy2xna.fsf@altair.xemacs.org>
References: <m3sp4eh2a6.fsf@arioch.tng.oche.de>
	<m2rajy2xna.fsf@altair.xemacs.org>
Reply-To: Martin Buchholz <mrb@Eng.Sun.COM>
Mime-Version: 1.0 (generated by tm-edit 7.100)
Content-Type: multipart/mixed;
 boundary="Multipart_Mon_Jan__6_18:10:48_1997-1"
Content-Transfer-Encoding: 7bit

--Multipart_Mon_Jan__6_18:10:48_1997-1
Content-Type: text/plain; charset=US-ASCII

>>>>> "sb" == Steven L Baur <steve@miranova.com> writes:

>>>>> "Carsten" == Carsten Leonhardt <leo@arioch.tng.oche.de> writes:
Carsten> Linux 2.0.27, gcc 2.7.2.1, XFree86 3.2
Carsten> When I first tried to compile with support for Canna, I got errors
Carsten> while linking temacs (see below). The solution was to also
Carsten> link with the "RKC" library which also comes with Canna (I patched
Carsten> src/Makefile.in.in to achieve this, diff below).

sb> Thanks for the report and patch -- I applied it to the current 20.0 beta.

sb> Would someone please send me a list of the international libraries
sb> (like canna, etc.) and their primary ftp sites that can be linked with
sb> current XEmacs v20?  I'd like to put it in the XEmacs FAQ.


--Multipart_Mon_Jan__6_18:10:48_1997-1
Content-Type: text/plain; charset=US-ASCII


I've been meaning for a long time to make my anonymous ftp script +
database available.  (The script won't work for you without some
hacking on my `get through the firewall' code for Sun). The particular
problem of the canna location can be gleaned from the list in the
attached file.  All the XEmacs-related sites should be added to some
Web page at www.xemacs.org.


--Multipart_Mon_Jan__6_18:10:48_1997-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="ftpnet"
Content-Transfer-Encoding: 7bit

: #-*- Perl -*-
eval 'exec perl -w -S $0 ${1+"$@"}' # Portability kludge
    if 0;
# Author: Martin Buchholz

#------------------------------------------------------------------
# Add more sites to the following list.  Format:
# ftp-url  nickname ...
#------------------------------------------------------------------
$ftp_sites = "
# XEmacs and GNU Emacs
ftp://ftp.xemacs.org/pub/xemacs                    xemacs lemacs 
ftp://ftp.cs.indiana.edu/pub/faces                 xface compface
ftp://koala.inria.fr/pub/xpm                       xpm X11-Pixmaps
ftp://ftp.x.org/contrib/libraries                  xpm-2
ftp://ftp.netcom.com/pub/tg/tgl/uunet              jpeg
ftp://ftp.uu.net/graphics/jpeg                     jpeg-2
ftp://ftp.sgi.com/graphics/tiff                    tiff libtiff
ftp://ftp.ctd.comsat.com/pub/linux/ELF             libgr
ftp://opcom.canada.sun.com/pub/tars                dynodump
ftp://opcom.sun.ca/pub/tars                        dynodump-2
ftp://swrinde.nde.swri.edu/pub/png/src             png
ftp://ftp.uu.net/graphics/png                      png-2
ftp://ftp.uu.net/pub/archiving/zip/zlib            zlib
ftp://ftp.x.org/contrib/audio/nas                  nas Network-Audio-System
ftp://ftp.ncs.com/pub/ncd/technology/src/nas       nas-2 Network-Audio-System-2
ftp://archive.cis.ohio-state.edu/pub/gnu/emacs/elisp-archive   elisp lispdir
ftp://ftp.diamond-lane.net/pub/people/Steve.Baur/.incoming steve-patches
ftp://ftp.cyclic.com/pub/guile                    guile

## 3rd party elisp packages for XEmacs
ftp://archive.cis.ohio-state.edu/pub/gnu/emacs/elisp-archive/packages  bbdb
ftp://ftp.cs.indiana.edu/pub/elisp/w3              w3 www perry wmperry
ftp://ftp.cs.indiana.edu/pub/elisp/w3/.betas       w3-beta
ftp://theory.lcs.mit.edu/pub/emacs/edb             edb Emacs-Database
ftp://ftp.teleport.com/pub/users/lewie/evi         evi Emacs-VI-Emulator
ftp://ftp.csce.kyushu-u.ac.jp/pub/Misc/mew         mew
ftp://alpha.gnu.ai.mit.edu/efs                     efs
ftp://kali.ftm.cs.cmu.edu/pub                      gnuserv
ftp://ftp.ifi.uio.no/pub/emacs/gnus                gnus gnus-5 larsi
ftp://the-tech.mit.edu/pub/GNU-Emacs/              emacs-faq
ftp://ftp.jaist.ac.jp/pub/GNU/elisp/mime           tools-for-mime tm
ftp://cs.uta.fi/pub/ssjaaa                         tiny-tools jari aalto
ftp://ftp.cs.cmu.edu/afs/cs/user/campbell/http/ilisp ilisp
ftp://ftp.icsi.berkeley.edu/pub/software/elisp ilisp-2
ftp://ftp.ireq-robot.hydro.qc.ca/pub/emacs/lisp    global-replace
ftp://ftp.x.org/misc/mh-e                          mhe mh-e
ftp://mixing.qc.dfo.ca/pub/elisp                   e-mh-alias
ftp://ftp.python.org/pub/emacs                     cc-mode python-mode reporter supercite warsaw
ftp://ftp.tnt.uni-hannover.de/pub/editors/xemacs/contrib hm--html Heiko_Muenkel
ftp://ftp.csd.uu.se/pub/users/andersl/beta         folding-mode follow-mode
ftp://ftp.eda.com.au/pub/emacs                     vhdl-mode
ftp://ftp.csd.uu.se/pub/users/andersl/emacs        follow-mode
ftp://ftp.sgi.com/other/dmacro                     dmacro
ftp://ftp.cs.sunysb.edu/pub/TechReports/kifer      ediff viper kifer
ftp://ftp.ultranet.com/pub/zappo                   eieio CLOS-clone
ftp://bondage.eng.sun.com/pub/linkers/dldump       dldump
ftp://ftp.cs.berkeley.edu/ucb/people/phelps/tcltk  rman
ftp://ftp.ics.hawaii.edu/pub/csdl/egret            egret
ftp://ftp.miranova.com/pub/xemacs                  xemacs-faq
ftp://rmtc.central/pub/VM                          vm-attachments
ftp://thumper.bellcore.com/pub/nsb                 mm metamail nathaniel-borenstein
ftp://ftp.mathcs.emory.edu/pub/mic/emacs           ffap Michaelangelo_Grigni
ftp://ietf.cnri.reston.va.us/internet-drafts       internet-drafts pgp-elkins pgp-kazu
ftp://ftp.cs.toronto.edu/pub/kr                    search-menu
ftp://ftp.math.ohio-state.edu/pub/users/ilya/cperl-mode cperl-mode
ftp://ftp.uni-passau.de/pub/local/parallel/sources x-symbol

# Japanese Emacs resources
ftp://sh.wide.ad.jp/JAPAN/mule                     mule
ftp://sh.wide.ad.jp/JAPAN/mule/fonts               mule-fonts
ftp://etlport.etl.go.jp/pub/mule                   mule-2
ftp://#skk.tohoku.ac.jp/pub/skk                     skk
ftp://ftp.kuis.kyoto-u.ac.jp/SKK                   skk
ftp://steam.stanford.edu/pub/skk                   skk-us
ftp://utsun.s.u-tokyo.ac.jp/tcode                  tcode
ftp://ftp.nec.co.jp/pub/packages/Canna32           canna Canna32
ftp://ftp.csce.kyushu-u.ac.jp/pub/Misc/Canna/Canna32 canna-2 Canna32-2
ftp://ftp.wg.omron.co.jp/pub/Wnn                   wnn Wnn uum
ftp://ftp.csce.kyushu-u.ac.jp/pub/Misc/Wnn         wnn-2 Wnn-2 uum-2
ftp://fly.cnuce.cnr.it/pub/                        etags

# Other Emacsen
ftp://ftp.netcom.com/pub/pe/pearl                  win-emacs pearl
ftp://lynx.ps.uci.edu/pub/NeXT/emacs-19-for-NeXTstep emacs.app emacs19-for-nextstep
ftp://ftp.uni-stuttgart.de/pub/systems/os2/emacs-19 os2emacs
ftp://hobbes.nmsu.edu/os2/unix/emacs29             os2emacs-2
ftp://prep.ai.mit.edu/pub/gnu                      emacs-19.31
ftp://theory.lcs.mit.edu/pub/emacs                 pc-emacs-list
ftp://ftp.cs.cornell.edu/pub/parmet                mac-emacs

# GNU sites
ftp://prep.ai.mit.edu/pub/gnu                      gnu prep
ftp://gatekeeper.dec.com/pub/GNU                   decgnu
ftp://ftp.cygnus.com/pub/g++                       cygnus g++
ftp://wuarchive.wustl.edu/mirrors/gnu              wugnu
ftp://ftp.wellfleet.com/netman/psmith/gmake        vpath VPATH-patch-for-gnumake
ftp://ftp.cs.wisc.edu/pub/ghost                    ghost ghostview
ftp://cs.uiuc.edu/pub/testing/gct.files            gct

# Perl
ftp://ftp.cis.ufl.edu/pub/perl                     perl
ftp://uiarchive.cso.uiuc.edu/pub/lang/perl/CPAN/src/5.0 CPAN Comprehensive-Perl-Archive-Network
ftp://ftp.ira.uka.de/pub/x11/tkperl                tkperl
ftp://ftp.wpi.edu/perl5                            perltk ptk
ftp://ftp.demon.co.uk/pub/perl/db                  dbperl
ftp://ftp.cs.utah.edu/pub/beazley/SWIG             SWIG

# X11
ftp://ftp.x.org/pub                                xwindows x11 X11
ftp://ftp.wavegroup.irfu.se/dist/X11R5             hpux-X11-config
ftp://hpux.cae.wisc.edu/hpux                       hp-ux
ftp://hpux.cae.wisc.edu/hpux/X11/Core              hp-ux-X11

# Miscellaneous
ftp://ftp.hungry.com/pub/hungry/lesstif            lesstif
ftp://sgml1.ex.ac.uk/pub/SGML/sgmls                sgmls
ftp://ftp.ecma.ch/                                 ecma ECMA European-Standards
ftp://ftp.cs.hut.fi/pub/ssh                        ssh
ftp://ftp.ccil.org/pub/esr                         esr Eric-Raymond
ftp://ftp.via.ecp.fr/pub/lyx                       lyx
ftp://ftp.informatik.rwth-aachen.de/pub/packages/procmail procmail
ftp://ftp.icce.rug.nl/pub/unix                     YODL yodl
ftp://ftp.pixar.com/pub/bruce                      ElectricFence
ftp://ftp.demon.co.uk/pub/unix/unix/tools          cxref
ftp://ftp.parasoft.com/insure++                    parasoft insight insure++
ftp://ds.internic.net/rfc                          rfc
ftp://samba.anu.edu.au/pub/rsync                   rsync
ftp://ftp.cdrom.com/pub/tex/ctan/systems/unix      CTAN Comprehensive-Tex-Archive-Network
ftp://ftp2.cc.ukans.edu/pub/lynx                   lynx
ftp://summit.stanford.edu/pub/guavac               guavac free-java
ftp://ftp.std.com/pub/jrs                          strace
ftp://sunsite.unc.edu/pub/Linux/apps/tex/teTeX/distrib teTeX tetex
ftp://#ftp.cdrom.com/pub/tex/ctan/systems/unix/teTeX teTeX tetex
ftp://sunsite.informatik.rwth-aachen.de/pub/comp/tex/teTeX/distrib teTeX-2 tetex-2
ftp://ftp.icsi.berkeley.edu/pub/ai/stolcke/software pmake
ftp://ftp.fnal.gov/pub/nedit/v4_0                  nedit
ftp://ftp.cis.upenn.edu/pub/xv                     xv
ftp://ftp.uu.net/                                  uunet
ftp://ftp.uu.net/published/oreilly/xbook           oreilly
ftp://ftp.xopen.co.uk/pub/TET                      TET tet
ftp://sumex.stanford.edu/info-mac                  mac
ftp://ftp.apple.com/dts                            apple
ftp://sunsite.unc.edu/pub/sun-info/mde/proctool    proctool
ftp://ftp.ece.uc.edu/pub/sun-faq/FAQs              sun-faq
ftp://usc.edu/pub/sysinfo                          sysinfo
ftp://ftp.cs.cornell.edu/pub                       cornell
ftp://ftp.sterling.com/zsh                         zsh
ftp://tesla.ee.cornell.edu/pub/tcsh                tcsh
ftp://cert.sei.cmu.edu/pub                         cops
ftp://ftp-os2.nmsu.edu/os2                         os2
ftp://ftp.cdrom.com/pub/cica/nt                    nt
ftp://ftp.qucis.queensu.ca/pub/software-eng        softeng
ftp://coma.cs.tu-berlin.de/pub/shapeTools          shape
ftp://netcom.com/pub/stig/src                      hilit
ftp://sun.soe.clarkson.edu/pub/C++                 c++faq
ftp://ftp.th-darmstadt.de/pub/programming/languages/C++ c++
ftp://euagate.eua.ericsson.se/pub/eua/c++          c++rules
ftp://aixpdslib.seas.ucla.edu/pub                  aix
ftp://cert.sei.cmu.edu/cops_104                    cops
ftp://sunsite.unc.edu/pub/Linux                    linux
ftp://sunsite.unc.edu/pub/sun-info                 sun-info
ftp://ftp.ics.uci.edu/pub/mh                       mh
ftp://tartarus.uwa.edu.au/pub/oreillym/term        term-old
ftp://bohr.physics.purdue.edu/pub/bcr/term         term
ftp://ftp.hpc.uh.edu/pub/fvwm                      fvwm
ftp://ftp.uni-erlangen.de/pub/utilities/screen     screen
ftp://ftp.uni-stuttgart.de/pub/systems/aix/3.2     aix-tex
ftp://sunsite.informatik.rwth-aachen.de/pub/comp/tex/teTeX/distrib tetex
ftp://ftp.cs.ucla.edu/pub/ispell-3.1               ispell
ftp://usc.edu/pub/rdist                            rdist
ftp://kermit.columbia.edu/kermit                   kermit
ftp://sunsite.auc.dk/packages/auctex               auctex
ftp://ftp.cwi.nl/pub/python                        python
ftp://vic.cc.purdue.edu/pub/tools/unix/lsof        lsof List-Open-Files
ftp://ftp.funet.fi/pub/unix/AIX/RS6000             monitor
ftp://eecs.nwu.edu/pub/top                         top
ftp://ftp.nec.com/pub/security/socks.cstc          socks
ftp://cs.anu.edu.au/pub/software/ppp               ppp
ftp://plan9.att.com/plan9                          plan9
ftp://tsx-11.mit.edu/pub/linux                     tsx Linux-East-Coast
ftp://rtfm.mit.edu/pub/usenet/news.answers         rtfm FAQ-repository Read-The-Fine-Manual
ftp://pit-manager.mit.edu/pub/usenet/news.answers  pit-manager rtfm2
ftp://java.sun.com/pub/java                        java
ftp://summit.stanford.edu/pub/guavac               guavac free-java-compiler
ftp://ftp.smli.com/pub/tcl                         tcl tk Tool-Control-Language
ftp://ftp.cme.nist.gov/pub/expect                  expect
ftp://ftp.cs.berkeley.edu/ucb/4bsd                 nvi  New-VI
ftp://ftp.cs.pdx.edu/pub/elvis                     elvis
ftp://ftp.coast.net/pub/SimTel/msdos               dos simtel oak
#ftp://oak.oakland.edu/simtel/msdos                 dos simtel oak
ftp://dse.doc.ic.ac.uk/pub/misc/bcc                bcc Bound-Checking-gcc
ftp://ftp.cs.utah.edu/pub/beazley/SWIG             SWIG

# Database
ftp://postgres.berkeley.edu/pub                    postgres Object-Ingres
ftp://idiom.berkeley.ca.us/pub                     freedb
ftp://ftp.cs.wisc.edu/exodus                       exodus
ftp://ftp.odi.com/pub                              oo7
";

($myName = $0) =~ s@.*/@@; $usage="
Usage: $myName internet_host

Establishes an ftp connection - can replace the `ftp' or `iftp' program.
Example: $myName prep.ai.mit.edu

Differences from `ftp':
- Default ftp userid is `anonymous'.
- Connections can be established to sites on the REAL internet
  (beyond the firewall) as well as within Sun.
  There are 2 kinds of ftp connections used:
  - `ftp' is used within Sun.
  - `iftp' (if available) is used to connect to the real internet.
- Knows about a large number of Martin-selected popular ftp sites
  which are reachable via nicknames.
  For example, `$myName rtfm'
  will get you to rtfm.mit.edu:/pub/usenet/news.answers.

The following syntax can also be used to define a hostnames/directory pair:
   $myName sunsite.unc.edu:/pub/Linux

To do NON-anonymous ftp to an internet site, use this syntax:
   $myName pwyan\@violet.uwaterloo.ca

Here is the list of known ftp sites and their nicknames:

$ftp_sites";

if (@ARGV == 0 || (@ARGV == 1 && $ARGV[0] eq '-l')) {
  print $ftp_sites;
  exit 0;
}
die $usage unless @ARGV == 1;
die $usage if grep (/^-/, @ARGV);

$site_user = 'anonymous';
$site = $site_arg = shift;

if ($site =~ m@^ftp://([^/]+)(/.+)$@) {
  ($site, $dir) = ($1, $2);
} elsif ($site =~ m@^/?(.*):(.*)$@) {
  ($site, $dir) = ($1, $2);
} else {
  $dir = "/pub";
  foreach (split("\n", $ftp_sites)) {
    s/\#.*//;
    next if /^\s*$/;
    ($_, @fnickname) = split(' ');
    next unless defined @fnickname && @fnickname;
    ($fsite, $fdir) = m@^ftp://([^/]+)(/[^\s]*)@;
    die "Invalid FTP Site syntax: $_\n" unless defined $fdir;
    $dir = $fdir if $site_arg eq $fsite;
    if (grep ($site_arg eq $_, @fnickname)) {
      ($dir, $site) = ($fdir, $fsite);
      last;
    }
  }
}

if ($site =~ /^(.*)@(.*)$/) {
  ($site_user, $site) = ($1, $2);
}

    
# Do we have to pass through the firewall?
$internal_p  = ((($site =~ /\.(sun\.com|eng|ebay|central|east|ca|ja)$/) ||
($site !~ /\./))  ? 1 : 0);
$socks_p     = (grep(-x "$_/iftp", split(':', $ENV{'PATH'})) ? 1 : 0);

print "Connecting to site $site, ",
    ($site_user eq 'anonymous' ? "directory $dir" : "user $site_user"), "\n";

# Huge expect command starts here...
exec 'expect',
     '-c', "
set site              $site;
set dir               $dir;
set site_user         $site_user;
set socks_p           $socks_p;
set internal_p        $internal_p;",
     '-c', '

trap exit SIGINT;

set timeout 180  ;# ftp can take a while to start up
set emacs [expr {[string match $env(TERM) "emacs"] || [string match $env(TERM) "unknown"]}];
set anon  [expr {$site_user=="anonymous"}];

log_user 0;
#exp_internal 1

if $internal_p then {
    set ftp ftp;
    set ftp_user "$site_user";
} else {
    set ftp iftp;
    set ftp_user "$site_user@$site";
}

spawn -nottyinit $ftp $site;

proc send_ftp {line {pattern {ftp> $} } } {
  global emacs anon;
  send -- "$line\n";
  if {$emacs} { send_user -- "$line\n"; };
  expect {
    -re "$pattern"  { send_user -- $expect_out(buffer); }
  }
}

expect_before {
  -re "(onnection refused|ost unknown|nknown host|ser .* unknown|ccess denied|ogin (failed|incorrect)).*\n" {
    send_user -- $expect_out(buffer);
    exit;
  }
  timeout {
    send_user -- "FTP timed out\n"; 
    exit;
  }
}

expect {
  -re "Name (.*:.*): *$" {
    send_user -- "$expect_out(buffer)";
    if $emacs then { send_user -- "$site_user\n"; };
    send -- "$site_user\n";
    exp_continue;
  }
  -re "assword: *$" {
    # Print promp, perhaps doctored for emacs
    if {$emacs && $anon} then {
      send_user -- "Pass word : ";
    } else {
      send_user -- "$expect_out(buffer)";
    }
    # Initialize password, either email address or secret one
    if !$anon then {
      if !$emacs then { set stty [exec stty -g]; }
      exec stty -echo;
      expect_user {
        -re "(.*)\n$" { set site_password $expect_out(1,string); }
      }
      if !$emacs then { exec stty $stty; }
    } else {
      set site_password "-$env(USER)@eng.sun.com";
    }
    # Send the password
    if $anon then { send_user -- "$site_password" };
    send -- "$site_password\n";
    exp_continue;
  }
  -re "ftp> $" { send_user -- "$expect_out(buffer)"; }
}

send_ftp "binary";
send_ftp "hash";
send_ftp "prompt";

if $anon then { send_ftp "cd $dir"; }

interact;
'
# End of expect command!


--Multipart_Mon_Jan__6_18:10:48_1997-1--

