spec conditions

Greg_Swift at aotx.uscourts.gov Greg_Swift at aotx.uscourts.gov
Wed Jun 8 18:55:02 UTC 2011

rpm-list-bounces at lists.rpm.org wrote on 06/08/2011 10:16:29 AM:
> I'm sorry, the Summary code is wrong.
> This is the actual block:
> %define edition standard
> %if %{edition}==shared
> Conflicts: service-premium
> Summary: shared edition
> %description
> lim_procs=24
> %elseif %{edition}==premium
> Conflicts: service-standard
> Summary: premium edition
> %description
> lim_procs=64
> %endif

So... you could do this:

%{!?edition: %define edition standard}

%if %{edition}==shared
%define pkg_conflict service-premium
%define pkg_summary "shared edition"
%define pkg_description "lim_procs=24"

%elseif %{edition}==premium
%define pkg_conflict service-standard
%define pkg_summary "premium edition"
%define pkg_description "lim_procs=64"


Conflicts: %{pkg_conflict}
Summary: %{pkg_summary}

I didn't actually test this, but I believe it should work as is, or very
closely to.

Also added the conditional definition of edition at the top.  This way for
building of standard, you just do you package build.  To build the premium
you would just do:

rpmbuild -ba --define 'edition premium' service.spec


More information about the Rpm-list mailing list