(Well within necroposting limits I hope) AFAIK .spec "Prefix:" != RPM CLI arg "--prefix" but "--reloc". In any case using something like this:
Code:
%pre
if [ "$1" = "1" ]; then
grep -q -- "--reloc" /proc/`pgrep rpm`/cmdline
else
will make RPM skip installing the package on script error. This is in no way an "official" method, can be bypassed easily using "--noscripts" (though you can test for that as well) and can be easily thwarted if you have multiple 'rpm' commands running (though you could 'pgrep -f packagename_and_rpm-args').