[opensuse-buildservice] including Substitute: lines in project
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? Thanks Marc --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
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@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
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@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
if 0%{?suse_version} > 1030 %endif this will never fail. even on fedora the build would proceed. darix -- 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
Hi Marcus, Am Montag 10 März 2008 17:11:25 schrieb Marcus Rueckert:
if 0%{?suse_version} > 1030 %endif
this will never fail. even on fedora the build would proceed.
I'm looking for a method to test for a specific distribution version. Above example works for any suse version, because suse_version is set before, but e.g %if 0%{?fedora_version} >= 7 %endif or %if 0%{?fedora_version} == 6 %endif will not work. Thanks Marc -- "The enemy uses unauthorized weapons." Lord Arthur Ponsonby, "Falsehood in Wartime: Propaganda Lies of the First World War", 1928 --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On 2008-03-10 18:56:23 +0100, Marc wrote:
Am Montag 10 März 2008 17:11:25 schrieb Marcus Rueckert:
if 0%{?suse_version} > 1030 %endif
this will never fail. even on fedora the build would proceed.
I'm looking for a method to test for a specific distribution version. Above example works for any suse version, because suse_version is set before, but e.g
%if 0%{?fedora_version} >= 7 %endif or %if 0%{?fedora_version} == 6 %endif
will not work.
those work. try it darix -- 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
Marcus Rueckert wrote:
On 2008-03-10 18:56:23 +0100, Marc wrote:
Am Montag 10 März 2008 17:11:25 schrieb Marcus Rueckert:
if 0%{?suse_version} > 1030 %endif
this will never fail. even on fedora the build would proceed. I'm looking for a method to test for a specific distribution version. Above example works for any suse version, because suse_version is set before, but e.g
%if 0%{?fedora_version} >= 7 %endif or %if 0%{?fedora_version} == 6 %endif
will not work.
those work. try it
It works in rpm, but probably not in the project config parser, see my first post. openSUSE:10.3 has $ osc meta prjconf openSUSE:10.3| grep -e Macros -e suse_version %define suse_version 1030 Macros: %suse_version 1030 But Fedora:8 $ osc meta prjconf Fedora:8| grep -e Macros -e fedora_version Macros: %fedora_version 8 I.e. the fedora_version macro is available in rpm, but not in the project config. Michal --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Tuesday 11 March 2008 08:16:52 wrote Michal Marek:
Marcus Rueckert wrote:
On 2008-03-10 18:56:23 +0100, Marc wrote:
Am Montag 10 März 2008 17:11:25 schrieb Marcus Rueckert:
if 0%{?suse_version} > 1030 %endif
this will never fail. even on fedora the build would proceed.
I'm looking for a method to test for a specific distribution version. Above example works for any suse version, because suse_version is set before, but e.g
%if 0%{?fedora_version} >= 7 %endif or %if 0%{?fedora_version} == 6 %endif
will not work.
those work. try it
It works in rpm, but probably not in the project config parser, see my first post. openSUSE:10.3 has
$ osc meta prjconf openSUSE:10.3| grep -e Macros -e suse_version %define suse_version 1030 Macros: %suse_version 1030
But Fedora:8
$ osc meta prjconf Fedora:8| grep -e Macros -e fedora_version Macros: %fedora_version 8
I.e. the fedora_version macro is available in rpm, but not in the project config.
Right, I have changed this now. All rpm based distros should have this define now. thanks for reporting bye adrian -- Adrian Schroeter SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) email: adrian@suse.de --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Hi, Am Dienstag 11 März 2008 08:32:22 schrieb Adrian Schröter:
It works in rpm, but probably not in the project config parser, see my first post. openSUSE:10.3 has
$ osc meta prjconf openSUSE:10.3| grep -e Macros -e suse_version %define suse_version 1030 Macros: %suse_version 1030
But Fedora:8
$ osc meta prjconf Fedora:8| grep -e Macros -e fedora_version Macros: %fedora_version 8
I.e. the fedora_version macro is available in rpm, but not in the project config.
Right, I have changed this now. All rpm based distros should have this define now.
thanks Adrian! But for me, this is only a partial fix. AFAIK, the buildconfig does not support comparisons (==, <=, >=), so there is no possibility to distinguish between versions of the distribution. So an additional define like "fedora_version_8" would be useful. Thanks Marc -- "The enemy has the face of the devil." Lord Arthur Ponsonby, "Falsehood in Wartime: Propaganda Lies of the First World War", 1928 --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Marc wrote:
But for me, this is only a partial fix. AFAIK, the buildconfig does not support comparisons (==, <=, >=),
I'm almost certain it does. I used it myself some time ago: $ osc meta prjconf home:michal-m:rpmlint %if 0%{?suse_version} >= 1010 Support: rpmlint-bs %endif (it was >= 1030 when only the 10.3 repo worked, >= 10.2, etc, and it worked.) Michal --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Hi, Am Dienstag 11 März 2008 09:48:41 schrieb Michal Marek:
Marc wrote:
But for me, this is only a partial fix. AFAIK, the buildconfig does not support comparisons (==, <=, >=),
I'm almost certain it does. I used it myself some time ago:
$ osc meta prjconf home:michal-m:rpmlint %if 0%{?suse_version} >= 1010 Support: rpmlint-bs %endif
this test is always true when suse_version is defined, e.g. does not depend on the comparison. So, by luck it worked for you. You can change the 1010 to 1030 and there will be no difference for 10.1 and 10.2 version. Marc -- "It is a noble cause that we defend and not particular interests." Lord Arthur Ponsonby, "Falsehood in Wartime: Propaganda Lies of the First World War", 1928 --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Marc wrote:
Hi,
Am Dienstag 11 März 2008 09:48:41 schrieb Michal Marek:
Marc wrote:
But for me, this is only a partial fix. AFAIK, the buildconfig does not support comparisons (==, <=, >=), I'm almost certain it does. I used it myself some time ago:
$ osc meta prjconf home:michal-m:rpmlint %if 0%{?suse_version} >= 1010 Support: rpmlint-bs %endif
this test is always true when suse_version is defined, e.g. does not depend on the comparison. So, by luck it worked for you. You can change the 1010 to 1030 and there will be no difference for 10.1 and 10.2 version.
Do you have a project where it behaves this way? I don't want to change the rpmlint project config (it would trigger a few rebuilds). Michal --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Am Dienstag 11 März 2008 10:41:39 schrieb Michal Marek:
Marc wrote:
Hi,
Am Dienstag 11 März 2008 09:48:41 schrieb Michal Marek:
Marc wrote:
But for me, this is only a partial fix. AFAIK, the buildconfig does not support comparisons (==, <=, >=),
I'm almost certain it does. I used it myself some time ago:
$ osc meta prjconf home:michal-m:rpmlint %if 0%{?suse_version} >= 1010 Support: rpmlint-bs %endif
this test is always true when suse_version is defined, e.g. does not depend on the comparison. So, by luck it worked for you. You can change the 1010 to 1030 and there will be no difference for 10.1 and 10.2 version.
Do you have a project where it behaves this way? I don't want to change the rpmlint project config (it would trigger a few rebuilds).
ääh - forget what I said. Comparisons work as expected. Thanks Marc -- "It is a noble cause that we defend and not particular interests." Lord Arthur Ponsonby, "Falsehood in Wartime: Propaganda Lies of the First World War", 1928 --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (5)
-
Adrian Schröter
-
Marc
-
Marc Dietrich
-
Marcus Rueckert
-
Michal Marek