[TriLUG] hacking a broken src rpm

rpjday rpjday at mindspring.com
Fri May 31 16:43:07 EDT 2002


  since there might be a couple other people who might need to
do this some day, here's the quick-and-dirty for hacking a src rpm
that refuses to build.

  as an example, the autolog-0.40-1.src.rpm that kevin was trying
to build.  if you want to play along at home, go get it from 
rpmfind.net.  (make sure you've installed the rpm-build rpm first.)

  first,

  # rpm --rebuild autolog...src.rpm		(fails badly)

so, one step at a time.

  first, 

  # rpm -ivh autolog...src.rpm

that installs the source tarball and spec file under /usr/src/redhat,
subdirs SPECS and SOURCES.  cd to the SPECS directory, try to just do
the "prep" stage of building from a src rpm:

  # rpm -bp autolog.spec		(seems to work)

since that works, try to compile:

  # rpm -bc autolog.spec

whoops, fails badly, something about "gcc %{rpmcflags}", no such file
or directory.  not knowing enough about spec files, edit the spec file,
find the "%{__make}" line and totally remove the CFLAGS options part
of it.  when in doubt, toss it out.  try again:

  # rpm -bc autolog.spec

works.  finally, build the binary RPM itself, adding the "--short-circuit"
option to avoid redoing the previous steps for efficiency:

  # rpm -bb --short-circuit autolog.spec

seems to work, you now have a binary RPM under the RPMS/i386 directory.

  someone more knowledgeable about spec files can probably suggest what
was wrong with the line

  %{__make} CFLAGS="%{rpmcflags}"


rday




More information about the TriLUG mailing list