Using printf format %P with find in RPM spec file

While creating a spec file for an RPM, I needed to generate the list of files installed by the RPM. Solution is simple, use the UNIX command find. Right.. My first attempt was the following: %install # copy the files ( cd %{buildroot} ; find -type f -print "/%P\n" ) > INSTALLED_FILES If you do the above, you’ll find that all entries in INSTALLED_FILES are wrong: file name have ‘ATCH’ at the end.