scripts: import script from 0.5 release

It isn't pretty but this was the tool used to build the zip and tar
files for 0.5
Merge pull request #1431 from philips/build-release-script

scripts: import script from 0.5 release