Is there any way to verify some settings before installation in SPEC file and quit if not correct?

view full story

http://stackoverflow.com – There are some more things that the 'Requires' tag does not satisfy. So i wrote a script to verify these things but where do i place them ? and if not found then i want to quit installation prompting user to do the steps before attempting to install this rpm again. writing 'exit 1' in %install tag fails to build the rpm using rpmbbuild. says %install has a bad exit code. EDIT: let me provide you an example. What i initially wanted to test was is if Oracle Java 6 is present. If not then provide the path to Java6. If user fails to provide one ... exit the RPM. Higher Java is not allowed and in (HowTos)