CPack RPM: %pretrans scriptlets always exist
!4387 (merged) introduced support for %posttrans and %pretrans scriptlets, however a consequence of these scriptlets being added is that they will be added regardless of if you make use of the scripts for pre/post transaction, meaning you cannot install a package generated via CMake 3.18.x if you are attempting to do so using RedHat's Anaconda installation process (e.g custom ISO, kickstart).
rpm -qp --scripts <package>.rpm
pretrans program: /bin/sh
preinstall scriptlet (using /bin/sh):
#
# Install Script
<snip>
posttrans program: /bin/sh
This is due /bin/sh being requested at the %pretrans stage, but it doesn't exist at this point and you cannot simply add a dependency to have it installed in the case of %pretrans
Edited by Matt Palmer