[CLUE-Tech] If I want to install a program to extract "rar" files?

Jed S. Baer thag at frii.com
Tue Mar 4 11:08:22 MST 2003


On Tue, 04 Mar 2003 07:17:21 -1000
Joe Linux <joelinux at earthlink.net> wrote:

> Perhaps at some future install fest you or someone 
> else could give instructions (private or small group lessons) on exactly
> how to install and uninstall these "tar.gz" type of applications.

To get started, many "tarball" program distributions contain a README file
and/or and INSTALL file. These will have varying levels of detail. Often
enough for anyone to proceed, although there can be some "gotchas".

The typical sequence:

  cd to your "build" directory tree.

    This directory is just whatever place you
    decide to use for doing builds. I use
    /opt/dist/tarball but it can be anything,
    like /apps or /home/{me}/programs/src. This
    "top level" is where the tarballs go too.

  unpack the tarball "tar -zxvf {package}.tar.gz"

    99.5% of the time, you'll get a new directory
    (if it doesn't already exist) named {package}

  cd {package}

  view the README and INSTALL files.

  configure for the build. at your prompt:

    $ ./configure [options]

    Usually, ./configure --help will get you a list
    of all possible options.

  make the package:

    $ make

  install the package: (as root)

    $ make install

Now, the part where you can customize is the ./configure step. If you want
the package to be installed in a particular location, you would use the
"prefix" option, e.g. ./configure --prefix=/usr/local/foo or (to avoid
becoming root to do the install step)
--prefix=/home/{me}/programs/{package}. The default is usually
--prefix=/usr/local. Be aware that "prefix" affects several options. This
is explained using ./configure --help.

The other part of building is having all the required dependencies. This
means not only the runtime libraries, but the header files used by the
compiler. For example, if you're building a gnome package, you'll need
some combination of the "devel" packages. In fact, use of "devel" seems to
be a de-facto standard for naming the package containing stuff you need to
compile using the stuff in the package. If you have these things in
non-standard locations, you need to tell configure where they are,
typically using the "--with-{package} option[s], where you
also specify the path to where they are. There are some variations on this
theme.

Some packages do not default to prefix=/usr/local. Apache for example,
defaults to /usr/local/apache/.

If you decide to create a seperate directory for each package, be aware
that you might be creating some issues, particularly with respect to the
locations of libraries and man pages. Think about how long your MANPATH
environment would be (the default location for the "man" directory is
under whatever you supply for "prefix"). If you're building libraries, I'd
advise
putting them under /usr/local, so that all programs needing them can find
them.

There are some other little tricks, such as setting compiler options
before doing the make:

  $ CFLAGS='-march=athlon'; make

and variations on that theme.

You can iterate this process many times without causing any damage at all.
If things don't turn out, just don't do the "make install". You can even
test the program before doing the install step -- typically, the finished
binary is in the "src" directory.

jed
-- 
I wouldn't even think about bribing a rottweiler with a steak that
didn't weigh more than I do. -- Jason Earl



More information about the clue-tech mailing list