Solaris build script fixes

Made them use ruby/rake APIs rather than using ```sh``` for everything.