Listed below are the procedural steps we took in producing our
/usr/local
and /opt/ packages.
Getting Ready to Compile
- Obtain the original source code file from
Open Group Desktop Technologies.
Download the file to the /compiletmp/ directory.
- If you are not using the Borne shell, invoke the
Borne shell now with the command:
"/bin/sh"
- Move to the /compiletmp/ directory and unzip the file with the command:
"gunzip tetris-3.2.1.tar.gz"
- After unzipping the file, untar the resulting tar file with the command:
"tar -xof tetris-3.2.1.tar"
- 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"
- 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".
- With the Imakefile configured, you create the Makefile
by issuing the command:
"xmkmf"
- 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:
- "make" is in your search path.
- You are in the "/compiletmp/tetris-3.2.1/" directory when you run
"make".
Creating the "SOURCE.tar.gz" File
- 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/)
- 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"
- Zip the resulting tar file up with the command:
"gzip -9 tetris-3.2.1-COMPILED.tar"
- 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/).
- 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
- 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"
- 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"
- Move to the /usr/local directory and unzip the COMPILED.tar.gz
file with the command:
"gunzip tetris-3.2.1-COMPILED.tar.gz"
- Now, untar the COMPILED.tar file with the command:
"tar -xof tetris-3.2.1-COMPILED.tar"
- Delete the COMPILED.tar file with the command:
"rm tetris-3.2.1-COMPILED.tar"
- 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.