thanks to Jord I found this line in the file /usr/lib/rpm/rpmrc
:
buildarchtranslate: i686: i586
so apparently it is rpmbuild that does a translation from my "uname -m" architecture i686 to i586. So theoretically it would be possible to use uname -m and look in the rpmrc file for a translation, but that would be very laborious.
in short parsing the name of the rpm that was produced is the most effective way to get the architecture. No macro or variable seems to be defined that matches the one produced by rpmbuild (since a translation step is included)