@@ -55,62 +55,76 @@ To install, run the following. |
55 | 55 | Installation from Source |
56 | 56 | ========================== |
57 | 57 |
|
58 | | -To install from source, ``libssh2`` and Python development headers are required. |
| 58 | +Source distributions inlude a bundled ``libssh2`` which is built automatically by default. OpenSSL development libraries are required. |
59 | 59 |
|
60 | | -Custom build |
61 | | -------------- |
| 60 | +For builds against system provided ``libssh2``, the ``SYSTEM_LIBSSH2=1`` environment variable setting can be used. |
62 | 61 |
|
63 | | -For best compatibility, it is recommended to use the ``libssh2`` submodule included in ``ssh2-python`` repository to build with. |
| 62 | +Standard build |
| 63 | +--------------- |
| 64 | + |
| 65 | +Source distributions include a bundled ``libssh2`` which is used by default. |
64 | 66 |
|
65 | 67 | .. code-block:: shell |
66 | 68 |
|
67 | | - |
68 | | - sudo ./ci/install-ssh2.sh |
| 69 | + |
69 | 70 | virtualenv my_env |
70 | 71 | source my_env/bin/activate |
71 | 72 | python setup.py install |
72 | 73 |
|
73 | | -The ``sudo ./ci/install-ssh2.sh`` line will install a version of ``libssh2`` under ``/usr/local`` that is the same version used to build binary wheels with and is ensured to be compatible. |
74 | 74 |
|
75 | | -If there are multiple development headers and/or libraries for ``libssh2`` on the system, the following can be used to set the include path, runtime and build library directories: |
| 75 | +System library build |
| 76 | +--------------------- |
| 77 | + |
| 78 | +Building against system provided ``libssh2`` is another option which may be preferred. This can be done by setting the ``SYSTEM_LIBSSH2=1`` environment variable: |
76 | 79 |
|
77 | 80 | .. code-block:: shell |
78 | 81 |
|
79 | | - |
80 | | - sudo ./ci/install-ssh2.sh |
| 82 | + |
81 | 83 | virtualenv my_env |
82 | 84 | source my_env/bin/activate |
83 | | - python setup.py build_ext -I /usr/local/include -R /usr/local/lib/x86_64-linux-gnu -L /usr/local/lib/x86_64-linux-gnu |
| 85 | + export SYSTEM_LIBSSH2=1 |
84 | 86 | python setup.py install |
85 | 87 |
|
86 | | -System library build |
87 | | ---------------------- |
88 | 88 |
|
89 | | -Building against system provided ``libssh2`` is another option which may be preferred. |
| 89 | +Custom Compiler Configuration |
| 90 | +------------------------------- |
| 91 | + |
| 92 | +If there are multiple ``libssh2`` installations on the system, the following can be used to set the include path, runtime and build time library directory paths respectively: |
90 | 93 |
|
91 | | -If the ``libssh2`` version provided by the system is not compatible, run the build with the ``EMBEDDED_LIB=0`` and ``HAVE_AGENT_FWD=0`` environment variables set. This will disable features that require ``libssh2`` >= ``1.6.0`` as well as agent forwarding implementation which is only present in the ``libssh2`` submodule of this repository. |
| 94 | +.. code-block:: shell |
| 95 | +
|
| 96 | + |
| 97 | + virtualenv my_env |
| 98 | + source my_env/bin/activate |
| 99 | + python setup.py build_ext -I /usr/local/include -R /usr/local/lib/x86_64-linux-gnu -L /usr/local/lib/x86_64-linux-gnu |
| 100 | + python setup.py install |
92 | 101 |
|
93 | | -Clone the repository, install dependencies and run install in a new virtualenv from the repository's root directory. |
94 | 102 |
|
95 | 103 | Ubuntu |
96 | 104 | _______ |
97 | 105 |
|
| 106 | +Example for Debian or Ubuntu based distributions. |
| 107 | + |
98 | 108 | .. code-block:: shell |
99 | 109 |
|
100 | 110 | sudo apt-get install libssh2-1-dev python-dev |
101 | 111 | virtualenv my_env |
102 | 112 | source my_env/bin/activate |
| 113 | + export SYSTEM_LIBSSH2=1 |
103 | 114 | python setup.py install |
104 | 115 |
|
105 | 116 |
|
106 | 117 | RedHat |
107 | 118 | _______ |
| 119 | + |
| 120 | +Example for RedHat based distributions. |
108 | 121 |
|
109 | 122 | .. code-block:: shell |
110 | 123 |
|
111 | 124 | sudo yum install libssh2-devel python-devel |
112 | 125 | virtualenv my_env |
113 | 126 | source my_env/bin/activate |
| 127 | + export SYSTEM_LIBSSH2=1 |
114 | 128 | python setup.py install |
115 | 129 |
|
116 | 130 |
|
|