On Thu, 2003-12-11 at 23:27, bishop wrote: > In that file, I have a common construct: > > %if "%(rpm -qf /etc/issue --qf %%{name})" == "redhat-release" > > %define apacheName %(rpm -q --qf "%%{name}" --whatprovides webserver) > > %else > > %define apacheName apache > > %endif > > %define apacheDevelName %{apacheName}-devel > > This is probably something EVERYONE's seen, unfortunately, or at least > anyone who builds package for RH7 and RH9 and which depends on the web > server being present (Joe, can ya toss a provides:webserver-devel in > there?). > > The problem is, when %expand picks up the output of the %(), it runs > BOTH parts of the %if. It leads me to believe that %expand only deals > with things line-by-line. True? If so, how does one do an %if/else > like the above on a single line? Have you tried: %{expand: %%define apacheName %%(rpm -q --qf "%%{name}" --whatprovides webserver)} (I'm not sure whether "%%{name}" will expand correctly, though ...) and: %{expand: %%define apacheName apache} ? _______________________________________________ Rpm-list mailing list Rpm-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/rpm-list