[opensuse-buildservice] How to detect distribution with %if block in .spec file ??
Hello, I want to put into the .spec file some block distribution-dependent... so, it would very nice if is it possible to use the %if syntax to detect the distribution and run the corrisponding block only on some distributions. Of course, I can create name-Distro.spec file for each Distro... but sometimes is more useful the %if syntax because there are somethings that changes between Suse and Fedora ... but remains the same on all Fedora (6,7,8)... so, instead of creating three .spec identically for each version of Fedora, it would more easy to add just one block to detect if is a Suse or Fedora distro. Thanks, Gianluca --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Jan 29, 2008 4:45 PM, G. Massera <gmassera@istc.cnr.it> wrote:
Hello, I want to put into the .spec file some block distribution-dependent... so, it would very nice if is it possible to use the %if syntax to detect the distribution and run the corrisponding block only on some distributions. Of course, I can create name-Distro.spec file for each Distro... but sometimes is more useful the %if syntax because there are somethings that changes between Suse and Fedora ... but remains the same on all Fedora (6,7,8)... so, instead of creating three .spec identically for each version of Fedora, it would more easy to add just one block to detect if is a Suse or Fedora distro.
I think you're looking for this: %if %{defined suse_version} %if %{undefined suse_version} %if 0%{?fedora_version} < 5 %if 0%{?mandriva_version} > 2006 ... More information is on the wiki page http://en.opensuse.org/Build_Service/cross_distribution_package_how_to Regards Ladislav. --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (2)
-
G. Massera
-
Ladislav Michnovič