[TriLUG] Another plea for RPM help!

Tom Bryan tbryan at python.net
Sun Nov 18 13:10:28 EST 2001


On Monday 19 November 2001 05:55 am, you wrote:

> > Argh!  How does anyone learn how to package RPMs well?  
>
> It's pretty messy... half the things I learned were from looking at other
> people's RPMs.  :(

That's what I've been doing, but from my days of working with LaTeX, I found 
that when everyone copies the examples they have, they continue the same 
legacy hacks forever.  More recent versions of the tool often supported a 
much more elegant solution.  Not surprisingly, the LaTeX community has some 
pretty good documentation available.

> > I'm trying to write a .spec file, and I really want to do it well. 
> > Here's a nice example.  I'm building a custom postgresql .rpm for a
> > project.  I'd like to run ldconfig when the package installs.  I see that
> > Red Hat's RPM does this:
>
> Damn, when you do something, you don't fool around, do you?  Postgresql is
> definitely not an easy place to start in figuring out packaging.  =)

I started with Zope.  That was even worse because it doesn't follow the 
standard configure-make-install.  :-P  Really, packagind something for a very 
small audience with a special purpose is much easier than worrying about a 
general purpose package.

> > %post -p /sbin/ldconfig
> >
> > Question #1: What does the -p flag do?  I can't find any documentation on
> > it.
>
> Never seen that.  I have two hunches.  One, if there's nothing else in the
> %post section, maybe it's for a post "one-liner".  Otherwise, perhaps it's
> a dependency reference, instead of putting it in the Requires: for that
> package.

It must be something for the one-liner.  The /sbin/ldconfig is listed 
explicitly.  I found the following bit of documenation for %triggerun in 
/usr/share/doc/rpm-4.0.2/triggers 

"The -n and -p arguments are the same as for %post scripts."

Talk about adding insult to injury.  They documented it for triggers, but not 
in a way that give me any insight into the %post section. 

> > Question #3: Why don't these RPMs protect the post script with a
> > if [ $1 = 1 ]
> > then
> > 	/sbin/ldconfig -n /usr/local/pkg
> > fi
> > So that it isn't run every time the package is installed?
>
> Probably because it's pretty harmless to run ldconfig multiple times.  =)

Except that it scans the drive for shared libraries, not something to which I 
want to subject people using low-end hardware.

> > I know that someone lurking on this list is preparing a presentation on
> > RPM. Where did *you* learn it?  How do I learn how to create a
> > well-written .spec file that doesn't abuse RPM's intent and avoid all of
> > its helpful features?
>
> The best reference is the maximum RPM work-in-progress.  

At ftp://ftp.rpm.org/pub/max-rpm/ ?
Strange, last time I was on www.rpm.org, I thought that I was bounced to an 
online copy of the previous release.

> or digging through the RPM source, which I don't understand.  =)

I'd do it, but I don't think that I have the time at the moment.  Maybe I'll 
just log a bug.  The man page even has errors in it.  It's like Red Hat put 
RPM out there just to fool their competitors into adopting it.  "What a 
strategy.  It'll take them weeks to figure out how to use RPM!  By that time, 
we'll already be releasing a new, incompatible version.  BWA!HA!HA!HA!"

> > Finally, will the RPM presentation for TriLUG cover such fine points, or
> > will it just cover the basic installing and building of RPMs?
>
> That's a darn good question.  I suspect going that deep into things will be
> way too much time, but I can add stuff to the slides that won't be in the
> presentation, maybe, if you want...

No, that's okay.  I was just curious whether you were assuming any background 
with RPM.  Covering BuildRoot would be a good idea though.  I get the 
impression that I should be using it, but I've had nothing but trouble with 
it.  

---Tom



More information about the TriLUG mailing list