On Fri, 2005-02-25 at 21:26 +0200, Ville Skyttä wrote:
On Fri, 2005-02-25 at 19:43 +0100, Dag Wieers wrote:
> You can use:
>
> rpm -qf /etc/redhat-release --qf '%{RPMTAG_VERSION}\n'
...or just %{VERSION} (in uppercase).
Ok. New macros:
# 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 -qf --qf '%{VERSION}' /etc/redhat-release)}
%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;)}
Is anyone opposed to adopting the %{disttag} methodology as the
documented method for supporting single spec files for multiple Fedora
distros? If not, I'll start writing it up.
~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!