Just a suggestion. Feel free to merge or not. It is a bit fragile this way but should work and if it doesn't work it wouldn't really hurt :) Maybe it would be an idea to move the build.sh script using Phing or something similar. This would make it much less fragile.
refs #6533 #6429