[TriLUG] Another plea for RPM help!

Benjamin Reed ranger at befunk.com
Sun Nov 18 19:55:03 EST 2001


Tom Bryan [tbryan at python.net] wrote:
> Argh!  How does anyone learn how to package RPMs well?  Did you have to read 
> the source?  I can't find any decent online documentation about RPM.  

It's pretty messy... half the things I learned were from looking at other
people's RPMs.  :(

> 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.  =)

> %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.

> Question #2: I see that some other RPMs do something like
> /sbin/ldconfig -n /usr/local/pkg
> Only processing the directory that I'm adding seems like a good idea, but the 
> -n option to ldconfig says that it doesn't rebuild the cache.  Is that a good 
> idea?

That seems kind of weird...

> 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.  =)

> 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.  That will get you
about 80% of the way there, but for weird stuff like you're running into,
the only way to figure out what it's doing is context, that I'm aware of,
or digging through the RPM source, which I don't understand.  =)

> 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...

-- 
Ben Reed a.k.a. Ranger Rick (ranger at befunk.com)
http://defiance.dyndns.org/ / http://radio.scenespot.org/
"Right now Moltar is heating my skull up to a scorching 450 degrees.
It's like getting a scalp massage... from Lucifer." -- Space Ghost



More information about the TriLUG mailing list