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.
| |
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.
| |
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.
| |
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.
3.144.33.41