rpm & rpmbuild - using global environment variable in the %files section

本秂侑毒 提交于 2019-12-04 05:17:48

The %files section does not expand shell variables. You cannot do this that way.

You have a couple options that I can see offhand. You can

  • generate a file with a list of your files (during %install or what-have-you) and then use %files -f files.lst

  • expand $INSTALLPATH at rpm macro definition time with:

    # For RPM >= 4.7.0
    %_installpath %{getenv:INSTALLPATH}
    # For RPM < 4.7.0
    %_installpath %{lua:print(os.getenv("INSTALLPATH"))}
    
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!