I am looking for a way to exit rpm install if some condition is false. I have added a small script in the %pre section that exits install if my condition fails.
The
If you need this just to make sure there is certain file in the filesystem, you can do simple
Requires: /path/to/expected/file
Otherwise you are indeed out of luck probably.
I could think of extremely ugly solution that would involve killing rpm from within scriptlet, but that is beyond evil :-)
Did you try to use Verification Scripts? Writing Verification Scripts