The easiest and probably the most effective way to automate Oracle software installation is to use response files. You can either use the response files that is supplied with Oracle or create your own. To create your own response files, simply execute runInstaller with the record option. Near the end of the installation, instead of clicking on the Install option, cancel the installation and you will see the response file at your specified location.
runInstaller -record -destinationFile /tmp/crs.rsp
runInstaller -record -destinationFile /tmp/crs_up.rsp
runInstaller -record -destinationFile /tmp/asm.rsp
runInstaller -record -destinationFile /tmp/asm_up.rsp