RPM Spec File - %define into %pre section

Todd Zullinger tmz at pobox.com
Mon Aug 17 22:30:00 UTC 2009


Bruno Galindro da Costa wrote:

(Please don't top post.  Trim the quotes and reply after.)

> Ok, I´m try to do that, but the variables that are defined on the
> top of spec file will be avaliable for the %post section? How can I
> access then on the %post section?
>
> *e.g:*
>
> *%post
> chgrp oracle: %{script_path}
> *

In a case like the example above, %{script_path} will be expanded by
rpm when the %post scriptlet is run.

If you are thinking more of how to get the current oracle group for
use in %post, it might be something like this:

%post
oracle_group=$(groups oracle | awk -F : '{print $2}' |awk '{print $1}')
chmod $oracle_group %{script_path}

Still, I'd look to avoid needing to do this entirely.

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Don't take life so seriously...it's not a permanent condition.
    -- Noire

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 542 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20090817/73559a1f/attachment-0001.sig>


More information about the fedora-list mailing list