Installation
============

0. Installation for the impatients
----------------------------------
- unpack the tar file in e.g. /usr/lib/X11
- cd patience-1.8
- edit the Makefile, check lines 10, 11 and 20
- edit app-default, uncomment line 26
- make install

1. Installation of the executable Tcl program
---------------------------------------------

The choice where the executable program and the associated library
directory will be located, is a matter of taste. For me there are a
few candidates, which are listed in the table below.

 Executable Programm     	 Library directory
 -------------------		 -----------------
 /usr/games/patience        	 /usr/games/lib/patience-1.8
 /usr/bin/X11/patience      	 /usr/lib/X11/patience-1.8
 /usr/local/bin/patience    	 /usr/local/lib/patience-1.8
 /home/krischan/bin/patience	 /home/krischan/patience-1.8

Who ever installs the solitaire, must have write access to both of the
choosen directories. Then the solitaire can be installed by the
following few steps, replacing <binDir> and <libDir> with the
choosen directories.

- Making the directory superior to the choosen library directory
  the current one, e.g. by 'cd /usr/local/lib'
- Download the installations disk by 'tar xvzf /dev/fd0'. That is at least
  the way, it works out at my system. Maybe you must give another name
  like '/dev/floppy' or '/dev/rfd0H1440ds'. If the installation file is
  already on disk or on a mounted cd, you can unpack it with e.g
  'tar xvzf /tmp/patience-1.8.tgz'. Who owns a tar without the handy
  z option for uncompress, must use something like the following:
    gzip -cd /cdrom/longPathName/patience-1.8.tgz | tar xvf -
- Change into the newly created directory: 'cd patience-1.8'
- If you have already a wish of version 4, you can start
  right now the installation tool install.tcl. It is an
  english spoken Tk program, which offers all the following items as
  menu entries. Start with browsing through the Configure and
  Configure/app-default menus. There you can
  e.g. switch to english as default language of the game by
  Configure/app-default/sprache.
  You can create the patience executable by 'Make Patience'.
  A test game can be played by 'Make/(Make then) Start'.
  An installation of the whole thing is launched by
  'Make Installation'.

  If there is no new wish available or no X display is near
  or other reasons are against a graphical interface, you can continue
  with the installation by following the next four items.
- Using the editor of choise change the 'Makefile'; around
  line 10 set the following variables according to the local machine
  and/or to the personal taste.
  = WISH: This variable contains the complete path of the 
          Tcl/Tk interpreter. You can find it out (in Bourne-, Korn- or
          compliant shells) by means of calling 'type wish'. At my
          system the line goes like 'WISH = /usr/bin/wish'. 
          For using the functions in a battle solitaire
          with remote hosts, you must give the name of an interpreter shell,
          which includes the procedures of Tcl-DP. Normally the name of this
          shell is dpwish. The tar archiv with the distribution of
          Tcl-DP is called 'tcl-dp3.2.tar.Z' and you can get it by ftp at
          'mm-ftp.cs.berkeley.edu' in the directory '/pub/multimedia/Tcl-DP'.
  = LIB_DIR: This is the choosen <libDir>; at my system currently the line
             goes like 'LIB_DIR = /usr/lib/X11/patience-1.7'.
  = BIN_DIR: This is the choosen <binDir>, at my system currently the line
             goes like 'BIN_DIR = /usr/lib/X11/patience-1.7'.
  = CFLAGS: For compiling the extended patience interpreter 'patsh' there
            may be additional include directories, which contain the
            Tcl includefiles.
- Now call 'make patience'; after five to ten seconds everything should be
  ready to take off.
- Default language is german, but you can switch to english in the resource
  file 'app-default'. For this edit the file in the current directory and
  uncomment the line by removing the leading exclamation mark, so that it
  read as the following:
    *patience.sprache: english
- A test game can be started right now by calling './patience'. For playing
  it from every directory without typing the complete path, enter
  'make install'.

2. The extended interpreter
---------------------------

Who likes, can compile a c program 'patsh.c'; this happens by
means of the 'Makefile' and a call of 'make patc'. After
that you install the created program by 'make installc'.

Making 'patc' creates a patience interpreter 'patsh', too; it acts like
the ordinary Tk interpreter 'wish', but is extended by a procedure for
merging the cards and some central functions for checking the rules,
which are implemented in C and therefore a little bit faster.

3. Calling with different names
-------------------------------

If the program has the intern name of a known set of rules
(e.g. canfield), the game will start according to this rules.
Who likes, can play immediate a Canfield or Little Harp solitaire
after execution of the following commands.
  ln -s patience canfield
  ln -s patience klHarfe
This works also with the intern names of other, possible self made
sets of rules.

The name of the wanted set of rules can be given as parameter,
too. The battle solitaire e.g. can be started directly by calling
  patience -name streit

This way it is possible to create a submenu for the window manager,
which starts the game with any set of rules.
In the initialization file ~/.fvwmrc  of the fvwm window mananger
it goes like:

Popup "Patience 1.7"
  Exec "Standard"  exec patience &
  Exec "Kl. Harfe" exec patience -name klHarfe  &
  Exec "Canfield"  exec patience -name canfield &
  Exec "Spinne"    exec patience -name spider   &
  Exec "Streit"    exec patience -name streit   &
  Exec "Seahaven"  exec patience -name seahaven &
EndPopup

4. X-Resourcen
--------------

The program uses a few X resource variables, which can configure the
user interface. The table below is a listing of names, their
default values and their significance.

Resource      Default	     Meaning
warteZeit     10	     Default of Games/Wait <n> sec
rot           IndianRed4     Foreground color of Diamonds and Hearts
grau          gray80	     gray background color of stacks
weiss         gray95	     White background color of cards
xlogo         /usr/include/X11/bitmaps/xlogo11
                             Bitmap at the left in menubar
sprPath       <libDir>spiel  Directories to look for rule files
mitMischComic True	     Default of With comics/Shuffle 
mitBewegComic True	     Default of With comics/Movements
schatten      5              Default of With comics/Shadow height
mitStreitbar  False          Default of Games/Ready to compete
kartenFont    normal         Default of the card bitmaps
sprache       deutsch	     the language (deutsch or english)
daemonPort    4567           Port number of the patience daemon

The resources concerning colors (rot, weiss and
grau) only have effects on cards displayed as bitmaps;
for cards displayed as gif or pixmaps they have no effect.

The resources will be looked up at the following places with
increasing priority:
- the defaults given by the program itself, as in the table above;
- the systemwide installed resource file <libDir>/app-default);
- the resource file ~/.Xdefaults configured by the player;
- all resources set by 'xrdb -merge'

In a resourced file every assignment of a value to the resource goes
like this:
  *patience.<resourcename>: <value>
E.g., the Black/White-Font as default for the card bitmaps can be set by
  *patience.kartenFont: sw

5. Known errors
---------------

- The tip of the arrow has an incorrect y coordinate for
  compressed piles.

6. Future Improvements
----------------------
- All invisible cards (on the stack, reserve or penalty pile)
  should be deleted from the playing field to speed up the comics for
  dealing or movement of cards.

