Readme for Petris v. 1.0.1

Petris is Peter's Tetris


"LICENSE"
  You can do whatever you want with the program, it's Public Domain.
  (however, it would be nice of you to credit me if you found anything
  of this useful).
  The above includes the permission to relicence the program under the
  MIT/X11 licence reproduced below:

---
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to
  deal in the Software without restriction, including without limitation the
  rights to use, copy, modify, merge, publish, distribute, and/or sell copies
  of the Software, and to permit persons to whom the Software is furnished to
  do so, provided that the above copyright notice(s) and this permission
  notice appear in all copies of the Software and that both the above
  copyright notice(s) and this permission notice appear in supporting
  documentation.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE
  LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR
  ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
  OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
---


BUILDING:
  To get the highscore facility working, you'll need to set the filename
  of the highscore file by editing "config.h" (if you want different users
  to share the same highscore file, please read the INSTALLING section below.)
  By editing this file you can also change the key bindings.

  Type "make" to build an executable file named "petris"; "make clean"
  will remove the created obj. files.


INSTALLING:
  As root, copy the executable file to a place in the normal PATH
  (/usr/local/bin is the right place).

  Now everyone can run the game, but what about the highscore file?
  Different people need access to it but on the other hand, user Joe
  should not be able to delete it just because user Lisa beat his
  highscore.
  
  I'm not a guru, and thus I'm not sure if the solution outlined below is
  neither good or secure -  but it works (for me at least).
  
  SOLUTION:
  
    Create a "petris" user by adding this line to the "/etc/passwd" file:
        petris:*:65533:65533:petris:::
    Which means a user who cannot log in and doesn't have any home.

    Then, as root, create the file "/var/local/petris/highscore"
    and change the ownership to "petris.nogroup". Also, set the per-
    missions of the file to "600"="rw-------" so only user petris
    can read/write the file.

    Now edit "config.h" to point to the new highscore file and
    compile. Copy the created executable to e.g. "/usr/local/bin".
    Change the ownership of the file to "petris.nogroup" and do
    a "chmod ug+s petris". Now, when someone runs the game, they
    will be running it as user petris and as such be able to read/
    write the highscore file.

  Finally, the manpage "petris.6" can be installed. For local
  installations put it in /usr/local/man/man6/. You may want to gzip
  the file.


RUNNING:
  You may invoke the program with a command line argument specifying
  the size of the well in the form [WIDTH]x[HEIGHT].
  Example: petris 12x25

  If you make enough points to get on the highscore list, the value of
  the "USER" environment variable will be used as your name in the new
  entry.

  IMPORTANT NOTE: After a CTRL-C abort of the game, sending the game
  to the background or some similar action, the cursor stays invisible.
  You can type "setterm -reset" to get it back.
  Currently, the cursor is only restored when leaving the program in
  the "normal" way.


COMPATIBILITY:
  The game has been tested and compiled on an x86 / Debian Woody but
  will probably work fine on any Linux Box.
  
  Other Unices may work too. However, this program depends on the
  select() system call to modify the contents of the timeval struct
  pointed to by the last argument to indicate the time remaining.
  Some systems never changes this value!


THANKS:
  Thanks to Andree Leidenfrost <aleidenf@bigpond.net.au> for providing
  the manpage.
  Thanks to Tom Mortell <tommortell@znet.com> for fixing a bug concerning
  the use of the USER environment variable.


CONTACT:
  Feel free to send feedback, bug-reports and other useful things to:

  Peter Seidler <seidler@phys.au.dk>
