oskusalerma/trelby — pull request #263 by ockham (2012-09-22 19:26:36+00:00)
Title: Switch to distutils-based building and installation.

As per discussion of https://github.com/ockham/trelby/commit/6aaf3dce45302280c773b1159db6c150bd74df25#commitcomment-1819855 and below. Note that in contrast to that pull request, I now got rid of that _preamble magic as it's no longer required. OTOH, it's now one single commit as I'm modifying bin/trelby at installation time from within setup.py.
Tarball generation via `make dist` (as before), default installation by invoking `python setup.py install` goes to /opt/trelby (also see INSTALL file). Deb package generation by `make deb` produces a Debian package that installs to /usr/share/trelby (and /usr/bin/ for the `trelby` executable, respectively).
Commit log follows:

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
* Fix trelby module import in bin/trelby.
* src/misc.py: Make the version constant globally available for
use py 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/patches/installation-location, debian/patches/series:
Add a patch so the Debian package installs to /usr/share/trelby
and /usr/bin instead of /opt/trelby.
* Fix Uninstall section of install.nsi.