RPM Spec File - %define into %pre section

Bruno Galindro da Costa bruno.galindro at gmail.com
Mon Aug 17 20:55:12 UTC 2009


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}
*



2009/8/17 Todd Zullinger <tmz at pobox.com>

> Bruno Galindro da Costa wrote:
> > I´m building a RPM package and I need to check if a user exists
> > before install the package. If user exists, the script will create
> > him in the system. Before I compile then, I´ve  tried to install it,
> > but the following error is displayed. Is this because I´ve putted a
> > %define into the %pre section? How can I define a variable that I
> > %can use on the %defattr directive inside %pre section?
>
> I don't think you can do what you want with rpm.  By the time the %pre
> scriptlet is running, the %defattr in the %files section is long since
> set.  You could use chgrp in %post to fix up the group ownership of
> the files, which will make rpm complain if you run --verify against
> this package.
>
> There's probably a better way to handle this if you're willing and
> able to change more than just this one package.  It seems to me that
> needing to do this seems like a good indication that something else is
> wrong.
>
> --
> Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp<http://www.pobox.com/%7Etmz/pgp>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> All I really want for Christmas is Santa's list of Naughty Girls.
>
>
> --
> fedora-list mailing list
> fedora-list at redhat.com
> To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
> Guidelines:
> http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
>



-- 
Att.
Bruno Galindro da Costa
bruno.galindro at gmail.com
Florianópolis - SC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20090817/2baa2b02/attachment-0001.htm>


More information about the fedora-list mailing list