Set package version number based on build number

Also add parameter to create a release build (without the nightly
prefix).

Change-Id: I029fb8592afc0dea9e2d4c60c8326cff9b12309e