Updated build versioning.

Sync build versioning implementation with `version_tex.py` in jhome
commit 2924d3b.