<br><br><div class="gmail_quote">2009/5/4 Enrico Scholz <span dir="ltr"><<a href="mailto:enrico.scholz@informatik.tu-chemnitz.de">enrico.scholz@informatik.tu-chemnitz.de</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">Gagadget <<a href="mailto:gagadget@gmail.com">gagadget@gmail.com</a>> writes:<br>
<br>
> %define VERSION 9.6.0<br>
> %define PATCHVER 1<br>
> [ ... ]<br>
> %if %{PATCHVER}<br>
> Source0:<br>
> <a href="ftp://ftp.isc.org/isc/bind9/%%7BVERSION%7D-P%%7BPATCHVER%7D/bind-%%7BVERSION%7D-P%%7BPATCHVER%7D.tar.gz" target="_blank">ftp://ftp.isc.org/isc/bind9/%{VERSION}-P%{PATCHVER}/bind-%{VERSION}-P%{PATCHVER}.tar.gz</a><br>

> %else<br>
> Source0:<br>
> <a href="ftp://ftp.isc.org/isc/bind9/%%7BVERSION%7D/bind-%%7BVERSION%7D.tar.gz" target="_blank">ftp://ftp.isc.org/isc/bind9/%{VERSION}/bind-%{VERSION}.tar.gz</a><br>
> %endif<br>
><br>
> It works, but I'd like to know if there is a more recursive way to avoid<br>
> if/else ? Using "?" macro or something like that ?<br>
<br>
</div>%global XVER      %VERSION%{?PATCHVER:-P%PATCHVER}<br>
Source0:          <a href="ftp://ftp.isc.org/isc/bind9/%XVER/bind-%XVER.tar.gz" target="_blank">ftp://ftp.isc.org/isc/bind9/%XVER/bind-%XVER.tar.gz</a><br>
<br>
and do not define 'PATCHVER 0'<br>
<font color="#888888"></font></blockquote><div><br>Thank you, here is what I did :<br><br>%define VERSION 9.6.0<br>%define PATCHVER 1<br>%define DISTVER mylocaldist<br>%define PKGVER 1<br>[...]<br>Version:        %{VERSION}<br>
Release:        %{?PATCHVER:P%PATCHVER.}%{DISTVER}.%{PKGVER}<br>[...]<br>Source0:        <a href="ftp://ftp.isc.org/isc/bind9/%{VERSION}%{?PATCHVER:-P%PATCHVER}/bind-%{VERSION}%{?PATCHVER:-P%PATCHVER}.tar.gz">ftp://ftp.isc.org/isc/bind9/%{VERSION}%{?PATCHVER:-P%PATCHVER}/bind-%{VERSION}%{?PATCHVER:-P%PATCHVER}.tar.gz</a><br>
[...]<br>%prep<br>%setup -q -n %{name}-%{VERSION}%{?PATCHVER:-P%PATCHVER}<br><br>I can't define a BINDVER or XVER because I want to have the Patchlevel in the Release tag, and it refuse the "-". With the above, my rpm is named bind-9.6.0-P1.mylocaldist.1<br>
<br>One question :<br><br>If i do <br># %define PATCHVER 1<br><br>The PATCHVER is still define, I have to delete it to get it work ??? Is it normal ?<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<font color="#888888"><br>
<br>
Enrico<br>
</font><div><div></div><div class="h5"><br>
--<br>
Fedora-packaging mailing list<br>
<a href="mailto:Fedora-packaging@redhat.com">Fedora-packaging@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/fedora-packaging" target="_blank">https://www.redhat.com/mailman/listinfo/fedora-packaging</a><br>
</div></div></blockquote></div><br>