Building Simple RPMs

From SUSE Wiki

Jump to: navigation, search

Type: Howto, Application-Specific (checkinstall)

Tested Versions: 9.1, 9.3, 10.0, 10.1

Written By: Damian

Further Modifications By: Kamatsu

One of the advantages of SUSE is its use of RPMs to install, maintain, and remove software packages. However, sometimes you may be unable to find the RPM you need. One option is to build your own. There are two primary methods for this; the first, while being technically superior, may be too complicated for some users. More information about this method can be found in this Novell Cool Solution.

The second option is to use a program called checkinstall. This method is much simpler, but may not work 100% of the time and may produce RPMs that do not conform to SUSE's conventions for where certain files should be stored. It may produce RPMs that are not portable; that is RPMs that work on the computer they were configured on, but not elsewhere. This method is also described in this forum thread.

So the "Simple" in this article's title refers to both the relative ease with which the RPMs are made and the unsophisticated nature in which they are installed on your computer.

To use the checkinstall method, you will need to acquire and install the checkinstall SUSE RPM (you can find it here by searching for "checkinstall"). The rest of these instructions will be fairly generic. When compiling from source, do some research on the software to learn about configuration options, etc.

Download the source code for the software you wish to create an RPM for. Extract it to a directory and look for files called "README" or "INSTALL" for specific instructions. Make sure you have all the dependencies met, and if there are "devel" RPMs for the dependencies, you'll likely need to have those installed as well.

Open a console with a user account (not root) and cd to the directory where the files were extracted. Next type the command

$ ./configure

You should see output that represents the software locating other software installed on your system. If you see errors it usually means there was a dependency problem. Use Google to try and make sense of any errors you do not understand.

When the previous step has been successfully completed (still using the user account) issue the command

$ make

You should again see output that represents the code being compiled. As with the previous paragraph, errors often mean a dependency issue, again use Google to research the error. You know this step completed successfully when you are given a prompt with no errors displayed in the several previous lines of output.

Now you need to su to root and issue the command

# checkinstall

This will launch the program to walk you through creating your RPM. The first question will ask

The package documentation directory ./doc-pak does not exist.
Should I create a default set of package docs?  [y]:

Type "y" and enter.

The next question:

Please write a description for the package.
End your description with an empty line or EOF.
>>

Just enter a short description of the program you are installing. Press enter once to break the line, then press it again to indicate you are done with the description.

You will then be presented with a summary of the options to be used to build the RPM. It should look similar to this:

1 -  Summary: [ turn-based strategy game ]
2 -  Name:    [ wesnoth ]
3 -  Version: [ 0.9.1 ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ Applications/System ]
7 -  Architecture: [ i386 ]
8 -  Source location: [ wesnoth-0.9.1 ]
9 -  Alternate source location: [  ]
10 - Provides: [  ]
11 - Requires: [  ]

Enter a number to change any of them or press ENTER to continue:

If you'd like to change the architecture the RPM is to be built for you would type "7", then enter i686, for example. For the most part, the defaults you are given should be fine. When done modifying the options, press enter.

The RPM will then be built using the options you defined. Usually, this will complete within a few seconds and your RPM will be created in /usr/src/packages/RPMS/i686 (or whatever architecture you specified). You can now install the RPM with YaST.

If running checkinstall gave you an error, you'll need to try to figure out what went wrong and again use Google in an attempt to clear up anything that doesn't make sense.

Personal tools