QUICK INSTALL (requires root access)
==============================
Execute the following commands (for a more detailed description see below):

  ./configure
  make		# (check for usable shell)
  make test # (optional)
  make install

this is equivalent to the following commands (assuming that the dirs do exist)
  ./configure
  ./test.pl # (optional)
  cp lesspipe.sh /usr/local/bin

  # optional for colorizing and old openoffice writer formats
  cp code2color archive_color vimcolor sxw2txt lesscomplete /usr/local/bin

  # optional for zsh and bash completion (archive contents)
  cp lesscomplete /usr/local/bin           # (zsh and bash)
  cp _less /usr/share/zsh/site-functions   #(zsh)
  cp less_completion /etc/bashcompletion.d #(bash)

  # optional intallation of a man page
  cp lesspipe.1 /usr/local/share/man/man1

or INSTALL locally for the logged in user
=========================================
# if it contains a directory writable by you (e.g. ~/bin)
  mkdir -p ~/bin
  cp lesspipe.sh lesscomplete ~/bin
  # optional for colorizing and old openoffice writer formats
  cp code2color archive_color vimcolor sxw2txt lesscomplete ~/bin

# check your PATH variable, if it does not contain ~/bin then add it to PATH
  echo $PATH
  PATH=$PATH:~/bin # (put this line into an init script ~/.bashrc or ~/.zshrc)

# when using zsh then do similar steps for fpath and _less
  [[ -d ~/.fpath ]] || mkdir ~/.fpath
  cp _less ~/.fpath
  echo $fpath
  fpath=$fpath:~/.fpath # (put this statement in an int script .bashrc/.zshrc)

# for bash the file less_completion can be put into ~/.bash_completion
  [[ -d ~/.bash_completion ]] || mkdir ~/.bash_completion
  cp less_completion ~/.bash_completion

Then do set the environment variable LESSOPEN:

  LESSOPEN="|/usr/local/bin/lesspipe.sh %s"; export LESSOPEN  #(sh like shells)

  DO NOT OMIT THE VERTICAL BAR AS FIRST CHARACTER, IT IS ESSENTIAL !!!

Adapt the location of lesspipe.sh if you used another location.

Detailed description
====================

Prerequisites:
--------------
For a detailed discussion consult the file README starting with the section
'Required programs'. For best results up to date versions of 'file'
tar, gzip, bzip2 and some helper programs are highly recommended.

Step 1: create Makefile and lesspipe.sh using a different shell (optional)
--------------------------------------------------------------------------

 ./configure [--help] [--nomake] [--prefix=<path>] [--shell=<file>]

Options:
  --help                  print this message
  --shell=<filename>      specify full path to an alternative shell to use
  --nomake                do not generate a Makefile
Directory and file names:
  --prefix=PREFIX         install lesspipe.sh in PREFIX/bin (/usr/local)

configure generates by default a Makefile and if an alternate shell is
given, then also a changed lesspipe.sh.

Step 2: verify that lesspipe.sh is working correctly (optional)
---------------------------------------------------------------
A test suite has been added that does cover most use cases of less.
If the test suite reports "NOT ok" lines then lesspipe.sh
is probably not fully functional in your environment. If the message is
"ignored" it is usually an indication that some helper programs are
not installed. To execute the test suite the command

  make test
or
  ./test.pl [-e] [-n] [-v] [testnumber[s]] [file_name]

can be used. The options -e and -v are for debugging.

To get support for newer file types an additional magic file (e.g. ~/.magic,
for use in the file command) might have to be created. In that case the
environment variable MAGIC has to be set and has to contain both the system
magic file and your personal one. Example:

  MAGIC='/usr/share/file/magic:/Users/myaccount/.magic'
  export MAGIC

Step 3: install lesspipe.sh and helper programs
-----------------------------------------------------------------------
You can copy lesspipe.sh to any appropriate place.
Suggested location: /usr/local/bin/lesspipe.sh
The helper programs can be copied to the same directory as lesspipe.sh or any
directory listed in the PATH environment variable.
The archive_color script allows to colorize tar and other archive listings.

  cp lesspipe.sh code2color vimcolor sxw2txt archive_color /usr/local/bin

This can be achieved also with make:

  make install [PREFIX=<path>]  # that copies the scripts to <path>/bin

For zsh and bash a tab completion for archive contents is provided.
To activate it the script lesscomplete has to be copied into a directory
listed in $PATH, the _less function for zsh into a directory listed in $fpath
and less_completion into a directory used by its completion mechanism.

Step 4: activate lesspipe.sh
----------------------------
To make use of the installed lesspipe.sh set the environment variable LESSOPEN:
The use of the fully qualified path is recommended to avoid problems with other
scripts of the same name or with a changed search PATH:

  LESSOPEN="|/usr/local/bin/lesspipe.sh %s"; export LESSOPEN  #(sh like shells)
