Q: How to get the version of the RPM from inside the %pre script? How to get the version of the RPM from inside the %pre script?

A: Isn't it just %{version}? That macro would be expanded as needed in your %pre script.
