As per my requirement is is possible that the rpm is same for all server but only one config file change as per the server environment like production,staging,testing or else. i have bundle of config file for all server but i don't want hardcode it in spec file or it is not possible to create different rpm for all server.it is possible to specify name of the config file at time of rpm install on client side.
Possibly a repeat of this one so I will copy my answer from there...
I don't think there's a native way; I would do a %post
like you had noted.
However, I would do this (similar to something I do with an internal-only package I develop for work):
/etc/name.conf-developer
, /etc/name.conf-live
, etc.name-config
name-config
rpm
, yum
, or whatever require at least one be installed in the same transaction%post
(and possibly %verify
) symlink /etc/name.conf
to the proper config
Cons:
rpm --whatprovides /etc/name.conf
will say it is not owned by any package