[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Evaluating macros from outside a spec file
- From: Simon Mudd <sjmudd pobox com>
- To: rpm-list redhat com
- Subject: Re: Evaluating macros from outside a spec file
- Date: 24 Aug 2004 23:41:04 +0200
Hi Jeff,
jbj@redhat.com (Jeff Johnson) writes:
[snip]
> > A simple example in a shell script would be to evaluate %{_sourcedir}
> >
> > $ rpm --eval '%{_sourcedir}'
> >
> > This is fine and works as expected when %{_sourcedir} itself contains no
> > macro names.
> >
> > However in my ~/.rpmmacros I have %_sourcedir defined as follows:
> >
> > %_sourcedir %{_topdir}/SRC/%{name}
>
> Ummm, %name is pkg dependent, as you have discovered.
Yes, precisely.
[snip]
> Try (if you must, there's certainly easier ways to get a path):
>
> rpm --define "name `rpm -q --qf '%{name}' --specfile /path/to/specfile.spec`" --eval '%{_sourcedir}'
This works as expected, thanks, but it assumes you *know* that %{name}
is in the %_sourcedir macro definition. Is there a generic way to get
rpm to provide the value of a macro defined from within a spec file?
(this is already done when creating the different rpm scriplets)
You mention that there are easier ways of getting a path. Perhaps you
could elaborate?
73 Simon
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]