fixes for building on Linux and from git
http://bazaar.launchpad.net/~openpetracore/openpetraorg/trunkhosted/revision/2232