home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 035 / ncftpb4.zip / README < prev    next >
Text File  |  1994-08-27  |  17KB  |  360 lines

  1. If you are a novice user, and don't know how to compile things, try
  2. contacting your local guru first (get them to do it for you :-).  Please
  3. understand that I don't have time to walk newbies through the whole
  4. installation procedure.
  5.  
  6. One of these months, I will write a Configure script that does all this for
  7. you. I just don't have time to learn another language (dist-3.0) just to
  8. write the script! Perhaps for 2.0.
  9.  
  10. 1. READ this entire file.  Part A, below, tells what to do if you want to
  11.    use NcFTP with a command-line editor.  Part B tells you how to configure
  12.    the Makefile to compile the program for your system.  Part C tells you
  13.    how to configure NcFTP's optional features.  Part D tells you how to
  14.    contact me if you want to report a bug or submit new code to the
  15.    program.
  16.  
  17. 2. EDIT the Makefile, making any necessary changes described in parts
  18.    A, B, or C.  Don't forget to read the directions in the Makefile,
  19.    so you don't forget any needed libraries, etcetera.
  20.  
  21. 3. You can also change the program's default behavior by editing defaults.h.
  22.    99% of the time you don't need to do this, so you can skip this step.
  23.  
  24. If you have problems, you can mail me, but please try your best to install
  25. it without my help.  I'm quite tired of responding to lazy SunOS users
  26. because they didn't bother reading the directions so that they would have
  27. known that they needed to use GCC.  
  28.  
  29. I _do_ want to hear from you if you have comments or bug reports/fixes.  I
  30. would also like to hear from you if you had a system that wasn't covered
  31. in sys.h, so I can add an entry for other users of your system.
  32.  
  33. The latest version of ncftp is available in the directory:
  34.     cse.unl.edu:/pub/mgleason
  35. This machine is heavily used by students and faculty alike, so please
  36. do not call during working hours (9AM - 5PM American Central time).  In fact,
  37. I have a cron entry that changes all the file permissions to public
  38. unreadable during that period, so you won't be able to download anyway.
  39.  
  40. I am grateful to Shari Deiana and the University of Nebraska for making this
  41. possible!
  42.  
  43.  
  44. Part A.  Installing with a command line editor:
  45. ----------------------------------------------
  46.  
  47. As of this release, GNU Readline and Chris Thewalt's Getline command-line
  48. editing and history facilities are supported.  Neither are included with the
  49. ncftp sources.  You can find Getline at:
  50.   ce.berkeley.edu:/pub/thewalt/getline.tar.Z  (note: use 'ls', not 'dir!')
  51. and Readline is in the directory:
  52.   prep.ai.mit.edu:/pub/gnu
  53.  
  54. To install Readline, you will need to know where libreadline.a and the
  55. header <readline/readline.h> are.  You will need to link libreadline.a and
  56. libcurses.a (or libtermcap.a) with ncftp (see the Makefile).  Good luck on
  57. trying to compile it.  It is not an easy thing to do!  In the Makefile, you
  58. will need to add -DREADLINE to PDEFS, add -lreadline -lcurses to LIBS, and
  59. edit the HDRDIRS and LIBDIRS lines.  This stuff is already in the Makefile,
  60. so you can just uncomment it.
  61.  
  62. To install Getline, you need to know where libgetline.a and it's header
  63. (getline.h) are.  In the Makefile, you'll need to add -lgetline to LIBS and
  64. edit the HDRDIRS and LIBDIRS lines.  This stuff is already in the Makefile,
  65. so you can just uncomment it.
  66.  
  67. DO NOT bug me if you can't figure out how to compile Getline or Readline.
  68. Contact their respective authors instead.  It is not essential that you use
  69. them.
  70.  
  71.  
  72. Part B.  System Dependencies:
  73. ----------------------------
  74.  
  75. NcFTP may need work-arounds for some things due to the differences
  76. in implementations of unix.  The following systems are taken care
  77. of automatically.  For these systems, you should just be able to type
  78. 'make' (but proceed to part C):
  79.  
  80.    Silicon Graphics IRIX
  81.    IBM's AIX
  82.    SINIX
  83.    DEC's Ultrix (well, might need to use -lcursesX instead of -lcurses)
  84.    NeXT
  85.    Pyramid OSx
  86.    Berkley Software Design, Inc.'s BSDi
  87.  
  88. Otherwise you will have to configure ncftp manually.
  89.  
  90. Important for "Yellow Pages" users:  Don't forget to link the library
  91. that includes the YP/NIS version of getpwuid(), etc.  Otherwise the program
  92. won't be able to expand ~username/path/name type pathnames, and maybe even
  93. ~/path/name types of pathnames.  If you're wondering why the program isn't
  94. opening your rc file, this could be the cause.
  95.  
  96. You will need to add these things to the SDEFS line in the Makefile
  97. as applicable.  As an example, if I say 'add -DFoobar to SDEFS,' find
  98. the line in the Makefile that reads 'SDEFS=' (or 'SDEFS=-DFoo2') and
  99. change it to 'SDEFS=-DFoobar' (or 'SDEFS=-DFoo2 -DFoobar).  If your
  100. system is listed below, follow the directions and then you ready to
  101. go to part C, below.
  102.  
  103.     Sun Microsystems' SunOS/Solaris:  Use an ANSI compiler such as
  104.       gcc (set CC=gcc in the Makefile), or acc (set CC=acc).
  105.       The regular 'cc' is not an ANSI compiler.  You could also run
  106.       something like 'ansi2knr' on the sources and hope it works.
  107.       You will probably need to link both the curses and termcap
  108.       libraries if you use -DCURSES (see below).  If you're running
  109.       Solaris (SunOS 5.x or greater) add -DSolaris to SDEFS.
  110.       I also needed to add -lnsl -lsocket to LIBS.
  111.  
  112.     Hewlett-Packard HP-UX:  If you have 7.0, you'll need to find
  113.       a copy of <ftp.h> from somewhere (8.0 has it though). Then
  114.       set CFLAGS= -Aa.  You may also need to use gcc if your
  115.       compiler is non-ANSI.  Note that for HP-UX, the default
  116.       terminal escape codes are for HP terminals, so you should
  117.       probably link termcap/curses in so it will get the ANSI
  118.       sequences if you're on a vt100, etc., terminal connected
  119.       to your HP-UX machine.
  120.  
  121.     Linux:  For 'term' support, from what I can tell just add
  122.       the path of 'client.a' to LIBS, and add -DTERM_FTP to SDEFS,
  123.       to turn on the term specific ftp code.  May need to link
  124.       -lcurses and -ltermcap.
  125.       
  126.     SCO Unix:  Add -DSCO324 or -DSCO322 (as appropriate) to SDEFS,
  127.       and -lsocket to LIBS.
  128.  
  129.     SCO Xenix 2.3.4: Add -DSCOXNX to SDEFS;
  130.         Try adding -DLINGER if puts don't work.
  131.         Add "-lsocket -ldir" to LIBS.
  132.  
  133.     Bull DPX/2: Add -DBULL to SDEFS, add -linet to LIBS, and
  134.       use gcc.
  135.  
  136.     Sequent's DYNIX: Use gcc and add -DDYNIX (if necessary) to SDEFS.
  137.       You may also be short several string functions which you will
  138.       have to get elsewhere, and perhaps mktime and strftime.
  139.       You can get all that stuff from the BSD sources (like ftp.uu.net).
  140.       Please bug Sequent to update their libc library!
  141.  
  142.     Sequent's Dynix/PTX:  Add -DDYNIXPTX to SDEFS.
  143.       Add -lsocket -linet -lnsl -lseq to LIBS.
  144.  
  145.     DEC OSF1/1.3:  Use gcc, Add -DGETCWDSIZET to SDEFS.  cc might work,
  146.      though.  Try cc if gcc chokes.
  147.  
  148. If your system doesn't fit any of those, things will be trickier.  Answer
  149. all these questions and add to the SDEFS line.  You may want to try
  150. each option one at a time until everything works.
  151.  
  152. *  Is your system closer to System V or BSD?  Your SDEFS line should have
  153. either -DBSD or -DSYSV.  If you don't know, try leaving it blank first;
  154. some compilers automatically define it for you.
  155.  
  156. *  Add -DNO_CONST if your compiler chokes on the const directive.  You
  157. will know if you need to add this if the compiler spits out errors saying
  158. it doesn't know what 'const' is.
  159.  
  160. *  As I said above, you will need to link special libraries if your system
  161. is running Yellow Pages.
  162.  
  163. *  Add -DSYSSELECTH if you need <sys/select.h> included for definitions
  164. of fd_set, etc.
  165.  
  166. *  Add -DNO_UNISTDH if you don't have <unistd.h>.  If the compiler complains
  167. about not being able to open <unistd.h> add this.
  168.  
  169. *  Add -DNO_STDLIBH if you don't have <stdlib.h>.  If the compiler complains
  170. about not being able to open <stdlib.h> add this.
  171.  
  172. *  Add -DNO_UTIMEH if you don't have <utime.h>.  If the compiler complains
  173. about not being able to open <utime.h> add this.
  174.  
  175. *  Add -DNO_MKTIME if you don't have the mktime() system call, and don't
  176. feel like getting the source for it and compiling it in with the program.
  177. If you define this, the program will not set the file modification times
  178. to match the ones on the remote host (no big deal).
  179.  
  180. *  Add -DGETPASS if you would rather use the standard getpass() system
  181. call, instead of our version, Getpass(), which takes more than 8
  182. characters.  You may want to define this if you are having problems
  183. compiling getpass.c.
  184.  
  185. If you haven't given up on our Getpass(), you can try adding -DSGTTYB
  186. if you want to use a struct sgttyb instead of a struct termio.  By default,
  187. BSD systems define SGTTYB automatically.  You can also try adding -DTERMIOS
  188. to use a POSIX compliant struct termios instead.  Don't pull your hair out
  189. trying to get the Getpass code to compile;  if it gives you problems just
  190. define -DGETPASS and hope your system's getpass can handle passwords
  191. longer than 8 characters.
  192.  
  193. *  Add -DBAD_INETADDR if your inet_addr() function returns a struct in_addr
  194. instead of a u_long, as it should (in DG/UX 5.4.1).
  195.  
  196. *  Add -DBROKEN_MEMCPY if ncftp mysteriously dumps core when trying to open
  197. a remote host.  I'm told that this happens because of some problem in System
  198. V's sockets don't like fprintf (and memcpy).
  199.  
  200. *  Add -DPTRTYPE=char if your pre-ANSI compiler complains about the
  201. way malloc() or free() are used, and in general does not like (void *)
  202. as a generic pointer type.
  203.  
  204. *  Add -DNO_STRFTIME if your system does not have strftime().  If you do,
  205. we won't try to use it.  This means, however, you cannot use ``%'' values
  206. in your prompt.
  207.  
  208. *  Add -DNO_RENAME if your system does not have rename() (or the one it
  209. has is broken).  If you do, we will use our own.
  210.  
  211. *  Add -DNO_STRSTR if your system does not have strstr().  If you do, we
  212. will use our own.
  213.  
  214. *  Add -DLINGER if puts to the remote system are incomplete.
  215.  
  216. *  Add -DNET_ERRNO_H if you need to include <net/errno.h> for definitions
  217.    of ECONNREFUSED, etcetera.
  218.  
  219. *  (Optional) Add -DGETCWDSIZET if your system's getcwd() takes a size_t
  220. as the second parameter instead of an int.
  221.  
  222. *  (Optional) Add -DHERROR if you know you have the herror() system
  223. call.
  224.  
  225. *  (Optional) Add -DU_WAIT if you know your wait system call takes
  226. a pointer to a 'union wait.'  Defined automatically if you define
  227. BSD.
  228.  
  229. *  (Optional) Add -DHOSTNAME=\"machine.domain.nam\" if your system
  230. doesn't generate it's own hostname.  To check this, compile ncftp
  231. then run it and type 'set.'  Look at the variable anon-password.
  232. If the hostname is wrong, or if it is in the form of 'yourlogin' or
  233. 'yourlogin@machine' instead of 'yourlogin@machine.xxx.yyy,'
  234. re-compile it with HOSTNAME set to your machine's address, in the
  235. form of 'machine.xxx.yyy.'
  236.  
  237. *  (Optional) Add -DHAS_DOMAINNAME if you have the getdomainname()
  238.    function.
  239.  
  240. *  (Optional) If you're having problems with your hostname not being
  241. full (i.e you have 'yourlogin@machine') all is not lost.  First of all,
  242. define HAS_DOMAINNAME if you can.  But sometimes getdomainname() doesn't
  243. work -- instead of giving you the domain name, it returns an empty
  244. string.  So you can hardcode the domain name by defining DOMAIN_NAME to
  245. be the domain (i.e. add -DDOMAIN_NAME=\"domain.nam\").  That way, if
  246. getdomainname doesn't work, the program will have something to fall back
  247. on.  This problem is common on SunOS/Solaris.
  248.  
  249. *  (Optional) Add -DSTRICT_PROTOS if your compiler wants function prototypes
  250. for all functions, not just non-int-returning ones.  This is really just
  251. handy for debugging during development, so this is not recommended.
  252.  
  253.  
  254. Part C.  Program Options:
  255. ------------------------
  256.  
  257. Add these as applicable to the PDEFS line in the Makefile.
  258.  
  259. * -DGZCAT=\"path\": If you have the GNU gzip package installed on your system,
  260.     the program can try paging remote files compressed with gzip _and_ 
  261.     compress (instead of just compress).  Add -DGZCAT=\"/full/path/to/zcat\"
  262.     with GZCAT set to the path name of GNU's zcat/gzcat.
  263.  
  264. *   -DCURSES:  Uses curses library to display boldface, underline, etc.
  265.     By default ncftp uses hard-coded ANSI escapes (^[[1m etc.) to
  266.     save the 100k or so the curses library adds.  You will also need
  267.     to edit the LIBS line in the Makefile to add -lcurses.  You may
  268.     need to add -ltermcap instead, or both -lcurses and -ltermcap.
  269.     If you choose to use the termcap library, you may want to also add
  270.     -DNO_CURSES_H so it does not try to include <curses.h>.
  271.  
  272. *   -DSYSLOG:  Define this to have ncftp log connections and transfers
  273.     to the syslog.
  274.  
  275. *   -DNO_TIPS:  Define if you want to cut a little fat at the expense of
  276.      novice users.
  277.  
  278. *   -DGETLINE: If you want to use Chris Thewalt's getline input line editor
  279.     and history facility, add this (and see below).
  280.  
  281. *   -DREADLINE:  If you want to use GNU's readline input line editor and
  282.     history facility, add this (and see the Makefile). If you do this, you
  283.     also need to add -DCURSES (see above).
  284.  
  285. *    -DSOCKS: NcFTP is now compatible with the Socks library by David Koblas,
  286.     at koblas@sgi.com.  This lets you use NcFTP with a "firewall" gateway
  287.     for enhanced site security.  You can get the latest version from
  288.     netcom.com:/pub/koblas.  After you have compiled it, compile NcFTP
  289.     with -DSOCKS added to PDEFS, and the pathname of the Rconnect.o file
  290.     added to LIBS.
  291.     
  292. *    -DTRY_ABOR:  Define if you want to try the 'ABOR' command from ncftp;
  293.     The aborting code has had some problems, so by default the program
  294.     'aborts' by continuing to read input but not echoing output.
  295.  
  296. *   -DDB_ERRS:  Define this if you want my Perror() function to be more
  297.     verbose.  You may want to do this if you are a programmer examining this
  298.     code, and want to know where in the source the Perror's are coming
  299.     from.
  300.  
  301. Part D.  Sending me patches:
  302. ---------------------------
  303.  
  304. I apologize in advance for problems that my coding style may cause.  The code
  305. itself is formatted such that each indent-level is a tab (intended to be
  306. equivalent to 4 spaces), and not spaces nor a combination of tabs and spaces.
  307. The reason for this, besides being more logical to me, is that I use a
  308. Macintosh editor to compose the code and I prefer it's indenting method.
  309. Another problem in my coding-style is that I write C-code intended for ANSI
  310. C compilers.  This means that I will use the new-style function declarations
  311. and function prototypes, like:
  312.  
  313.  
  314.    long Foobar(long, long, char *);
  315.    long Foobar(long t0, long t1, char *str)
  316.    {
  317.    }
  318.  
  319. as opposed to:
  320.  
  321.    long Foobar();
  322.    long Foobar(t0, t1, str)
  323.        long t0, t1;
  324.        char *str;
  325.    {
  326.    }
  327.  
  328. Another thing may annoy you is that I always use function prototypes for any
  329. function I call, including functions that return an int.  This is a good
  330. practice that I learned from the Macintosh programming world.  
  331.  
  332. So if you send me patches, please conform to my coding style so that 'patch'
  333. won't screw up, and also that some continuity will be preserved.
  334.  
  335. Before you make your patch, you should be sure that you are using the most
  336. current version of the program.  This is especially important if you are
  337. reporting a bug; I may have already fixed it!  See the above info to get it
  338. via ftp.  Major versions are always posted to comp.sources.misc.  Bug reports
  339. are posted to comp.sources.bugs.  Patches that need to be posted ASAP are
  340. posted to this group first, so it is advisable that you check this group.
  341.  
  342. If you make changes to the code, surround your code in #ifdef/#endif blocks.
  343. Instead of doing things like #ifdef SunOS, use a name that describes the
  344. bug fix or feature, and not your system type, like #ifdef NO_UNISTDH,
  345. or #ifdef GETLINE.  That way in case another system has the same problem,
  346. it can be added to sys.h without cluttering up the source code.  Then, add
  347. the symbol you used to the end of cmds.c, in the 'CPP Hell' part of the
  348. version() command.  You'll see a list of CPP symbols, so just add yours in
  349. a similar fashion, like #ifdef GETLINE/DStrs[nDStrs++] = "GETLINE";/#endif.
  350.  
  351. If you don't know how to make a patch, here's how to do it.  Things are easy
  352. if you've only changed one file.  Then all you need to do pipe the output of
  353. diff -c into a file and send it to me, i.e. "diff -c cmds.c cmds.c.hack >pch."
  354. If you've hacked several files, the way I do it is to keep the originals in
  355. one directory (you did make a copy of everything first didn't you?) and the
  356. revisions in another directory.  Then you change directory to the one with the
  357. originals and do "diff -c . ../revisions > ../pch."
  358.  
  359. --mg (mgleason@cse.unl.edu)
  360.