[Fedora-packaging] disttag

Tom 'spot' Callaway tcallawa at redhat.com
Fri Feb 25 00:48:12 UTC 2005


On Thu, 2005-02-24 at 18:16 -0600, Tom 'spot' Callaway wrote:
>On Fri, 2005-02-25 at 00:49 +0100, Dag Wieers wrote:
>
>>With the high probability of being flamed again, RPMforge settled for:
>>
>>0.el2 < 0.rh7 < 0.rh8 < 0.rh9 < 1.el3 < 1.fc1 < 1.fc2 < 1.fc3 < 2.el4 < 2.fc4 < 2.fc5

>I'm not opposed to it. Would you be willing to try and modify the macros
>I posted earlier to fit that schema?

OK. Here is a way to make the macros fit that schema:

# Disttag macros (you really only want to use %{disttag})
# When we get to Fedora Core 6, we'll need to revisit this.

%disttaglong %{expand:%%(rpm -qi `rpm -qf /etc/redhat-release` |grep
Version | cut -d ":" -f 2 | cut -d " " -f 2 | perl -pe 's/^\s+//')}
%rheldisttag %{expand:%%(echo %{disttaglong} | sed -e 's/[^0-9.]//g' -e
's/^/el/')}
%rhldisttag  %{expand:%%(echo %{disttaglong} | cut -d "." -f 1 | sed -e
's/^/rh/')}
%fcdisttag   %{expand:%%(echo %{disttaglong} | sed -e 's/^/fc/')}
%disttag     %{expand:%%(if echo %{disttaglong} | grep "[^0-9.]"
> /dev/null; then \
  case "%{rheldisttag}" in \
    ( "el2" ) \
    echo 0.%{rheldisttag} \
    ;; \
    ( "el3" ) \
    echo 1.%{rheldisttag} \
    ;; \
    ( "el4" ) \
    echo 2.%{rheldisttag} \
    ;; \
    ( "el5" ) \
    echo 3.%{rheldisttag} \
    ;; \
  esac; \
else \
  case "%{disttaglong}" in \
    ( "7.0" | "7.1" | "7.2" | "7.3" | "8" | "9" ) \
    echo 0.%{rhldisttag} \
    ;; \
    ( "1" | "2" | "3" ) \
    echo 1.%{fcdisttag} \
    ;; \
    ("4" | "5" | "6" ) \
    echo 2.%{fcdisttag} \
    ;; \
  esac; \
fi;)}

This changes the valid disttag values to:

0.el2
0.rh7
0.rh8
0.rh9
1.el3
1.fc1
1.fc2
1.fc3
2.el4
2.fc4
2.fc5
2.fc6
3.el5

~spot
---
Tom "spot" Callaway: Red Hat Sales Engineer || GPG Fingerprint: 93054260
Fedora Extras Steering Committee Member (RPM Standards and Practices)
Aurora Linux Project Leader: http://auroralinux.org
Lemurs, llamas, and sparcs, oh my!




More information about the Fedora-packaging mailing list