Tetris-3.2.1
Administrative Notes

Listed below are the procedural steps we took in producing our /usr/local and /opt/ packages.

Getting Ready to Compile

  1. Obtain the original source code file from Open Group Desktop Technologies. Download the file to the /compiletmp/ directory.

  2. If you are not using the Borne shell, invoke the Borne shell now with the command:

    "/bin/sh"

  3. Move to the /compiletmp/ directory and unzip the file with the command:

    "gunzip tetris-3.2.1.tar.gz"

  4. After unzipping the file, untar the resulting tar file with the command:

    "tar -xof tetris-3.2.1.tar"

  5. After untarring the file, move to the /compiletmp/tetris-3.2.1 directory and create the Makefile using xmkmf. Before running xmkmf, you must first edit the Imakefile to set the correct compiler and installation directories. In its distributed form, the Imakefile is read-only, so begin by issuing the command:

    "chmod 644 /compiletmp/tetris-3.2.1/Imakefile"

  6. Now edit the Imakefile so that it contains the following lines:

    "CC = gcc"
    "DESTDIR = /usr/local/tetris-3.2.1/"
    "BINDIR = bin"
    "MANDIR = man/man1"


    In the line specifying "gcc", the assumption is made that "gcc" is in your search path. If "gcc" is not in your search path, you must completely specify the path to "gcc".

  7. With the Imakefile configured, you create the Makefile by issuing the command:

    "xmkmf"

  8. Finally, to compile tetris, and install it to the destination directories enter the following sequece of make instructions:

    "make"
    "make install"
    "make install.man"


    No other command-line arguments are necessary in the make instructions providing that:

    1. "make" is in your search path.
    2. You are in the "/compiletmp/tetris-3.2.1/" directory when you run "make".


Creating the "SOURCE.tar.gz" File

  1. Since we did not have to make any changes to the original source code files in order to compile them, we can distribute the source code files in their exact same state that we received them. Since you still have the file, "tetris-3.2.1.tar", in your "/compiletmp/" directory, you can create and store the final "SOURCE.tar.gz" File with the following sequence of commands:

    "mv /compiletmp/tetris-3.2.1.tar /compiletmp/tetris-3.2.1-SOURCE.tar" "gzip -9 /compiletmp/tetris-3.2.1-SOURCE.tar" "mv /compiletmp/tetris-3.2.1-SOURCE.tar.gz /storage-path"

    The above commands simply change the name of the source code file to fit our file naming convention, zips the file back up, and places it in storage. Of course, you will supply the actual storage path (rather than simply typing in /storage-path/).


Creating the "COMPILED.tar.gz" File (to run in /usr/local/)

  1. Go to the /usr/local/ directory and tar up the compiled binaries and libraries with the command:

    "tar -cf tetris-3.2.1-COMPILED.tar tetris-3.2.1"

  2. Zip the resulting tar file up with the command:

    "gzip -9 tetris-3.2.1-COMPILED.tar"

  3. Move the final COMPILED.tar.gz file to the appropriate storage area with the command:

    "mv /usr/local/tetris-3.2.1-COMPILED.tar.gz /storage-path/"

    Of course, you will supply the actual storage path (rather than simply typing in /storage-path/).

  4. Delete the entire make directory structure in /compiletmp/ by going to the /compiletmp/ directory and entering the command:

    "rm -R /compiletmp/tetris-3.2.1"


Preparing to Create the "USRPKG" and "OPTPKG" Packages

  1. In order to be certain that your COMPILED.tar.gz file is not corrupted, we shall begin by completely deleting the currently installed binaries from /usr/local.

    Do so with the command:

    "rm -R /usr/local/tetris-3.2.1"

  2. Copy the COMPILED.tar.gz from its storage area to /usr/local/ with the command:

    "cp /storage-path/tetris-3.2.1-COMPILED.tar.gz /usr/local"

  3. Move to the /usr/local directory and unzip the COMPILED.tar.gz file with the command:

    "gunzip tetris-3.2.1-COMPILED.tar.gz"

  4. Now, untar the COMPILED.tar file with the command:

    "tar -xof tetris-3.2.1-COMPILED.tar"

  5. Delete the COMPILED.tar file with the command:

    "rm tetris-3.2.1-COMPILED.tar"

  6. At this point the program should work. Be sure to test it before proceeding to the package-creation steps.


Creating the "USRPKG.tar" and "OPTPKG.tar" File

Once the program has been installed and tested in /usr/local/, the final steps for creating the distribution packages are identical for all programs. Click Here for details regarding the steps we take to produce the final "USRPKG.tar.gz" and "OPTPKG.tar.gz" files.


Please send comments to x86admin@sunsite.utk.edu