Default dir for PHP source files?

Rick Stevens rstevens at vitalstream.com
Fri Nov 12 19:10:43 UTC 2004


Roger Harrell wrote:
> So the php-4.2.2-17.2.i386.rpm RPM does not install source files just a 
> compiled binary? RPMs only install with a specific config?

You can change where they install by using the "--relocate" option in
rpm, but that only works with "relocatable" RPMs.  See the man page for
rpm for details.

Yes, the binary RPM only installs binaries.  Many, many people don't
want (or need) the source code, and source takes up a lot of disk space.
That's why there's a binary and a source RPM.  If you aren't going to
tinker with the source, don't install the source RPM.  Simple.

> So I'm totally clear, the php-4.2.2-17.2.src.rpm will just install the 
> source correct. Then if I run a config and make on it it should behave 
> properly with the already installed php-4.2.2-17.2.i386.rpm?

Well, sorta.  If you install a ".src.rpm", you don't end up with source
that you do the normal "./configure;make;make install" operations.  The
source ends up in "/usr/src/redhat", with files distributed among the
various directories in there.  To make a batch of files that you can
do the "./configure;make;make install", you have to go to the
"/usr/src/redhat/SPECS" directory and run:

	rpmbuild -bp name-of-spec-file

This will unpack the source and apply any patches that RedHat has made.
The resulting source will be in a directory in /usr/src/redhat/SOURCES.
That directory can be copied to whereever you wish via

	# cd /usr/src/redhat/SOURCES
	# cp -a directory-name destination-directory

THEN you can do the "./configure;make;make install".  If you want to
create an installable source RPM and the binary, you can bypass all of
that guano and

	# rpmbuild --rebuild name-of-src.rpm

The binary and a source RPM will be created in /usr/src/redhat/RPMS,
but the source RPM will be similar to the one you downloaded.

Make sure you READ AND UNDERSTAND the man pages for "rpmbuild" and "rpm"
or get the "Maximum RPM" book (available online--do a Google search for
it) before you do any of this.  It'll save you a lot of confusion.
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-                 Dyslexics of the world: UNTIE!                     -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list