--- rpm-4.4.9/build/parseBuildInstallClean.c 2008-01-30 23:16:55.347346942 +0200 +++ rpm-4.4.9/build/parseBuildInstallClean.c 2008-01-30 23:22:24.241459876 +0200 @@ -47,11 +47,10 @@ appendStringBuf(*sbp, s); s = _free(s); } else if (parsePart == PART_CLEAN) { - const char * s = rpmExpand("%{?buildroot:rm -rf '%{buildroot}'\n}", NULL); + const char * s = rpmExpand("%{?__spec_clean_body}%{!?__spec_clean_body:%{?buildroot:rm -rf '%{buildroot}'\n}}\n", NULL); if (s && *s) appendStringBuf(*sbp, s); s = _free(s); - sbp = NULL; /* XXX skip %clean from spec file. */ } /* There are no options to %build, %install, %check, or %clean */