Monday, December 22, 2003

Installing src.rpms

It's easy. It's fun. I'd never done it before, so this is as good a time as any.

I'm a big fan of the old fortune program. You know, the one that does

$ fortune
Didn't I buy a 1951 Packard from you last March in Cairo?

and similar things. But it's not in the Fedora Core distribution. OK, I found a variety of RPMS for fortune-mod at Rpmfind.Net. I actually played with several, but decided on the on labeled

A program which will display a fortune. RedHat-8.0 Sources fortune-mod-1.0-24.src.rpm as the one I wanted. I chose the src.rpm version because I didn't want to run into any dependency problems that might occur when switching from RedHat 8 to Fedora.

OK, how to install the thing? After reading some web posts and the man pages for rpm and rpmbuild, I found it works like this:

  1. su - to get all the path information correct
  2. cd to directory containing fortune-mod-1.0-24.src.rpm
  3. run rpmbuild --rebuild fortune-mod-1.0-24.src.rpm
  4. Look at the log file. It will say something like Wrote: /usr/src/redhat/RPMS/i386/fortune-mod-1.0-24.rpm
  5. cd /usr/src/redhat/RPMS/i386. Yup, the RPM is there
  6. rpm -i fortune-mod-1.0-24.rpm
  7. Log out of root and test it: $ fortune Two can Live as Cheaply as One for Half as Long. -- Howard Kandel
  8. Save the RPM file for posterity

And that's all I know about installing src.rpms.