Mailinglist Archive: opensuse-buildservice (339 mails)

< Previous Next >
Re: [opensuse-buildservice] including Substitute: lines in project
  • From: Marc <Marc.Dietrich@xxxxxxxxxxxxxxxxxxxxxxxx>
  • Date: Mon, 10 Mar 2008 17:08:27 +0100
  • Message-id: <200803101708.28820.marc.dietrich@xxxxxxxxxxxxxxxxxxxxxxxx>

Hi,

Am Montag 10 März 2008 08:47:23 schrieb Michal Marek:
Marc Dietrich wrote:
I'm having problems to include package substitutions into my project. I
did "osc meta prjconf home:marvin24 -e":

%if %{defined fedora_version}
Substitute: libapr1-devel apr-devel
Substitute: libapr-util1-devel apr-util-devel
Substitute: gstreamer010-plugins-base-devel gstreamer-plugins-base-devel
Substitute: libcares-devel c-ares-devel
%endif

and osc buildconfig Fedora_7 i586 shows:

-------------------
<snip>
#
# experimentel, testing for mc
#
Substitute: sgml-skel sgml-common
Substitute: docbook-xsl-stylesheets docbook-style-xsl

Substitute: libelf elfutils-libelf
Substitute: popt-devel popt


### from home:marvin24
%define _repository Fedora_7
%if %{defined fedora_version}
Substitute: libapr1-devel apr-devel
Substitute: libapr-util1-devel apr-util-devel
Substitute: gstreamer010-plugins-base-devel gstreamer-plugins-base-devel
Substitute: libcares-devel c-ares-devel
%endif

<snip>
---------------------------

I see that fedora_version is defined later. Is the order important here?
Does this work at all?

For openSUSE tagets, there's an extra

%define suse_version 1030

line _before_ the Macros: section, so that the %suse_version macro can
be referred to in the project configs. It should be added for Fedora,
too (if my understanding of the config parser is correct).

But I'm not sure the %{defined ...} macro is going to work - in rpm this
is not a builtin macro, but it's defined in /usr/lib/rpm/macros. Chances
are that the config parser won't know this macro. Better use

%if 0%{?somemacro:1}
...
%endif

yes - this works as a test for a non-suse-version ( I use %if
0%{!?suse_version:1} now), but this is by far not optimal.

Given the limited possibilities of rpm, the best would be to define macros
like:
suse_version_1030
fedora_version_7
mandriva_version_10
...
before the user-defined macros.

This would make cross-platform spec files more simple as it also makes it
easier to maintain large projects. Is this possible?

Thanks

Marc
-
"Artists and intellectuals support our cause."
Lord Arthur Ponsonby, "Falsehood in Wartime: Propaganda Lies
of the First
World War", 1928
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups