How to create RPM subpackages using the same paths for different envs?

廉价感情. 提交于 2019-12-05 18:45:25

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):

  1. Three separate files /etc/name.conf-developer, /etc/name.conf-live, etc.
  2. Have all three packages provide a virtual package, e.g. name-config
  3. Have main package require name-config
    • This will make rpm, yum, or whatever require at least one be installed in the same transaction
  4. Have all three packages conflict with each other
  5. Have each config package's %post (and possibly %verify) symlink /etc/name.conf to the proper config
    • This also helps show the user what is happening

Cons:

  1. It's a little hackish
  2. rpm --whatprovides /etc/name.conf will say it is not owned by any package
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!