There is one very interesting application by Stéphane Sudre which does all of this for you, is scriptable / supports building from the command line, has a super nice GUI and is FREE. Sad thing is: it's called "Packages" which makes it impossible to find in google.
http://s.sudre.free.fr/Software/Packages/about.html
I wished I had known about it before I started handcrafting my own scripts.