RPM Community Forums

Mailing List Message of <rpm-users>

Re: Evaluating macros defined in specfiles

From: Michael Jennings <mej@kainx.org>
Date: Sun 03 May 2009 - 01:56:02 CEST
Message-ID: <20090502235602.GA10217@kainx.org>
On Sunday, 03 May 2009, at 00:38:39 (+0200),
Eric MSP Veith wrote:

> Background is: I wrote a little Perl script that translates macros in files 
> for me. I use this for config or init files I supply with packages and which 
> sometimes need a full path, and since I don't want to explicility use sed 
> every time, I wrote this convenience script. I basically have lines like 
> 
> "%{__cat} '%{SOURCE1}' | %{__m2rpath} > somefile'

Have you tried:

cat >somefile <<EOF
%{expand:%(%{__cat} %{SOURCE1})}
EOF

Michael

-- 
Michael Jennings (a.k.a. KainX)  http://www.kainx.org/  <mej@kainx.org>
Linux Server/Cluster Admin, LBL.gov       Author, Eterm (www.eterm.org)
-----------------------------------------------------------------------
 "As your attorney, it is my duty to inform you that it is not
  important that you understand what I'm doing or why you're paying
  me so much money. What's important is that you continue to do so."
                                      -- Hunter S. Thompson's Attorney
Received on Sun May 3 02:06:51 2009
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.