The spec files created by rpmdev-newspec have %install sections that start with a 'rm -rf $RPM_BUILD_ROOT'. This is no longer needed with the version of rpmbuild that is in current Fedora releases: https://fedoraproject.org/wiki/PackagingGuidelines#BuildRoot_tag
The link you posted refers to whether the BuildRoot tag is required, not whether "rm -rf $RPM_BUILD_ROOT" is still needed in %install. Anyway, the reason why it's not being filtered out is that whether it's required or not depends on whether redhat-rpm-config is installed on the system the package is going to be built on, see /usr/lib/rpm/redhat/macros, %__spec_install_pre.
Thanks for the explanation, Ville. Yes, you are right that the the guidelines section I linked is about buildroot, but it also says: "The provided buildroot will automatically be cleaned before commands in %install are called." ... and then goes on to explain how EPEL5 and below need "rm -rf $RPM_BUILD_ROOT" in %install. Please reconsider; if you think the guidelines are at fault here and the "rm -rf $RPM_BUILD_ROOT" is needed, file a ticket with the FPC to change the guidelines. Otherwise, I believe it's best to have rpmdev-newspec producing spec files that match with the guideline recommendations.
Any update on this?
Not really as far as I'm concerned - I think removing it would cause more harm than keeping it. I'm not interested in arguing about guidelines, but I do want to keep rpmdevtools as free of cosmetic changes that would cause very real problems in older but alive/supported distro setups as well as newer ones that aren't strictly in line with what the Fedora mock/koji build roots contain. BTW I don't think the guidelines say that the "rm -rf $RPM_BUILD_ROOT" MUST NOT be used in %install, nor even SHOULD NOT, so I don't think the template has any real problems with current guidelines compliance wrt this.