On Sat, 16 Apr 2011 09:43:32 -0500, RS wrote:
The only problem I have with the package right now is getting the
documentation in the right place. I only recently figured out that
%doc will only automatically put files from the buildroot into
/usr/share/doc/%{name}-%{version}.
The installed files from the package put the html documentation in
/usr/share/doc/%{name}. I've tried:
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
# Move documentation so it will go in the right directory
mkdir -p %{buildroot}%{_docdir}/%{name}-%{version}
mv %{buildroot}%{_docdir}/%{name}/html \
%{buildroot}%{_docdir}/%{name}-%{version}/html
... but it didn't work.
And now I know why. When %doc is called it cleans the doc directory
prior to moving the files into it...
What's the right way to handle this? It just seems redundant to have a
/usr/share/doc/imagination and /usr/share/doc/imagination-3.0
1.) Verify that the app does not expect the documentation to be
located in its original path. Moving it could break the app at run-time
(e.g. a Help menu). It may be necessary to patch/reconfigure the app,
so it would look for the doc files in another location
Once you are certain that you can move the doc files without breaking
anything:
2.) Install them into a temporary location and make them available
somewhere below $(pwd), which is within the space of your extracted
package below %_builddir. Clean up and set up that temporary location
in %install. Then you can use %doc to include those doc files. E.g.
%install
...
rm -rf %(pwd)/_tmpdoc ; mkdir $(pwd)/_tmpdoc
mv %{buildroot}%{_docdir}/%{name} $(pwd)/_tmpdoc
%files
...
%doc _tmpdoc/*