oskusalerma/trelby — pull request #284 by ockham (2012-10-04 13:29:10+00:00)
Title: Switch to distutils-based building and installation.

see https://github.com/oskusalerma/trelby/pull/275#issuecomment-9125266

Hope I fixed everything as requested.
Currently, I'm really importing `misc` only for the version number. I mentioned that local branch the other day that uses (a modified) `misc.getPathFromRegistry()` from within setup.py to find NSIS's installation location to invoke it, but I could of course just run the relevant registry reading stuff from setup.py instead.

@anilgulecha: Could you give this another shot on Windows, just to make sure it still works?

Commit log:
Motivated to comply better with the Filesystem Hierarchy Standard (FHS),
and in preparation of an 'official' Debian package, this involves:
* Make trelby code an actual Python module by adding an __init__.py
to the src/ directory so it can be installed by setup.py.
* Move execution of main() from trelby/trelby.py to a newly created
bin/trelby executable python file.
* Make src/trelby.py no longer executable, and remove shebang.
* setup.py: Add the required distutils attributes and logic to setup.py.
In particular, this means modifying bin/trelby at installation time
so that it prepends the actual modules installation path to sys.path.
* setup.cfg: Install to /opt/trelby by default.
* Add MANIFEST.in that lists files to be included
in the source tarball that can be generated by invoking
python setup.py sdist
* src/misc.py: Make the version constant globally available for
use by setup.py; look for the resources directory in ../ .
* Remove gen_linux_dist.sh, and adapt Makefile accordingly to use
different command options of setup.py instead.
* Replace /opt paths in trelby.desktop by the new appropriate values.
* Simplify build.bat. Most of it is obsolete as we have a proper setup.py now.
* Rename README.linux to INSTALL, update contents.
* Fix README.dev and t.bat accordingly.
* Remove debian/dirs (obsolete), and fix debian/rules for distutils.
* debian/install: Install trelby.desktop to /usr/share/applications.
* debian/rules: Modify so the Debian package installs to /usr/share/trelby
and /usr/bin instead of /opt/trelby.
* Fix Uninstall section of install.nsi.