build: fix release name strings for gitian builds

When building from a distdir as gitian does, checking for the .git dir
is not reliable. Instead, ask git if we're in a repo.

Rebase this into 0.9.3 branch after final to make sure that 0.9.4 will
have correct version strings in rcs.

Rebased-From: c65cc8c
osx: fix signing to make Gatekeeper happy (again)

The approach from 65f3fa8d1 worked for signing on 10.9.4, but not newer
versions. 10.9.5 (and up) want each framework to stand alone.

Now in addition to copying the plist's from Qt for each framework, we put them
in per-version dirs and only symlink to the latest, rather than using symlinks
for any contents.

Rebased-From: af0bd5e
Keep symlinks when copying into .app bundle

Code signing failed for me on OSX 10.9.5 because the
Versions/Current symbolic links were being replaced
with a duplicate copy of the frameworks' code.

Releases were bigger than they needed to be, for the
same reason.

Rebased-From: 965c306d6d6ee3695dc50615a87e25c248c41a89
doc: Add instructions for consistent Mac OS X build names

Rebased-From: 0dcb0a55782d676798013f20d7e2ab826ad4d96d
build: Fix OSX build when using Homebrew and qt5

Qt5 is bottled, so configure won't find it without some help. Use
brew to find out its prefix.

Also, qt5 added the host_bins variable to pkg-config, use it.
Merged to New Repo