need spec file example to replace files from various packages

Todd Zullinger tmz at pobox.com
Tue Dec 5 22:28:02 UTC 2006


Paul Johnson wrote:
> After installing Fedora, I want to replace various configuration
> files on lab computers. If I can learn how to do this in the post
> section of an RPM spec file, I will be happy.  For example, I
> want/need to replace things like
> 
> /etc/gdm/PreSession/Default
> /etc/gdm/PostSession/Default
> /etc/pam.d/system-auth
> /etc/hosts.allow
> /etc/hosts.deny
> 
> One brute force option is to install with rpm --replacefiles, but
> yum does not like that.
> So can  you point me at a spec file or two that will give example
> syntax on how I can create a backup of those files and replace them
> with the ones I want.

I don't know the way to do just what you want off the top of my head,
but I have an idea that might be sufficient (or possibly even
preferable).  If the systems you're setting up are under your control
to the extent that the files you are looking to replace will have
standard content, you could just patch them in the %post section of
your package.  You then wouldn't need to fight with another package
over ownership of the files in the rpm database and once you patched
them to be like you want, if the package that owns them gets updated
it should install the new version with a .rpmnew extension instead of
overwriting it (true for config files generally, but not other files).

Maybe that'll help.  If not, perhaps it'll spur someone here to post a
more elegant solution.

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
======================================================================
The secret of life is honesty and fair dealing. If you can fake that,
you've got it made.
    -- Groucho Marx

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 545 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20061205/47d0f239/attachment-0001.sig>


More information about the fedora-list mailing list