Linux

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Need some macro voodoo advice

    5 answers - 1117 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hi all,
    I am trying to automatically change the Release name based on the
    options that were used when building the rpm. For example, if no build
    options were present then use:
    Release: 1.%{svnrev}%{?dist}
    If the jb option was used then use:
    %{?_with_jb:Release: 1.%{svnrev}_JB%{?dist}}
    If the siptcp option was used then use:
    %{?_with_siptcp:Release: 1.%{svnrev}_SIPTCP%{?dist}}
    And here surfaces the first problem. With both lines in the spec file,
    trying to build the RPM I get this error message:
    error: Duplicate Release entries in package: (main package)
    If the jb siptcp options were used then use
    and that's where I can't figure out how to stick two options in the
    example above (assuming the duplicate error above is solvable). I tried
    this but it did not work:
    %{?_with_jb || ?_with_siptcp:Release 1.%{svnrev}_JB_SIPTCP%{dist}}
    Anyone have an idea if this is possible and what the proper syntax is?
    Thanks and regards,
    Patrick
    Rpm-list mailing list
    Rpm-list (AT) redhat (DOT) com
  • No.1 | | 560 bytes | |

    Sep 18, 2006, at 8:19 AM, Patrick wrote:

    --
    %{?_with_jb || ?_with_siptcp:Release 1.%{svnrev}_JB_SIPTCP%{dist}}

    This bit of ugliness might work (untested)

    %if %{?_with_jb:1}%{?_with_siptcp:1}0
    Release 1.%{svnrev}_JB_SIPTCP%{dist}
    %endif

    I'd simplify the mess if I were you. Do you *really* need more
    crapola in the Release: field?
    Does add "JB", or "SIPTCP", or dist, or svnid *really* help anyone us
    the package?

    73 de Jeff

    Rpm-list mailing list
    Rpm-list (AT) redhat (DOT) com
  • No.2 | | 827 bytes | |

    Hi Jeff,

    Mon, 2006-09-18 at 08:44 -0400, Jeff Johnson wrote:
    Sep 18, 2006, at 8:19 AM, Patrick wrote:>

    %{?_with_jb || ?_with_siptcp:Release 1.%{svnrev}_JB_SIPTCP%{dist}}>

    This bit of ugliness might work (untested)

    %if %{?_with_jb:1}%{?_with_siptcp:1}0
    Release 1.%{svnrev}_JB_SIPTCP%{dist}
    %endif

    Works like a charm. Thanks!

    I'd simplify the mess if I were you. Do you *really* need more
    crapola in the Release: field?
    Does add "JB", or "SIPTCP", or dist, or svnid *really* help anyone us
    the package?

    This is for testing purposes only so that it is clear to the test folks
    what is exactly in the rpm and which options were used to build it.

    Regards,
    Patrick

    Rpm-list mailing list
    Rpm-list (AT) redhat (DOT) com
  • No.3 | | 1181 bytes | |

    Mon, 2006-09-18 at 15:35 +0200, Patrick wrote:
    Hi Jeff,

    Mon, 2006-09-18 at 08:44 -0400, Jeff Johnson wrote:
    Sep 18, 2006, at 8:19 AM, Patrick wrote:>

    %{?_with_jb || ?_with_siptcp:Release 1.%{svnrev}_JB_SIPTCP%{dist}}>

    This bit of ugliness might work (untested)

    %if %{?_with_jb:1}%{?_with_siptcp:1}0
    Release 1.%{svnrev}_JB_SIPTCP%{dist}
    %endif

    Works like a charm. Thanks!

    Spoke too soon. Any idea how I can make it pick the right Release name
    based on which build options where enabled. The possible choices are:

    jb
    siptcp
    jb siptcp
    none of the above

    This does not work (not surprising give my lack of knowledge of this
    stuff :)

    %if %{?_with_jb:1}%{?_with_siptcp:1}0
    Release 1.%{svnrev}_JB_SIPTCP%{dist}
    %else
    %if %{?_with_jb:0}%{?_with_siptcp:1}0
    Release 1.%{svnrev}_SIPTCP%{dist}
    %else
    %if %{?_with_jb:1}%{?_with_siptcp:0}0
    Release 1.%{svnrev}_JB%{dist}
    %else
    %if %{?_with_jb:0}%{?_with_siptcp:0}0
    Release 1.%{svnrev}%{dist}
    %endif

    Thanks and regards,
    Patrick

    Rpm-list mailing list
    Rpm-list (AT) redhat (DOT) com
  • No.4 | | 771 bytes | |

    Patrick wrote :

    Spoke too soon. Any idea how I can make it pick the right Release name
    based on which build options where enabled. The possible choices are:

    jb
    siptcp
    jb siptcp
    none of the above

    This does not work (not surprising give my lack of knowledge of this
    stuff :)

    %if %{?_with_jb:1}%{?_with_siptcp:1}0
    Release 1.%{svnrev}_JB_SIPTCP%{dist}
    %else
    %if %{?_with_jb:0}%{?_with_siptcp:1}0
    Release 1.%{svnrev}_SIPTCP%{dist}
    %else
    %if %{?_with_jb:1}%{?_with_siptcp:0}0
    Release 1.%{svnrev}_JB%{dist}
    %else
    %if %{?_with_jb:0}%{?_with_siptcp:0}0
    Release 1.%{svnrev}%{dist}
    %endif

    Why no just this?

    Release: 1.%{svnrev}%{?_with_jb:_JB}%{?_with_siptcp:_SIPTCP }%{?dist}

    Matthias
  • No.5 | | 306 bytes | |

    Mon, 2006-09-18 at 17:03 +0200, Matthias Saou wrote:
    [snip]
    Why no just this?

    Release: 1.%{svnrev}%{?_with_jb:_JB}%{?_with_siptcp:_SIPTCP }%{?dist}

    That did the trick. Many thanks!

    Regards,
    Patrick

    Rpm-list mailing list
    Rpm-list (AT) redhat (DOT) com

Re: Need some macro voodoo advice


max 4000 letters.
Your nickname that display:
In order to stop the spam: 1 + 0 =
QUESTION ON "Linux"

EMSDN.COM