build.xml: add new macros for use in the release target

Also move away from using external binaries when an ant task can do the job.