Fixes for packaging


These are some generalizations of the build system to support packaging.

We already apply these patches when building the Debian/Ubuntu packages.

xTuple may want to further generalize these things to ensure they are still suitable for non-Linux users too.

Notice that I suggest explicitly passing in some arguments as environment variables when running qmake.  This is the most general solution.  When building in a dev environment using git submodules, the environment variables can be set like this:

```
OPENRPT_DIR=`pwd`/openrpt ... ... qmake
```

and when building a package they can be set:

```
OPENRPT_DIR=/usr/include/openrpt ... ... qmake
```