[opensuse-buildservice] Conditional %include?
Is it possible to do a conditional spec file include? ie. %if "%_vendor" == "suse" %include %SOURCE1 %else %include %SOURCE2 %endif I ask because it doesn't seem to care whether it's inside a conditional or not... -- Troy Telford --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Op Friday 13 April 2007 02:32:27 schreef Troy Telford:
Is it possible to do a conditional spec file include?
ie. %if "%_vendor" == "suse" %include %SOURCE1 %else %include %SOURCE2 %endif
I ask because it doesn't seem to care whether it's inside a conditional or not...
You could just include both and install the right one based on the version: %if "%_vendor" == "suse" cp %{SOURCE1} destination %else cp %{SOURCE2} destination %endif -- Richard Bos Without a home the journey is endless --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
%if "%_vendor" == "suse" Source1: redhat.init %else Source1: suse.init %endif %install %{__install} -d -m 0755 %{S:1} %{buildroot}%{_sysconfdir}/init.d/%{name} -- Richard Bos Without a home the journey is endless --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On 2007-04-14 00:03:17 +0200, Marcus Rueckert wrote:
%if "%_vendor" == "suse" Source1: redhat.init %else Source1: suse.init %endif
Well.. this works of course but it's not a good idea to do something like this IMHO. Imagine you will grab the suse src.rpm and try to rebuild it on a redhat system. So it's better to include _all_ sources and put the %if's into the %install section. Marcus --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Op zaterdag 14 april 2007 14:05, schreef Marcus Hüwe:
On 2007-04-14 00:03:17 +0200, Marcus Rueckert wrote:
%if "%_vendor" == "suse" Source1: redhat.init %else Source1: suse.init %endif
Well.. this works of course but it's not a good idea to do something like this IMHO. Imagine you will grab the suse src.rpm and try to rebuild it on a redhat system. So it's better to include _all_ sources and put the %if's into the %install section.
That's very true, Marcus! -- Richard Bos Without a home the journey is endless --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (4)
-
Marcus Hüwe
-
Marcus Rueckert
-
Richard Bos
-
Troy Telford