On his blog Nabeel Shahzad goes through creating a deployment using Phing, replacing nasty shell scripts; extracting from Subversion, variable replacements and file manipulation, and creating multiple deployment types in one build file.