can an RPM spec file “include” other files?

2019-04-21 09:08发布

Is there a kind of "include" directive in RPM spec? I couldn't find an answer by googling.

Motivation: I have a RPM spec template which the build process modifies with the version, revision and other build-specific data. This is done by sed currently. I think it would be cleaner if the spec would #include a build-specific definitions file, which would be generated by the build process, so I don't need to search and replace in the spec.

If there is no include, is there an idiomatic way to do this (quite common, I believe) task?

7条回答
Lonely孤独者°
2楼-- · 2019-04-21 09:38

You can include the *.inc files from the SOURCES directory (%_sourcedir):

Source1: common.inc

%include %{SOURCE1}

In this way they will go automatically into SRPMS.

查看更多
登录 后发表回答