Made better use of the build.number in build scripts

Traditionally the "Build Number" of a package has been the total number
of commits to the git repository since the beginning of time.  That number
is destined to grow rather large, and become a bit meaningless.  This small
change instead uses the number of commits since the most recent tag - that
is, the most recent release version.  That way it's basically the patch
level of the current version.  You can easilly see how many changes there
have been in your copy of the code since the last official release.  In
theory this will always be 0 for publicly released versions, but sometimes
a small post-release-tag tweak will be needed, so may be 1 or 2.  The
number is of more use to developers who share their builds with other
people so that the exact revision number can be determined with ease.