RPM Community Forums

Mailing List Message of <rpm-users>

Re: Glibc %post

From: Jeff Johnson <n3npq@mac.com>
Date: Mon 10 May 2010 - 01:02:05 CEST
Message-id: <8E2B539C-8FCE-4BB5-B41F-B35E992CD7A8@mac.com>

On May 9, 2010, at 6:55 PM, Eric MSP Veith wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Monday 10 May 2010, Jeff Johnson <n3npq@mac.com> wrote:
>> Well you _REALLY_ don't want to do any of that "stuff" while
>> upgrading glibc reliably: do your dirty and move on, this _IS_
>> the innermost circle of the dependency inferno.
> 
> Yikes, no, not for the GLIBC package, sorry for the misunderstanding. This 
> question was more generally spoken.
> 
> What I wanted to ask is: Consider I have some init file as "Source42: 
> myfoo.init", which has stuff like "%{_sbindir}/foodaemon" or 
> "%{my_custom_specfile_define}" in it. Is there a way to design a lu 
> macro/script I can call from a spec file to do this kind of subsitution? In 
> a way of "%{install_init_file %{SOURCE42}}"?
> 

So you want macros expanded generally within, say, %config file bodies?

Quite doable, its <20 line of code (including the pesky memory management).

RPM macros are quite good ate the templating mehcanism.

But you, the end luser, MUST ensure that RPM is configured correctly.

But if you want file content macro expanded, then experiment with, say
	rpm -E "`cat /etc/sysconfig/iptables`" > /etc/sysconfig/iptables
(just to pick on some obscure %config file).

All depends on getting your head around "templating" rather than "patching".

73 de Jeff
Received on Mon May 10 01:02:59 2010
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.