I am trying to create a .spec file, and I put ChangeLog, README, INSTALL, COPYING, NEWS, AUTHORS in the %doc directive right under the %file directive. The package tarname is recafoh-prealpha and the version is svn73. rpmbuild -ba recafoh.spec is saying
RPM build errors:
Installed (but unpackaged) file(s) found:
/usr/share/doc/recafoh-prealpha/COPYING
/usr/share/doc/recafoh-prealpha/ChangeLog
/usr/share/doc/recafoh-prealpha/INSTALL
/usr/share/doc/recafoh-prealpha/NEWS
/usr/share/doc/recafoh-prealpha/README
/usr/share/doc/recafoh-prealpha/TODO
But they are installed in BUILDROOT/usr/share/doc/recafoh-prealpha-svn73/{ChangeLog, README, INSTALL, COPYING, NEWS, AUTHORS}
and here is another strange thing:
README is also installed in BUILDROOT/usr/share/doc/recafoh-prealpha-svn73.
So, can anyone explain 1) how to solve the rpmbuild errors, and 2) why README is installed in recafoh-prealpha-svn73 and README and the rest are installed in recafoh-prealpha?
Thanks alot
EDIT:
Here is the relevant portion of the recafoh.spec file:
%files
%doc AUTHORS ChangeLog COPYING NEWS README TODO
%{_sbindir}/recafohd
%{_bindir}/recafoh
Per the Fedora Build Documentation: ‘Usually, “%doc” is used to list documentation files within %{_builddir} that were not copied to %{buildroot}. A README and INSTALL file is usually included. They will be placed in the directory /usr/share/doc/%{name}-%{version}, whose ownership does not need to be declared.’
So the answer to both of your questions is related to this single point. I assume your bzip2 file has those docs in them, contained within the /usr/share/doc/recafoh-prealpha/ directory correct? So if you look at the documentation, this is the single most important point: Usually, “%doc” is used to list documentation files within %{_builddir} that were not copied to %{buildroot}.
If you want them in that specific directory (and the version specific directory) modify your %file section to look like this:
If you only want them in /usr/share/doc use the following %files section:
If you want to place the documentation only in the version specific directory, you should modify your bzip2 file so the documentation files are top level, then they should get moved properly with the spec file you originally provided.
For a bit more detailed information specifically regarding the %doc directive, check out: rpm.org.