Don't remove buildroot docdir on %doc usage (ticket #836)
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 13 Jun 2011 08:52:54 +0000 (11:52 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 13 Jun 2011 08:58:25 +0000 (11:58 +0300)
- Some software installs its own documentation and if you try to
  combine it with %doc, rpmbuild will abort with mysterious
  "cpio bad magic" or such errors because what was assumed to be
  there was not, as %doc would 'rm -rf' the docdir upon first
  invocation. I don't see any good reason to disallow sharing the
  same directory for %doc and documentation installed by software
  "make install" - the other alternative would be forcing %doc to
  go to some other location, only making docs harder to find.
- Also at least Mageia (and prior to that Mandriva) has been doing
  this for quite some time now.

build/files.c

index c034834..fe16843 100644 (file)
@@ -940,7 +940,6 @@ static rpmRC parseForSimple(rpmSpec spec, Package pkg, char * buf,
                appendStringBuf(pkg->specialDoc, "DOCDIR=$RPM_BUILD_ROOT");
                appendLineStringBuf(pkg->specialDoc, pkg->specialDocDir);
                appendLineStringBuf(pkg->specialDoc, "export DOCDIR");
-               appendLineStringBuf(pkg->specialDoc, "rm -rf $DOCDIR");
                appendLineStringBuf(pkg->specialDoc, mkdocdir);
                free(mkdocdir);