expansion error on multiple BuildRequires
Hi, When using multiple BuildRequires for different distributions like ------- %if %{suse_version} > 1000 BuildRequires: qt3-devel kdelibs3-devel %endif %if %{fedora_version} > 1 BuildRequires: qt-devel kdelibs-devel %endif ------- i always get "expansion error" for all distributions. is this a know issue or can this be fixed in any way? The same spec files works without a problem when building outside of the build service. BTW : it would be nice to know some details about the "expansion error". see https://bugzilla.novell.com/show_bug.cgi?id=154055 Regards, Stefan
On Wed, Apr 12, 2006 at 06:39:37PM +0200, Stefan Gerlach wrote:
When using multiple BuildRequires for different distributions like
------- %if %{suse_version} > 1000 BuildRequires: qt3-devel kdelibs3-devel %endif
%if %{fedora_version} > 1 BuildRequires: qt-devel kdelibs-devel %endif -------
i always get "expansion error" for all distributions. is this a know issue or can this be fixed in any way? The same spec files works without a problem when building outside of the build service.
Yes, I noticed your package ;). The problem is that this is kind of hopeless. There's simply no way for the build service code to deal with macros that call external commands. So if your specfile contains things like %define is_suse %(test -e /etc/SuSE-release && echo 1 || echo 0) %define is_fedora %(test -e /etc/fedora-release && echo 1 || echo 0) %define fedora_release %(rpm -q --queryformat '%{VERSION}' fedora-release) %define fedora_version %(echo "%fedora_release" | tr -d '.') you're out of luck. Suse already defines a "suse_version" macro which you can use (even in the build service), but it is a bit different from the one you use: it contains an extra digit for "beta" versions. We can define some macros for fedora and the other distributions if they don't have macros like this. Cheers, Michael. -- Michael Schroeder mls@suse.de main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);}
On Wednesday 12 April 2006 19:16, Michael Schroeder wrote:
Suse already defines a "suse_version" macro which you can use (even in the build service), but it is a bit different from the one you use: it contains an extra digit for "beta" versions.
We can define some macros for fedora and the other distributions if they don't have macros like this.
Maybe interesting: the buildsystems dar and pydar2 always use a macro 'dist'. This macro can have a variable like 'rh7', 'el4' or 'fc5'. An example: the buildsys uses a command like: rpmbuild -ba --define='dist fc5' some.spec. A spec file can use this macro directly or it can contain a line like: %{?dist: %{expand: %%define %dist 1}} Then you can use stuff like: %{?fc4:BuildRequires: gettext-devel} or %{?fc4:BuildRequires: gcc-gfortran} %{!?fc4:BuildRequires: gcc-g77} or %{?el3:%define _without_gamin 1} %{?fc2:%define _without_gamin 1} %{?fc1:%define _without_gamin 1} ... %{?_without_gamin:BuildRequires: fam-devel} %{!?_without_gamin:BuildRequires: gamin-devel} => new version of distro automatically uses the gamin-devel buildreq. It's just to give you an idea how it's done in other build systems. kind regards, Dries -- Rpm packages for Red Hat Enterprise Linux, Fedora Core and Aurora at http://dries.ulyssis.org/rpm/
------- %if %{suse_version} > 1000 BuildRequires: qt3-devel kdelibs3-devel %endif
%if %{fedora_version} > 1 BuildRequires: qt-devel kdelibs-devel %endif -------
Yes, I noticed your package ;). The problem is that this is kind of hopeless. There's simply no way for the build service code to deal with macros that call external commands.
OK. I reworked my spec file.
We can define some macros for fedora and the other distributions if they don't have macros like this.
Yes. That would help a lot. How about fedora_version, mandriva_version and debian_version? Greetings, Stefan
Hi, On Thu, Apr 13, 2006 at 11:04:10AM +0200, Stefan Gerlach wrote:
------- %if %{suse_version} > 1000 BuildRequires: qt3-devel kdelibs3-devel %endif
%if %{fedora_version} > 1 BuildRequires: qt-devel kdelibs-devel %endif -------
Yes, I noticed your package ;). The problem is that this is kind of hopeless. There's simply no way for the build service code to deal with macros that call external commands.
OK. I reworked my spec file.
We can define some macros for fedora and the other distributions if they don't have macros like this.
Yes. That would help a lot. How about fedora_version, mandriva_version and debian_version?
What's the status of this? Peter -- SUSE LINUX Products GmbH Thought is limitation. Research & Development Free your mind.
participants (4)
-
Dr. Peter Poeml
-
Dries Verachtert
-
Michael Schroeder
-
Stefan Gerlach