[Fedora-packaging] Phase out buildroot?

Chuck Anderson cra at WPI.EDU
Thu May 21 06:39:48 UTC 2009


On Wed, May 20, 2009 at 11:05:57PM -0700, Toshio Kuratomi wrote:
> On 05/20/2009 08:47 PM, Chuck Anderson wrote:
>> On Wed, May 20, 2009 at 05:46:18PM -0700, Toshio Kuratomi wrote:
>>> Since the rpm version shipped in Fedora 10 and beyond defines a default
>>> buildroot, I think we can start phasing out the current buildroot
>>> Guideline.  How about adding this to the start of the buildroot tag
>>> section?
>>
>> I'd be concerned about accidentally blowing away people's systems if
>> they take a src.rpm from Fedora and try to build it on an older Fedora
>> or non-Fedora system.
>>
>> %install
>> rm -rf $RPM_BUILD_ROOT
>> ...
>>
>> %clean
>> rm -rf $RPM_BUILD_ROOT
>>
>
> What will this evaluate to on older systems?  Won't it be "rm -rf\n"?  
> Which actually won't remove anything?

Last I knew, it will evaluate to / and all hilarity will ensue.  Once 
upon a time, the recommendation was to use something like this to 
prevent such disasters:

[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

That fell out of favor when the BuildRoot: tag was mandated in Fedora 
packages.  If we remove the BuildRoot: requirement and instead rely 
upon the new rpmbuild default, we risk obliterating unsuspecting 
users' systems.

I have a better idea.  How about we get rpmbuild to automatically do 
the moral equivalent of "[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf 
$RPM_BUILD_ROOT" internally before starting %install and %clean, and 
remove all such boilerplate from all Fedora specs.  Then we can remove 
the BuildRoot: requirement as well, and older/non-Fedora systems will 
just break/pollute/fail to cleanup the build instead of blowing away 
the users system, a much lesser evil IMO.




More information about the packaging mailing list