File defclean.diff of Package rpm

Index: build/parseSpec.c
===================================================================
--- build/parseSpec.c.orig
+++ build/parseSpec.c
@@ -569,6 +569,13 @@ int parseSpec(rpmts ts, const char *spec
     }
    	/* LCL: parsePart is modified @*/
 
+    if (spec->clean == NULL) {
+	char *body = rpmExpand("%{?buildroot: %{__rm} -rf %{buildroot}}", NULL);
+	spec->clean = newStringBuf();
+	appendLineStringBuf(spec->clean, body);
+	free(body);
+    }
+
     /* Check for description in each package and add arch and os */
   {
     char *platform = rpmExpand("%{_target_platform}", NULL);