martin f. krafft | 8acd49d | 2013-08-26 21:22:25 +0200 | [diff] [blame] | 1 | ============ |
| 2 | Installation |
| 3 | ============ |
| 4 | |
| 5 | For Debian users (including Ubuntu) |
| 6 | ----------------------------------- |
| 7 | |reclass| has been `packaged for Debian`_. To use it, just install it with |
| 8 | APT:: |
| 9 | |
| 10 | $ apt-get install reclass |
| 11 | |
| 12 | .. _packaged for Debian: http://packages.debian.org/search?keywords=reclass |
| 13 | |
| 14 | Other distributions |
| 15 | ------------------- |
| 16 | Developers of other distributions are cordially invited to package |reclass| |
| 17 | themselves and `ping me <mailto:reclass@pobox.madduck.net>`_ to have details |
| 18 | included here. Or send a patch! |
| 19 | |
| 20 | From source |
| 21 | ----------- |
| 22 | |reclass| is currently maintained `on Github |
| 23 | <http://github.com/madduck/reclass>`_, so to obtain the source, run:: |
| 24 | |
| 25 | $ git clone https://github.com/madduck/reclass.git |
| 26 | |
| 27 | or:: |
| 28 | |
| 29 | $ git clone ssh://git@github.com:madduck/reclass.git |
| 30 | |
| 31 | Before you can use |reclass|, you need to install it into a place where Python |
| 32 | can find it. Unless you installed a package from your distribution, the |
| 33 | following step should install the package to /usr/local:: |
| 34 | |
| 35 | $ python setup.py install |
| 36 | |
| 37 | If you want to install to a different location, use --prefix like so:: |
| 38 | |
| 39 | $ python setup.py install --prefix=/opt/local |
| 40 | |
martin f. krafft | cc8851d | 2013-08-27 13:43:16 +0200 | [diff] [blame] | 41 | .. todo:: |
| 42 | |
| 43 | These will install the ``reclass-salt`` and ``reclass-ansible`` adapters to |
| 44 | ``$prefix/bin``, but they should go to ``$prefix/share/reclass``. How can |
| 45 | setup.py be told to do so? It would be better for consistency if this was |
| 46 | done "upstream", rather than fixed by the distros. |
| 47 | |
martin f. krafft | 8acd49d | 2013-08-26 21:22:25 +0200 | [diff] [blame] | 48 | Just make sure that the destination is in the Python module search path, which |
| 49 | you can check like this:: |
| 50 | |
| 51 | $ python -c 'import sys; print sys.path' |
| 52 | |
| 53 | More options can be found in the output of |
| 54 | |
| 55 | :: |
| 56 | |
| 57 | $ python setup.py install --help |
| 58 | $ python setup.py --help |
| 59 | $ python setup.py --help-commands |
| 60 | $ python setup.py --help [cmd] |
| 61 | |
| 62 | If you just want to run |reclass| from source, e.g. because you are going to be |
| 63 | making and testing changes, install it in "development mode":: |
| 64 | |
| 65 | $ python setup.py develop |
| 66 | |
| 67 | To uninstall (the rm call is necessary due to `a bug in setuptools`_):: |
| 68 | |
| 69 | $ python setup.py develop --uninstall |
| 70 | $ rm /usr/local/bin/reclass* |
| 71 | |
| 72 | `Uninstallation currently isn't possible`_ for packages installed to |
| 73 | /usr/local as per the above method, unfortunately. The following should do:: |
| 74 | |
| 75 | $ rm -r /usr/local/lib/python*/dist-packages/reclass* /usr/local/bin/reclass* |
| 76 | |
| 77 | .. _a bug in setuptools: http://bugs.debian.org/714960 |
| 78 | .. _Uninstallation currently isn't possible: http://bugs.python.org/issue4673 |
| 79 | |
| 80 | .. include:: substs.inc |