Mailinglist Archive: opensuse-buildservice (339 mails)

< Previous Next >
Re: [opensuse-buildservice] including Substitute: lines in project
  • From: Michal Marek <mmarek@xxxxxxx>
  • Date: Mon, 10 Mar 2008 08:47:23 +0100
  • Message-id: <47D4E78B.8030608@xxxxxxx>
Marc Dietrich wrote:
Hi,

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

Macros:
%vendor openSUSE Build Service

### from Fedora:7
%_repository standard
%opensuse_bs 1
%fedora_version 7
%_vendor redhat

%ext_info .gz
%ext_man .gz

%info_add(:-:) test -x /sbin/install-info -a -f %{?2}%{?!2:%
{_infodir}}/%{1}%ext_info && /sbin/install-info --info-dir=%{?2}%{?!2:%
{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \ %{nil}

%info_del(:-:) test -x /sbin/install-info -a ! -f %{?2}%{?!2:%
{_infodir}}/%{1}%ext_info && /sbin/install-info --quiet --delete
--info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%
ext_info \ %{nil}

### from home:marvin24
%_repository Fedora_7

%distribution home:marvin24 / Fedora_7

---------------------------

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

Michal
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups
References