Bug 807857

Summary: rpmdev-newspec: rm -rf $RPM_BUILD_ROOT in %install no longer needed
Product: [Fedora] Fedora Reporter: Kalev Lember <kalevlember>
Component: rpmdevtoolsAssignee: Ville Skyttä <ville.skytta>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: a.badger, metherid, ville.skytta
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-04 19:46:03 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kalev Lember 2012-03-28 23:28:22 UTC
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

Comment 1 Ville Skyttä 2012-04-08 20:26:43 UTC
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.

Comment 2 Kalev Lember 2012-04-09 05:19:27 UTC
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.

Comment 3 Rahul Sundaram 2012-06-04 18:32:49 UTC
Any update on this?

Comment 4 Ville Skyttä 2012-06-04 19:46:03 UTC
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.