Because CentOS doesn't include buildsys-macros-rhel
for some reason, a few useful macros in RPM SPEC files aren't included, like
dist
and el5
. To fix that:
%define distribution %(/usr/lib/rpm/redhat/dist.sh --distnum)
%if %{distribution} == 5
%define dist .el5
%define el5 1
%endif