RPM Community Forums

Mailing List Message of <rpm-users>

conditionally define %_rpmfilename macro

From: Jeff Putsch <putsch@mxim.com>
Date: Fri 09 Jan 2009 - 20:40:41 CET
Message-Id: <B7954286-372F-4226-94BD-92A0A64AC0CC@mxim.com>

I'd like the format for the rpm filename to depend on whether the RPM  
is a 'noarch' package or for a specific architecture.

I'd like to do something like the following in /etc/rpm/rpmmacros  
(borrowing from spec file format):

%ifnarch noarch
%_rpmfilename  %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}-%%{OS}.rpm
%_rpmfilename  %%{NAME}-%%{VERSION}-%%{RELEASE}.%noarch.rpm

I've googled, read the docs, and the source macro files that come with  
rpm5, to no avail.

I'm clearly too much of a newbie to RPM macro files to know how to  
properly do what I'd like.

Any help, guidance, or hints will be greatly appreciated.

Thanks in advance,

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