I have to perform multiple elaborate \"sanity\" checks on target system before an RPM package installs/upgrades. I want to contain the procedure in a script (bash/python/php
RPM doesn't have this functionality. As I see it, you have two options:
Tar up the files, encode them to a text format (e.g. uuencode) and decode and untar them in the %pre. Ugly, but possible.
Have a separate RPM, say sql-dependencies, that provides these files. Then in your existing RPM add the following:
Requires(pre) : sql-dependencies.