Fix DISTRO_NAME_L for FreeBSD.

I've tested this with Ubuntu as well as FreeBSD and the [[:space:]]
method appears to work successfully across both OS's.
Allow PACKAGESITE to be overridden by env variable.

If the PACKAGESITE environment variable is not set then the normal
pkgbeta URL will be generated, if the variable is set then this will be
used in preference to the pkgbeta URL.