Configuring software

After you've downloaded and uncompressed your new software, you'll have to configure and tweak it to conform to your system. In general, the changes you'll make will be things like:

  • Adjusting path names (e.g., to install it into /home/yourid/bin rather than into /usr/local/bin, where you likely cannot install software).

  • Specifying what kind of UNIX system you're working on.

  • Inserting your e-mail address and similar data.

  • Choosing one of two or three system-specific settings. What to choose for each system is clearly marked in the files you'll be using.

If you're installing a program that will be compiled, your steps will closely resemble these. If you're installing a script, the steps will likely differ somewhat, but go ahead and read through these steps because the principles of what to change are the same for scripts and programs.

Precisely what changes you'll have to make (in programs or scripts) are almost always documented in the README file that comes with the software, in the Makefile (in the case of programs), or in the actual .pl or .sh files that you'll run (in the case of scripts). (See Code Listing 14.2.) So be sure to read these files! The steps in this section assume that you're starting in the main directory of uncompressed and untarred files that you downloaded.

To configure software:

1.
more README*

To begin, type more README* at the shell prompt to see the README file one screen at a time. This file should give you installation instructions as well as information about what details you need to provide. Code Listing 14.2 shows part of rpm's README file.

2.
ls configure

Type ls configure to see if there's a file named configure in the current directory.

  • If you have a configure file, just continue to step 3.

  • If you don't have a configure file, skip ahead to step 4.

3.
./configure

Usually you can just enter ./configure to run configure and let the configuration happen by itself (Code Listing 14.3), though you may have a little more to do. configure makes a special Makefile, just for you, which makes the next steps much easier.

Code Listing 14.2. Checking out the instructions is essential.
[ejr@hobbes rpm-2.5.1]$ more README*
::::::::::::::
README
::::::::::::::
This is RPM, the Red Hat Package Manager.

The latest releases are always available at:

        ftp://ftp.redhat.com/pub/redhat/code/rpm

Additional RPM documentation (papers, slides, HOWTOs) can also be
found at the same site.

There is a mailing list for discussion of RPM issues, [email protected].
To subscribe, send a message to [email protected] with the word
"subscribe" in the subject line.

RPM was written and is maintained by:

    Erik Troan <[email protected]>
    Marc Ewing <[email protected]>

See the CREDITS file for a list of folks who have helped us out
tremendously. RPM is Copyright (c) 1997 by Red Hat Software, Inc.,
--More--(89%)

4.
cp Makefile Makefile.bak

Make a backup copy of the Makefile before you start editing it, so you can easily recover from any mistakes. If you didn't use configure, the Makefile was one of the files you untarred in the previous section. Otherwise, the Makefile was just created by configure.

You'll nearly always have a Makefile, but you should also make a backup of any other files you're going to edit. (And remember, the README file will tell you what to do for the specific software you're using.)

Code Listing 14.3. The ./configure program goes on and on.
[ejr@hobbes rpm-2.5.1]$ ./configure
loading cache ./config.cache
checking host system type... i486-unknown-linux
checking target system type... i486-unknown-linux
checking build system type... i486-unknown-linux
checking for gcc... (cached) gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking how to run the C preprocessor... (cached) gcc -E
checking whether gcc needs -traditional... (cached) no
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking what additional CFLAGS are needed to link statically... -static
checking POSIX chmod...... yes
checking for mkdir... (cached) /bin/mkdir
checking if /bin/mkdir supports -p... yes
checking for AIX... no
checking for minix/config.h... (cached) no
checking for POSIXized ISC... no
checking for mawk... (cached) gawk
checking whether ln -s works... (cached) yes
checking whether make sets ${MAKE}... (cached) yes
checking for ranlib... (cached) ranlib
checking for ar... (cached) ar
checking GNU gzip...... yes
checking for bzip2...... no
configure: warning: RPM will not work without GNU gzip.
checking old version of patch... patch later then 2.2 found
/////////////////////////////////////
creating ./config.status
creating Makefile
[ejr@hobbes rpm-2.5.1]$ cp Makefile Makefile.bak
[ejr@hobbes rpm-2.5.1]$

5.
vi Makefile

Use the text editor of your choice to edit the Makefile, reading the instructions in it and checking the accuracy of things like directory and path names, program names, and similar settings. If you don't know what something is or does, ignore it for now. Even if configure automatically set up the Makefile for you, you should still glance through it to make sure that it's putting stuff into the correct directories and that it doesn't expect any additional information from you.

Figure 14.2 shows the Makefile for rpm. All that we changed was the base directory.

Figure 14.2. Fortunately, many programs require minimal changes.


6.
Save the file and close out of the editor.

There! You've configured your software!

Tip

Exactly what steps you'll have to take will depend on the software. Scripts will come as plain text files and you might not have to do anything besides download them. Most of the time, however, you'll have to tweak scripts as well as programs (although the scripts won't need to be compiled).


Tip

A good rule of thumb is to make minimal changes to the Makefile. Doing more than is required often causes the program not to compile or gives you a bazillion error messages. If this happens, just go to your backup Makefile, make a new copy, and try again making only the necessary modifications. Better to make too few changes than to take the time and effort to make too many.


Tip

Pay particular attention to the paths to programs and files as you're editing scripts and other setup files—a little error in a path can be hard to spot and completely prevent the new software from working.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.33.41