From 26c899c5061393eef51c0dcee766283e21b0dc1b Mon Sep 17 00:00:00 2001 From: Miroslav Suchý Date: May 28 2020 12:27:06 +0000 Subject: do not write %clean by default 1) do not write it if there is nothing 2) cleaning buildroot is unnecessary since EL5 --- diff --git a/rpmfluff/rpmbuild.py b/rpmfluff/rpmbuild.py index 2197f92..5ec0a31 100644 --- a/rpmfluff/rpmbuild.py +++ b/rpmfluff/rpmbuild.py @@ -205,7 +205,7 @@ class SimpleRpmBuild(RpmBuild): self.section_patches = "" self.section_prep = "" self.section_build = "" - self.section_clean = "rm -rf $$RPM_BUILD_ROOT" + self.section_clean = "" self.section_install = "" self.section_pre = "" @@ -375,9 +375,10 @@ class SimpleRpmBuild(RpmBuild): specFile.write(self.section_build) specFile.write("\n") - specFile.write("%clean\n") - specFile.write(self.section_clean) - specFile.write("\n") + if self.section_clean: + specFile.write("%clean\n") + specFile.write(self.section_clean) + specFile.write("\n") specFile.write("%install\n") specFile.write(self.section_install)