Hi,
I want to create an "examples" folder inside %{_docdir}/%{name}-%{version}. Here is my test case:
%install mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/examples/ touch $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/examples/test
%files -f %{name}.lang %defattr(-,root,root,-) %doc AUTHORS COPYING ChangeLog README %doc %{_docdir}/%{name}-%{version}/examples/
This wont work as the first %doc line deletes and re-creates %{_docdir}/%{name}-%{version}, so rpmbuild will fail with: "... /usr/share/doc/foo/examples/test: cpio: Bad magic"
Any idea how I can have a subdir then? Christoph
On 04/20/2009 01:26 PM, Christoph Wickert wrote:
Hi,
I want to create an "examples" folder inside %{_docdir}/%{name}-%{version}. Here is my test case:
%install mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/examples/ touch $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/examples/test
%files -f %{name}.lang %defattr(-,root,root,-) %doc AUTHORS COPYING ChangeLog README %doc %{_docdir}/%{name}-%{version}/examples/
This wont work as the first %doc line deletes and re-creates %{_docdir}/%{name}-%{version}, so rpmbuild will fail with: "... /usr/share/doc/foo/examples/test: cpio: Bad magic"
Any idea how I can have a subdir then?
Off the top of my head:
%install mkdir -p examples/ touch examples/test
%files -f %{name}.lang %defattr(-,root,root,-) %doc AUTHORS COPYING ChangeLog README examples/
~spot
On Mon, 2009-04-20 at 19:26 +0200, Christoph Wickert wrote:
Hi,
I want to create an "examples" folder inside %{_docdir}/%{name}-%{version}. Here is my test case:
%install mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/examples/ touch $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/examples/test
%files -f %{name}.lang %defattr(-,root,root,-) %doc AUTHORS COPYING ChangeLog README %doc %{_docdir}/%{name}-%{version}/examples/
This wont work as the first %doc line deletes and re-creates %{_docdir}/%{name}-%{version}, so rpmbuild will fail with: "... /usr/share/doc/foo/examples/test: cpio: Bad magic"
Any idea how I can have a subdir then? Christoph
Simple: don't install examples/ in %docdir manually, instead include it in the %files section of %doc.
Example: tarball contents is
foo-0.1.0/ foo-0.1.0/foo.c foo-0.1.0/COPYING foo-0.1.0/examples/ foo-0.1.0/examples/run.me
then your %doc section reads: %doc COPYING examples/
packaging@lists.fedoraproject.org