Mailinglist Archive: opensuse-packaging (99 mails)

< Previous Next >
Re: [opensuse-packaging] How to detect package's version in specfile?
  • From: Guido Berhoerster <gber@xxxxxxxxxxxx>
  • Date: Tue, 30 Oct 2012 09:38:19 +0100
  • Message-id: <20121030083819.GA15123@hal.local.invalid>
* Marguerite Su <i@xxxxxxxxxxxxx> [2012-10-30 09:10]:
Hi, all

I have to detect xulrunner-devel version in specfile.

but I got a problem:

the version in `rpm -q --qf='%{version}' xulrunner-devel` will be
overridden by the "Version: " in specfile itself.

any ideas?

%define xulrunner_version %(rpm -q --queryformat '%%{VERSION}' xulrunner-devel)

should work. "%()" is expanded together with the macros before building so you
can use the %xulrunner_version for %if blocks, two "%" escape the version
macro. Needless to say that this isn't really pretty.
--
Guido Berhoerster
--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-packaging+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups
References