#! /bin/sh
# mknetrc --- generate ~/.netrc from M4 macros
# Author: Noah Friedman <friedman@splode.com>
# Created: 1993-09-30
# Public domain

# $Id: mknetrc,v 1.48 2000/02/20 07:47:15 friedman Exp $

# Commentary:
# Code:

${M4-m4} ${1+"$@"} << '__EOF__'
# This .netrc file was automagically generated from etc/init/share/mknetrc.
# Edit that script and run it rather than editing this file directly.

divert(-1)dnl
# Apply first argument (as a macro) to all other arguments in turn.  This
# macro is tail-recursive but m4 doesn't optimize tail recursive calls,
# and as a result, if you have a long list, m4 may complain about
# exceeding its recursion limit.  In GNU m4 1.3 and later, this limit can
# be increased on the command line.
define(`foreach',
  `ifelse(`$2',`',,`$1(`$2')`'foreach(`$1', shift(shift($@)))')')

define(`NL',`
')dnl


define(`anonymous_login',    `ftp')
define(`anonymous_password', `friedman@splode.com')

define(`std_macdef_init', `macdef init
		  type binary
		  prompt off
		  tick on
		  quote site umask 000
		  quote site idle')

# Arguments:
#    $1 == hostname
#    $2 == login name (default anonymous_login)
#    $3 == password   (default anonymous_password)
#    $4 == additional macdef init commands
define(`defmachine',dnl
`divert(0)dnl
machine $1
ifelse($2, , `	login' anonymous_login`'NL,
       `	login' $2`'NL)dnl
ifelse($3, , ifelse(`$2', `', `	password' anonymous_password`'NL),
       `	password' $3`'NL)dnl
	std_macdef_init
ifelse($4, , ,
       `		 ' $4`'NL)

divert(-1)dnl
')

# hosts sans domain name
define(`defmachine_nodomain',
       `defmachine($1, `friedman')')


# splode.com machines

define(`splode_com_hosts',
       ``bacon',
        `bacon-von-munchausen',
        `dosar',
        `days-of-swine-and-roses',
        `fw',
        `gw',
        `porko',
        `porko-von-popbutton',
        `puerco',
        `puerco-del-diablo',
        `scones-of-silence',
        `suppenschwein',
        `trabanten-schwein',
        `www'')

define(`defmachine_splode_com',
       `defmachine($1`.splode.com', `friedman')')

foreach(`defmachine_splode_com',splode_com_hosts)
foreach(`defmachine_nodomain',splode_com_hosts)


# prv.splode.com machines

define(`prv_splode_com_hosts',
       ``alonzo-church',
        `bof',
        `bride-of-frankenswine',
        `exploder',
        `finger',
        `frankenswine',
        `hamlet',
        `localhost',
        `piglet',
        `slimebolix',
        `x'')

define(`defmachine_prv_splode_com',
       `defmachine($1`.prv.splode.com', `friedman', `friedman')')

foreach(`defmachine_prv_splode_com',prv_splode_com_hosts)
foreach(`defmachine_nodomain',prv_splode_com_hosts)


# GNU host entries

# alpha/melange is specifically not in this list so we can anonftp to it.
define(`gnu_org_hosts',
  ``delysid',
   `mail',
   `mescaline'')

define(`defmachine_gnu_org',
       `defmachine($1`.gnu.org', `friedman')')

foreach(`defmachine_gnu_org',gnu_org_hosts)


# MIT AI hosts

# These are hostaliases I use for prep.ai.mit.edu
defmachine(`ftp-prep',,,         `cd /pub/gnu')
defmachine(`fsf-prep', `fsf',,   `cd /gnu')

define(`ai_mit_edu_hosts',
       ``ftp',
        `gnu-life',
        `life',
        `zurich',
        `muesli',
        `rice-chex',
        `soggy-fibers'')

define(`defmachine_ai_mit_edu',
       `defmachine($1`.ai.mit.edu', `friedman')')

foreach(`defmachine_ai_mit_edu',ai_mit_edu_hosts)


# Inktomi machines

define(`inkt_hosts',
       ``castro',
        `cvs',
        `frick',
        `haight',
        `inside',
        `natoma',
        `puerco',
        `puerco-del-diablo'')

define(`defmachine_inkt',
       `defmachine($1`.inktomi.com', `friedman')')

foreach(`defmachine_inkt',inkt_hosts)
foreach(`defmachine_nodomain',inkt_hosts)


# Misc machines where I have accounts

define(`defmachine_friedman_hosts',
       `defmachine($1, `friedman')')

define(`defmachine_noah_hosts',
       `defmachine($1, `noah')')

define(`defmachine_nsf_hosts',
       `defmachine($1, `nsf')')

# Fr'ed'eric Chauveau <fmc@pasteur.fr> is my contact with the
# Pasteur Institute.
define(`friedman_hosts',
       ``actlab',
        `home.actlab.utexas.edu',

        `frob.com',
        `baal.frob.com',
        `baalperazim.frob.com',
        `baalperazim-rcn.frob.com',

        `totoro.red-bean.com',

        `bronze.lcs.mit.edu',
        `next.lcs.mit.edu',

        `central.pasteur.fr',
        `cleopatre.pasteur.fr',

        `splode.eterna.com.au'')

define(`noah_hosts',
       ``math.utexas.edu',
        `fireant.ma.utexas.edu',
        `linux63.ma.utexas.edu',
        `sp5-1.ma.utexas.edu'')

foreach(`defmachine_friedman_hosts',friedman_hosts)
foreach(`defmachine_noah_hosts',noah_hosts)


# Anonymous ftp machine with useful default directories

# Keith Gorlen <kgorlen@alw.nih.gov> maintains NIHCL
defmachine(`alw.nih.gov',,,                `cd /pub/NIHCL')

defmachine(`anubis.ethz.ch',,,             `cd /sandy/efs')

# Useful archive.cis.ohio-state.edu directories:
#    /pub/gnu/emacs/elisp-archive  (moved to /pub/emacs-lisp)
#    /pub/console-server
defmachine(`archive.cis.ohio-state.edu',,, `cd /pub/emacs-lisp')

# Mailing lists relating to PCL:
#   CommonLoops@Xerox.com    --- Announcements, bug reports, fixes, etc.
#   CommonLoops.pa@Xerox.com --- Send comments, bug reports, suggestions.
defmachine(`arisia.xerox.com',,,           `cd /pub/pcl')

defmachine(`cs.cmu.edu',,,                 `cd /afs/cs.cmu.edu/user/ralf/pub')

# GNU Ada Translator
defmachine(`cs.nyu.edu',,,                 `cd /pub/gnat')

# also /pub/mgleason/getline.tgz, an alternative to readline
defmachine(`cse.unl.edu',,,                `cd /pub/mgleason/ncftp')

defmachine(`ftp-swiss.ai.mit.edu',,,       `cd /pub/su/scsh')

defmachine(`ftp.ccil.org',,,               `cd /pub/esr/fetchmail')

# See also /ucb/tcl.
defmachine(`ftp.cs.berkeley.edu',,,        `cd /ucb/4bsd')

# The Common Lisp Repository
# See also /afs/cs/user/campbell/http/ilisp/
defmachine(`ftp.cs.cmu.edu',,,             `cd /user/ai/lang/lisp/')

defmachine(`ftp.cs.hut.fi',,,              `cd /pub/ssh')

# WWW client for emacs
# Also some Scheme code in /pub/scheme (e.g. hygienic macro package,
# syntax-caseV2.0.tar.Z)
# Also /pub/scheme-repository/imp/STk-2.1.tar.Z
defmachine(`ftp.cs.indiana.edu',,,         `cd /pub/elisp/w3')

defmachine(`ftp.cs.purdue.edu',,,          `cd /pub/RCS')

defmachine(`ftp.cs.tut.fi',,,              `cd /pub/src/languages/schemes')

defmachine(`ftp.cs.ucla.edu',,,            `cd /pub/ispell')

# Holds papers about garbage collection, persistence,
# and memory hierarchy implementation.
# See also: /source/util/vmsbackup
defmachine(`ftp.cs.utexas.edu',,,          `cd /pub/garbage')

# Instructions for retrieving TeX & Metafont are in /pub/tex/FTP.nwc
defmachine(`ftp.cs.umb.edu',,,             `cd /pub/tex')

# Emacs for Win95/NT
defmachine(`ftp.cs.washington.edu',,,      `cd /pub/ntemacs')

defmachine(`ftp.cs.wisc.edu',,,            `cd /pub/ghost')

# Also possibly /pub/DBS/OBST
defmachine(`ftp.fzi.de',,,                 `cd /pub/OBST')

# Infocom compiler and (free) game repository
# e.g. Curses is available in the file
# `if-archive/infocom/compilers/inform/curses.z5'
defmachine(`ftp.gmd.de',,,                 `cd /if-archive/infocom')

defmachine(`ftp.gnu.org',,,                `cd /pub/gnu')

# There are two mailing lists for majordomo:
# "Majordomo-Users" (for discussions of Majordomo) and
# "Majordomo-Announce" (for announcements of new releases).
# To subscribe, send an appropriate "subscribe" command to
# "Majordomo@GreatCircle.COM".
defmachine(`ftp.greatcircle.com',,,        `cd /pub/majordomo')

# ILISP sources available here
# See also /pub/theory/marcoxa/elisp
defmachine(`ftp.icsi.berkeley.edu',,,      `cd /pub/software/elisp')

# Officially-registered port numbers, country codes, system names, etc.
defmachine(`ftp.isi.edu',,,        `cd /in-notes/iana/assignments')

# Location of `tm', a MIME package for emacs
defmachine(`ftp.jaist.ac.jp',,,    `cd /pub/GNU/elisp/mime/beta')

# /pub/systems/conserver-5.11.anl.tar.Z is modified version of the console
# server in archive.cis.ohio-state.edu:/pub/console-server/
defmachine(`ftp.mcs.anl.gov',,,            `cd /pub/systems')

defmachine(`ftp.smli.com',,,               `cd /pub/tcl')

defmachine(`ftp.uni-erlangen.de',,,        `cd /pub/utilities/screen')

defmachine(`ftp.vix.com',,,                `cd /pub/bind')

# Maintained by Richard Levitte <LEVITTE@e.kth.se>
defmachine(`ftp.vms.stacken.kth.se',,,     `cd /MIRRORS/GNU-VMS')

defmachine(`ftp.white.toronto.edu',,,      `cd /pub/es')

defmachine(`ftp.xemacs.org',,,                `cd /pub/xemacs')

defmachine(`ftp2.cc.ukans.edu',,,          `cd /pub/lynx')

# Fortran to Common Lisp converter!!
defmachine(`ftphost.cs.waikato.ac.nz',,, `cd /pub/lisp/f2cl')

# Alpha tests of the netfax software can be found here.
# The maintainer is Jim Mintha <mintha@geog.ubc.ca>
defmachine(`leghorn.geog.ubc.ca',,,        `cd /pub/fax')

defmachine(`kermit.columbia.edu',,,        `cd /kermit')

# GWM master sources, binaries, and patches.
# See also http://www.inria.fr/koala/gwm
defmachine(`koala.inria.fr',,,             `cd /pub/gwm')

# Bruno Haible <haible@ma2s2.mathematik.uni-karlsruhe.de> has been the
# maintainer in the past.  He says that Marcus Daniels
# <marcus@ee.pdx.edu> is now doing most of the active development.
defmachine(`ma2s2.mathematik.uni-karlsruhe.de',,, `cd /pub/lisp/clisp/source')

defmachine(`mach.cs.cmu.edu',,,            `cd /')

# GNU Common Lisp (formerly, Austin Kyoto Common Lisp)
# As of 1994-04-30, latest release is gcl-1.0.tgz
# Also try ftp.cli.com:/pub/gcl (less bandwidth here)
defmachine(`math.utexas.edu',,,            `cd /pub/gcl')

# metalab is the new name for sunsite.
defmachine(`metalab.unc.edu',,,             `cd /pub/Linux')
defmachine(`sunsite.unc.edu',,,             `cd /pub/Linux')

# Project Gutenberg texts
defmachine(`mrcnext.cso.uiuc.edu',,,       `cd /etext')

# David M. Gay <dmg@research.att.com> is the f2c maintainer
defmachine(`netlib.att.com',,,             `cd /netlib/f2c')

defmachine(`nexus.yorku.ca',,,             `cd /pub/scheme')

# Also mirrors DJGPP and is often easier to get to than ftp.clarkson.edu
defmachine(`oak.oakland.edu',,,            `cd /pub/msdos/gnuish')

# Project Gutenberg texts (mirror)
defmachine(`oes.orst.edu',,,               `cd /pub/almanac/etext')

# Via WWW, use URL http://www.cs.washington.edu/research/jair/home.html
defmachine(`p.gp.cs.cmu.edu',,,            `cd /usr/jair/pub')

# ANSI CL draft
defmachine(`parcftp.xerox.com',,,          `cd /pub/cl/dpANS2')

# has unzip sources and binaries
defmachine(`quest.jpl.nasa.gov',,,         `cd /pub')

defmachine(`slc2.ins.cwru.edu',,,          `cd /pub/dist')

# Has patches for various AIX programs, etc.
# For example, patches for the rlogind security hole of May 1994
# Are in /pub/aix/rlogin/rloginX.tar.Z where X is the highest revision
# number for their patch.
defmachine(`software.watson.ibm.com',,,    `cd /pub')

# Bozo Software Foundation archive
# defmachine(`soltrans.cr.usgs.gov',,,       `cd /pub/bozo')
defmachine(`splode.mame.mu.oz.au',,,        `cd /bozo')

defmachine(`tsx-11.mit.edu',,,             `cd /pub/linux')

# wwfs is a fancier transparent ftp than alex.
defmachine(`wwfs.aist-nara.ac.jp',,,       `cd /WWFS/dist')


# Mac software sites
defmachine(`ftp.cc.utexas.edu',,,          `cd /microlib/mac')

# seems to be dead as of 1998-08-18
dnl defmachine(`sumex-aim.stanford.edu',,,     `cd /')

defmachine(`ftp.cso.uiuc.edu',,,       `cd /pub/systems/mac/info-mac')


# Hosts which are convenient to have in the efs cache for completion.

# Useful files on ftp.cygnus.com:
#   pub/bothner/eterm-0.95.tar.gz
#   pub/lord/guile-ii.tar.gz
defmachine(`ftp.cygnus.com',,,             `cd /pub')

# Useful ftp.uu.net directories:
#   ftp://ftp.uu.net/government/usa/house
#   ftp://ftp.uu.net/government/usa/supreme-court
#   ftp://ftp.uu.net/networking/mail/vm
#   ftp://ftp.uu.net/systems/gnu
#   ftp://ftp.uu.net/inet/rfc
#   ftp://ftp.uu.net/inet/maps
#   ftp://ftp.uu.net/languages/emacs-lisp (mirror of elisp archives)
#   ftp://ftp.uu.net/systems/unix/bsd-sources
defmachine(`ftp.uu.net',,,                 `cd /networking/mail/vm')

# ftp.x.org used to be export.lcs.mit.edu
defmachine(`ftp.x.org')

# Useful wuarchive.wustle.edu directories:
#   /packages/wuarchive-ftpd  (sexy ftpd)
#   /systems/ibmpc/msdos/demacs
defmachine(`wuarchive.wustl.edu')


# Special hostaliases for prep.ai.mit.edu

defmachine(`ftp-prep',      ,, `cd /pub/gnu')
defmachine(`fsf-prep', `fsf',, `cd /gnu')

# Don't use defmachine for prep.ai.mit.edu, since I need to access it
# with multiple usernames.  I use this name if hostaliases are not working.
machine prep
	std_macdef_init
		  umask 022

machine prep.ai.mit.edu
	std_macdef_init
		  umask 022


# Some versions of ftp don't recognize the `default' keyword, and
# interpret this entry as part of prep's entry above, causing errors.
# This entry prevents that from happening.
divert(0)dnl
machine zzz.bogus

divert(-1)dnl

# Default entry for all other connections
divert(0)dnl
default	login anonymous_login
	password anonymous_password
	std_macdef_init


divert(-1)dnl

__EOF__

# Local Variables:
# compile-command: "./mknetrc > $HOME/.netrc"
# End:

# mknetrc ends here
