RPM Community Forums

Mailing List Message of <rpm-devel>

Re: %clean replace ??

From: Jeff Johnson <n3npq@mac.com>
Date: Mon 11 Jun 2007 - 22:20:18 CEST
Message-Id: <F496F6E7-A009-4358-9FC9-1CBF6805CE5F@mac.com>

On Jun 11, 2007, at 10:44 AM, Mark Hatle wrote:

> Olivier Thauvin wrote:
>> Also, instead performing this rm during %install, why not simply  
>> run %clean
>> instead before when at %install step (aka %install call %clean).
>>
>> WDYT ?
>
> Just an fyi, for some various reasons, we occasionally need the % 
> install
> section to NOT clean the buildroot.. This is because we're only use  
> the
> spec file to handle a few minor issues (like the automatic debuginfo
> generation), while other components of our build environment are
> compiling and copying the files into the buildroot.
>

There's a means to change the automagic by re-defining a macro.

Here is the mechanism that injects "rm -rf %{buildroot}" immediately  
after %install:

%__spec_install_pre     %{___build_pre}\
%{?buildroot:%{__rm} -rf '%{buildroot}'}

The expansion of %{___build_pre} maps macro values into envvars.

73 de Jeff
Received on Mon Jun 11 22:21:06 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.