From Fedora Project Wiki

fp-wiki>ImportUser
(Imported from MoinMoin)
 
m (PackagingDrafts/BuildRootHandling moved to Archive:PackagingDrafts/BuildRootHandling: (only one minor revisions since import from MoinMoin May 2008) Appears to already be applied to Packaging:Guidelines#BuildRoot_tag and Packaging:ReviewGuidelines)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Proposal: It is important to carefully handle the !BuildRoot during %install, to ensure that it is created fresh. I propose that the following be added to the Packaging/Guidelines (as a subsection to [wiki:Self:Packaging/Guidelines#BuildRoot BuildRoot] ):
Proposal: It is important to carefully handle the !BuildRoot during %install, to ensure that it is created fresh. I propose that the following be added to the Packaging/Guidelines (as a subsection to [[Packaging/Guidelines#BuildRoot |BuildRoot]] ):


{{Anchor|PreppingBuildRootForInstall}}
{{Anchor|PreppingBuildRootForInstall}}
Line 22: Line 22:
Also, the following will be added to Packaging/ReviewGuidelines:
Also, the following will be added to Packaging/ReviewGuidelines:


- '''MUST''': At the beginning of <code>%install</code>, each package MUST run <code>rm -rf %{buildroot}</code> ([wiki:Self:Packaging/Guidelines#UsingBuildRootOptFlags or $RPM_BUILD_ROOT] ). See [wiki:Self:Packaging/Guidelines#PreppingBuildRootForInstall Prepping BuildRoot For %install]  for details.
- '''MUST''': At the beginning of <code>%install</code>, each package MUST run <code>rm -rf %{buildroot}</code> ([[Packaging/Guidelines#Using_.25.7Bbuildroot.7D_and_.25.7Boptflags.7D_vs_.24RPM_BUILD_ROOT_and_.24RPM_OPT_FLAGS]] ). See [[Packaging/Guidelines#Prepping_BuildRoot_For_.25install]]  for details.
 
[[Category:Archived packaging guideline drafts]]

Latest revision as of 21:38, 21 February 2009

Proposal: It is important to carefully handle the !BuildRoot during %install, to ensure that it is created fresh. I propose that the following be added to the Packaging/Guidelines (as a subsection to BuildRoot ):

Prepping BuildRoot For %install

It is important to properly prepare the !BuildRoot in the %install section of your package before it is used. Every Fedora package MUST have an %install section that begins with either:

%install
rm -rf %{buildroot}

or

%install
rm -rf $RPM_BUILD_ROOT

This is to ensure that the !BuildRoot will be created fresh during the %install section.


Also, the following will be added to Packaging/ReviewGuidelines:

- MUST: At the beginning of %install, each package MUST run rm -rf %{buildroot} (Packaging/Guidelines#Using_.25.7Bbuildroot.7D_and_.25.7Boptflags.7D_vs_.24RPM_BUILD_ROOT_and_.24RPM_OPT_FLAGS ). See Packaging/Guidelines#Prepping_BuildRoot_For_.25install for details.