When creating a spec file, what is the proper procedure for creating an additional text doc file to be installed by the RPM, when that text file is not part of the original source?
For example, if the current %doc line includes the following files that are in the source:
%doc FEATURES KNOWNBUGS LICENSE README RELEASE_NOTES
and I want the spec file to create a README_FOO that will be written in the same docs directory (which contains package-specific configuration instructions), what’s the proper way to do it?
I know I can create a text file in the %install section of the spec file with:
echo 'README_FOO contents go here
' > "$RPM_BUILD_ROOT"/README_FOO
but I’m not sure of the correct path to use after $RPM_BUILD_ROOT, or how to reference the new file in the existing %doc line or a new one.
Thanks in advance.
The easiest thing to do is to create a new %SOURCEx file and then copy it in during %prep. From there you can refer to it as normal in %doc.