We're going to take you step by step to install a
program in your home direcotry. All these commands work with both
source codes in the same order, so give 'm both a try. We're going to
install a simple system monitor called torsmo. It sits in the corner of
your desktop, is very customizable and gives up to date system
information.
- 1. First we'll need to download the source archive, the
torsmo
website is hosted by sourceforge. Download the latest version, at time
of writing that is 0.18.
-
wget http://puzzle.dl.sourceforge.net/sourceforge/torsmo/torsmo-0.18.tar.gz
- 2. Most source files in a linux environment come with .tar.gz
extentions. This is commonly known as a tarball. the .tar
extention lets us know that the files are archived using tar.
The .gz extention tels us know that the archive is
compressed using gzip. You can uncompress and extract the
archive with one command.
-
tar xvzf torsmo-0.18.tar.gz
- 3. The archive should extract to the torsmo-0.18
directory. You'll need to go into that directory to compile the
sources.
-
cd torsmo-0.18
- 4. ./configure is a program you will find in many source
packages. It is created by the autoconf/automake suite, which creates
Makefiles specific to your setup and the flags you set. The most often
used flag is --prefix which allows the user to specify in which
directory the compiled sources will be installed. In our case we want
to install the sources in our home directory. Other flags include flags
that allow you to enable or disable certain features in the software.
For a complete list of these options run ./configure --help.
In our case we just want to install the program in our homedirectory
and leave all other options as default.
-
./configure --prefix=/home/[username]/
- 5. Now your Makefile is configured it is time to compile your
sources, this is simply done by running make, just like when you
compile a source using any Makefile.
-
make
- 6. If everything went correctly, you should not have any
compile errors. If you do, you can either try to debug them yourself,
or ask a proctor to help you out. The sources are simply in C and quite
simple to read and comprehend. Now we need to install the compiled
binary files and man pages for our program. This is simple done by
invoking the 'install' parameter of your Makefile. This will install
the files in the directory specified in the --prefix flag of your
./configure command.
-
make install
- 7. Now all your files are installed we'll need to customize
torsmo a little bit. There is a sample config file included with the
sources. We'll need to copy that to our home directory, and customize
it. The syntax is relatively easy so check it out!.
-
cp ~/torsmo-0.18/torsmorc.sample ~/.torsmorc
- 8. Now all is set and done all we need to do is run the
program. We'll have to do this from our homedirectory so cd
to that and then run the following command.
-
bin/torsmo