Return-Path: linux-users-error@fnal.gov
Received: from FNAL.FNAL.Gov (fnal.fnal.gov [131.225.9.8])
by sapphire.fnal.gov (8.8.7/8.8.7) with ESMTP id SAA13264
for <yocum@sapphire.fnal.gov>; Tue, 22 Sep 1998 18:02:04 -0500
Received: from fndaub.fnal.gov ("port 16789"@fndaub.fnal.gov)
by FNAL.FNAL.GOV (PMDF V5.1-10 #3998) id <01J246SNI7V40001LZ@FNAL.FNAL.GOV>
(original mail from djholm@fndaub.fnal.gov) for yocum@sapphire.fnal.gov; Tue,
22 Sep 1998 18:01:45 -0500 CST
Received: from fndaub.fnal.gov ("port 16789"@fndaub.fnal.gov)
by FNAL.FNAL.GOV (PMDF V5.1-10 #3998)
with ESMTP id <01J246SKNM000002F0@FNAL.FNAL.GOV> for
linux-users-expand@reprocess.FNAL.FNAL.GOV; Tue, 22 Sep 1998 17:59:36 -0500
Received: (from djholm@localhost)
by fndaub.fnal.gov (980427.SGI.8.8.8/970903.SGI.AUTOCF) id RAA20048; Tue,
22 Sep 1998 17:59:41 -0500 (CDT)
Date: Tue, 22 Sep 1998 17:59:40 -0500 (CDT)
From: djholm@fndaub.fnal.gov (Don Holmgren)
Subject: Re: Accessing Linux Source on linux-rep.fnal.gov
In-reply-to: <199809221933.OAA26585@bastet.fnal.gov>
To: marilyn@bastet.fnal.gov (Marilyn Schweitzer)
Cc: djholm@fnal.gov (Don Holmgren), linux-users@fnal.gov
Errors-to: linux-users-error@fnal.gov
Message-id: <199809222259.RAA20048@fndaub.fnal.gov>
MIME-version: 1.0
X-Mailer: ELM [version 2.4 PL24]
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7bit
Hi Marilyn -
Here are general instructions for getting the source corresponding
to an arbitrary file installed from a RedHat RPM package. I'll use
'sa' as the example:
1. Determine the RPM corresponding to the file using 'rpm -qif file':
lrep:~$ rpm -qif /usr/sbin/sa
Name : psacct Distribution: Hurricane
Version : 6.3 Vendor: Red Hat Software
Release : 2 Build Date: Fri Oct 24 11:37:09
1997
Install date: Tue Sep 22 16:55:43 1998 Build Host: porky.redhat.com
Group : Utilities/System Source RPM: psacct-6.3-2.src.rpm
Size : 82534
Packager : Red Hat Software <bugs@redhat.com>
Summary : Process accounting tools
Description :
The tools necessary for accounting the activities of processes are
included here.
2. OK, we're looking for 'psacct-6.3-2.src.rpm'. The easiest way to find
this file is to go to the web,
http://linux-rep.fnal.gov/
and select the link
'Locate a file in the repository'.
This brings up a search dialog - type psacct-6.3-2.src.rpm into the
the box. The results:
redhat/redhat-5.0/SRPMS/psacct-6.3-2.src.rpm
This is a link. Shift-click (or right-click and choose save-as) to
ftp the file to your area.
2a. Alternatively, you can either NFS mount the RedHat mirror from linux-rep:
mount -o ro linux-rep:/linux/redhat /your/redhat
or use anonymous FTP to linux-rep:
ftp://linux-rep.fnal.gov/pub/mirrors/redhat
Most packages will be in 'redhat-5.0/SRPMS' or 'redhat-5.0/updates/SRPMS'.
Some contributed packages will be in the 'contrib/' tree - it's easiest
to use 'find' againt an NFS mount. In this case, psacct is in
'redhat-5.0/SRPMS'.
3. OK, you now have the source RPM file (note that source RPMs always are
something.src.rpm). Inside the RPM lurks a cpio archive. You can use the
'rpm2cpio' tool to translate. So, to list the files in our psacct rpm:
lrep:/stage$ rpm2cpio psacct-6.3-2.src.rpm | cpio -itv
-rw-rw-r-- 1 root root 1588 Oct 23 1997 psacct-6.3.spec
-rw-rw-r-- 1 root root 2100 Oct 23 1997 acct-6.3-config.patch
-rw-rw-r-- 1 root root 160564 Oct 23 1997 acct-6.3.tar.gz
322 blocks
Clearly you can also use cpio to explode the archive.
4. Most RedHat source packages include the original source tar file, plus
patches to apply against the source. The 'spec' file in the RPM archive
includes the instructions for how to untar, patch, and build the package.
You can manually follow these instructions.
Alternatively, you can let RPM take care of these details. Once you have
the source rpm, install it:
rpm -i psacct-6.3-2.src.rpm
This puts the 'spec' file in /usr/src/redhat/SPECS, and the various tar
files and patches in /usr/src/redhat/SOURCES. You then use
cd /usr/src/redhat/SPECS
rpm -bp psacct-6.3.spec
to untar the sources and apply the patches. The resulting source tree is
in /usr/src/redhat/BUILD/name (in this case, /usr/src/redhat/BUILD/acct-6.
3).
Whew. This is much easier than this mail reads. For help with RPM stuff,
buy the "Maximum RPM" book or see the online copy:
http://linux-rep.fnal.gov/documentation.html
(Maximum RPM link).
Don H.
>
> Don,
>
> Would you explain to me how to get the source for Linux sa package
> from linux-rep.fnal.gov?
>
>
> Thanks,
>
>
> Marilyn
>
>
>
------- End of Forwarded Message