Source RPM

Nigel Wade nmw at ion.le.ac.uk
Thu Mar 5 09:27:16 UTC 2009


Allen, Jack wrote:
> Hello: 
>         I am trying to track down what I think is a bug in the login
> program and I want to look at the source. I have determined that
> /bin/login is provided by util-linux-XXXXXXXXXXX. So I have found the CD
> that contains util-linux-XXXXXXXX.src.rpm, but I don't know the exact
> options to rpm to see what's in the rpm file and to extract the files I
> want to look at. I would rather extract the file relative to some
> directory I am in, not to /usr/src/redhat/*.
> 
>         I have read the man page on rpm and tried a few things, but do
> not seem to be able to do what I want. 
> 
>         So can some one provide me with the proper options to use? 
> 

The following allows a normal user, without write access to /usr/src/redhat, to install 
source RPMs . DO NOT DO THIS AS ROOT!

Create a file in your home directory called .rpmmacros and set the following macros:

%_topdir    %(echo ${HOME}/rpm)
%_tmppath   %{_topdir}/tmp

In this case the rpm root directory is $HOME/rpm (the temp directory used by rpmbuild is 
$HOME/rpm/tmp). The directory needs to exist before you can install source RPMs into it.

This should allow you to install a source RPM. After which the directory $HOME/rpm ought 
to contain the SOURCES and SPECS directories.

-- 
Nigel Wade, System Administrator, Space Plasma Physics Group,
             University of Leicester, Leicester, LE1 7RH, UK
E-mail :    nmw at ion.le.ac.uk
Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555




More information about the redhat-list mailing list