The automated creation of such a tarball can be worked into the same
makefile that is used to build the software.
Preservation of resource forks is tricky, but possible, in this
method. For example, the following command preserves Macintosh
resource forks (where foo/ is a directory):
gnutar -pczf foo.tgz foo/
Every good tarball has a single top-level directory that contains
everything else. You should not create tarballs that dump their
contents into the current directory. To install software packaged
this way, you can use the following command:
gnutar -pxzf foo.tgz
This simply unpacks the tarball into the file and directory structure
that existed prior to packaging. Basically, it reverses the packing
step. This method can be used to simply write files to the
appropriate places on the system, such as
/usr/local/bin,
/usr/local/lib,
/usr/local/man,
/usr/local/include, and so on.