RPM Community Forums

Mailing List Message of <rpm-users>

Re: conditionally define %_rpmfilename macro

From: Jeff Putsch <putsch@mxim.com>
Date: Fri 09 Jan 2009 - 22:45:03 CET
Message-Id: <E30DD1B5-5688-4FDC-ACBC-20C7D7AAFB98@mxim.com>
Thanks for the help.

The approach is enlightening.

Jeff.

On Jan 9, 2009, at 11:56 AM, Jeff Johnson wrote:

> So you want a single constant-valued
>
>   %_rpmfilename  %%{NAME}-%%{VERSION}-%%{RELEASE}.%{myarchsuffix}.rpm
>
> template, with the details buried in %{myarchsuffix}.
>
> Default into a per-noarch case and a fallback:
> 	%myarchprefix	%{?mynoarchsuffix}%{!?mynoarchsuffix:%%{ARCH}-%%{OS}}
>
> This is basically a if ... then ... else ... fi construct based on
> the existence of a %mynoarchsuffix macro (the value of which will be  
> used if defined)
> with an %{!?...:...} else clause for "everything but noarch".
>
> Finally, supply a definition in the noarch macro configuration,
> usually in /usr/lib/rpm/noarch-linux/macros (but could be elsewhere)  
> as
> 	%mynoarchsuffix		whateveryouwant
>
> hth
>
> 73 de Jeff

--
Jeff Putsch
Email: putsch@mxim.com
Office: 503.267.5480
Horse ... Water ... Drink.
Received on Fri Jan 9 22:45:04 2009
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.