Bug 807857 - rpmdev-newspec: rm -rf $RPM_BUILD_ROOT in %install no longer needed
Summary: rpmdev-newspec: rm -rf $RPM_BUILD_ROOT in %install no longer needed
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: rpmdevtools
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ville Skyttä
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-28 23:28 UTC by Kalev Lember
Modified: 2012-06-04 19:46 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-04 19:46:03 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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.


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