build

Wade Maxfield maxfield at one.ctelcom.net
Fri Dec 5 20:05:19 UTC 2003


On Fri, 5 Dec 2003, Charles R. Anderson wrote:
<snip>
> 
> Reproducing a build from a src.rpm to get the original binaries is
> usually as simple as:
> 
> rpmbuild --rebuild file.src.rpm
> 


  Ok. I picked two packages at random:

(as root)

 rpmbuild --rebuild lynx-2.8.5-7.1.src.rpm
 
rpmbuild: relocation error: rpmbuild: undefined symbol: freeSpecVec

rpmbuild --rebuild zlib-1.1.4-8.8x.src.rpm

rpmbuild: relocation error: rpmbuild: undefined symbol: freeSpecVec


  So, obviously, either not all of the RPM package builders don't follow 
the rules, or I'm missing a package required.  So far, I've batted 1000% 
failure in the past also, so I obviously don't understand this command 
line.



> >   I need this to be for a dummy.  I've applied one source code patch about 
> > two years ago and it was black magic at that time and appeared to work.  I 
> > was able to look at the source code files and prove the patch made it in, 
> > but I can't remember what I did to this day.
> 
> Patching, building, and packaging requires some knowledge of
> programming, unfortunately.
> 
  
  I have a smidgen.  I just don't understand the RedHat Way.  Also, since 
I do my own stuff under a deadline all the time, I don't do patching a 
lot.

  Just to let you know where I come from, the following. However, I'm not 
anything spectacular. I'm just a regular guy.

  I have ported the small c compiler to the 6800, written cooperative 
multitasking systems, written X windows drivers, written a driver for 2.0.x 
kernel, and done other programming in basic and fortran and C++ and perl 
and php and assembly in 6800, 68000, 8080, 8086, x86, COP400, and a very 
little PPC assembly (yuk!).  I currently do real time systems and have 
produced 2 embedded Linux products for a company I consult at for 
their internal use in gathering data from sensors.


  However, that doesn't mean I can't be stupid as a rock sometimes. Some 
rocks are smarter than I am upon occasion.  They at least lay there and be 
quiet when they should.


> >   Some of the things a dummy has a problem with are (1) where do the files 
> > go, (2) how do I get the files out of the source code RPM once the source 
> > code RPM has installed the files?  Let me explain.
> 
> When you do "rpm -i file.src.rpm" this is where things end up by 
> default:
> 
> /usr/src/redhat/SOURCES - the source code tar files, patches, etc.
> 
> /usr/src/redhat/SPECS - the spec file (control script) that gives the 
> steps for how to unpack, patch, build, and package the built files 
> into an rpm package.
> 
> You can list the contents of a src.rpm to see what these tar, patch, 
> and spec files are named:
> 
> rpm -qpvl file.src.rpm
> 

  Great stuff!


> >    I've seen source RPM's for RedHat which dump other files in a 
> > directory, and they had to be untar'd to get the  source code files out.  
> > At that point, I was unsure what directory Redhat built in, and could not 
> > get a clean RedHat specific build from it. I may have, but I could not 
> > prove it at that time.
> 
> If you instead "rpm -i file.src.rpm", you can rebuild the binaries by
> doing:
> 
> rpmbuild -bb file.spec
> 
> or build BOTH the binary and source rpm packages by doing:
> 
> rpmbuild -ba file.spec
> 
> from the SPECS directory.  This executes the steps in the spec file,
> which unpack (%prep), build (%build), install to a temporary directory
> called a buildroot (%install), and package the files (%files) into the
> final binary rpm package(s).  The sections of a spec file are simply
> shell script fragments, optionally using RPM macros.
> 
> In either case, the build happens in /usr/src/redhat/BUILD, and the
> resulting packaged files end up in /usr/src/redhat/RPMS.
> 
> There are ways, BTW, to change these default locations so you can
> build as non-root in your home directory, for example.
> 
> 

rpm -i lynx-2.8.507.1.src.rpm

cd /usr/src/redhat/SPECS

rpmbuild -bb lynx.spec

rpmbuild: relocation error: rpmbuild: undefined symbol: freeSpecVec




  here is my rpm list for redhat 8.0.  Note that the rpm was upgraded 
because of the hang problem that the standard 4.x rpm from redhat has 
under 8.0.  With 4.1.1, the problem does not occur.

[root at rh80 SPECS]# rpm -qa | grep rpm

rpmdb-redhat-8.0-0.20020910
rpm-python-4.1.1-1.8x
rpm2html-1.7-8
librpm404-devel-4.0.4-8x.27
redhat-rpm-config-8.0-1
rpm-4.1.1-1.8x
rpm404-python-4.0.4-8x.27
rpm-build-4.1-1.06
librpm404-4.0.4-8x.27


  THANKS for the help! I'm further down the road.

wade





More information about the fedora-legacy-list mailing list