Bug 807857 - rpmdev-newspec: rm -rf $RPM_BUILD_ROOT in %install no longer needed
rpmdev-newspec: rm -rf $RPM_BUILD_ROOT in %install no longer needed
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: rpmdevtools (Show other bugs)
17
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Ville Skyttä
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-28 19:28 EDT by Kalev Lember
Modified: 2012-06-04 15:46 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-04 15:46:03 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Kalev Lember 2012-03-28 19:28:22 EDT
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 16:26:43 EDT
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 01:19:27 EDT
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 14:32:49 EDT
Any update on this?
Comment 4 Ville Skyttä 2012-06-04 15:46:03 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.