diff --git a/wpkg-fusioninventory.spec b/wpkg-fusioninventory.spec
index 8b34625..849d113 100644
--- a/wpkg-fusioninventory.spec
+++ b/wpkg-fusioninventory.spec
@@ -38,6 +38,9 @@ mkdir -p %{buildroot}/home/e-smith/files/shares/wpkg/files/softwares/%{package}
 cp -r softwares/* %{buildroot}/home/e-smith/files/shares/wpkg/files/softwares/%{package}/
 cp -r packages/* %{buildroot}/home/e-smith/files/shares/wpkg/files/packages/
 
+%clean
+/bin/rm -rf %{buildroot}
+
 %files
 %defattr(-,root,root)
 %doc CHANGELOG.git
@@ -45,9 +48,6 @@ cp -r packages/* %{buildroot}/home/e-smith/files/shares/wpkg/files/packages/
 %attr(554, root, root) /etc/e-smith/events/actions/wpkg-fusioninventory-cacert
 /etc/
 
-%clean
-/bin/rm -rf %{buildroot}
-
 %changelog
 * Fri Oct 9 2015 Daniel Berteaud <daniel@firewall-services.com> - 2.3.17-1
 - Update to 2.3.17