[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [rpm-list] Setting binary rpm name according to a condition



Kevin Cosgrove wrote:
On 24 October 2006 at 8:53, Frank Cusack <fcusack fcusack com> wrote:

I want to build a src rpm file that can be built to a binary rpm. The
name of the binary rpm depends on a condition (actually, I want to check
the distribution type and set the binary rpm name accordingly). How can I
do that?
%_build_name_fmt

I like that A LOT better than my hack. Anything to simplify a spec file. Thanks! --
Kevin
Thanks for the answers. However, if I write something like:

if [ "%_vendor" = "suse" ] ; then
       _build_name_fmt="suse_name"
else if [ "%_vendor" = "redhat" ] ; then
       _build_name_fmt="redhat_name"
else
       echo "This version is not supported"
fi
fi


it doesn't set _build_name_fmt to the requested value. If I print it, it shows the following: _build_name_fmt = %{ARCH}/%{NAME}-%{VERSION}-%{RELEASE}-%{DISTRIBUTION}-%{ARCH}.rpm

I saw somewhere that I can set it in .rpmmacros. Is it the only way? Can I put a condition like that in the .rpmmacros file?

Thanks,
Erez



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]