- avoids silly clutter in every specfile in the regular case but permits
overriding if needed for whatever reason
- it's a spec behavior change but mostly backwards compatible:
existing specs will do whatever the %clean does, and if you need to avoid
calling %clean for whatever reason just keep an empty %clean in the spec
}
}
+ 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);