INSTALL 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. INSTALLATION INSTRUCTIONS FOR pyOpenSSL
  2. ------------------------------------------------------------------------------
  3. I have tested this on Debian Linux systems (woody and sid), Solaris 2.6 and
  4. 2.7. Others have successfully compiled it on Windows and NT.
  5. -- Building the Module on a Unix System --
  6. pyOpenSSL uses distutils, so there really shouldn't be any problems. To build
  7. the library:
  8. $ python setup.py build
  9. If your OpenSSL header files aren't in /usr/include, you may need to supply
  10. the -I flag to let the setup script know where to look. The same goes for the
  11. libraries of course, use the -L flag. Note that build won't accept these
  12. flags, so you have to run first build_ext and then build! Example:
  13. $ python setup.py build_ext -I/usr/local/ssl/include -L/usr/local/ssl/lib
  14. $ python setup.py build
  15. Now you should have a directory called OpenSSL that contains e.g. SSL.so and
  16. __init__.py somewhere in the build dicrectory, so just:
  17. $ python setup.py install
  18. If you, for some arcane reason, don't want the module to appear in the
  19. site-packages directory, use the --prefix option.
  20. You can, of course, do
  21. $ python setup.py --help
  22. to find out more about how to use the script.
  23. -- Building the Module on a Windows System --
  24. First you should get OpenSSL linked with the same runtime library that Python
  25. uses. If you are using Python 2.6 you can use the installer at:
  26. http://www.slproweb.com/products/Win32OpenSSL.html
  27. The binaries in the installer are built with Visual Studio 2008 at the
  28. time of this writing, which is the same compiler used for building the
  29. official Python 2.6 installers.
  30. If you want to build pyOpenSSL for an older Python version, it is preferred
  31. to build OpenSSL yourself, either with the Visual Studio 2003 compiler or
  32. with the MinGW compiler. This way you avoid all potential incompatibilities
  33. between different versions of runtime library (msvcrt.dll). To build
  34. OpenSSL follow the instructions in its source distribution and make sure
  35. that you build a shared library, not a static one. pyOpenSSL fails some of
  36. its tests when linked with the static OpenSSL libraries. Use the same
  37. compiler for OpenSSL that you will use for pyOpenSSL later. Make sure that
  38. OpenSSL is properly installed before continuing. To install OpenSSL when
  39. building with MinGW, use the folowing script:
  40. set OPENSSL_INSTALL_DIR=%1
  41. mkdir %OPENSSL_INSTALL_DIR%
  42. mkdir %OPENSSL_INSTALL_DIR%\bin
  43. mkdir %OPENSSL_INSTALL_DIR%\include
  44. mkdir %OPENSSL_INSTALL_DIR%\include\openssl
  45. mkdir %OPENSSL_INSTALL_DIR%\lib
  46. copy /b .\*.dll %OPENSSL_INSTALL_DIR%\bin
  47. copy /b .\out\openssl.exe %OPENSSL_INSTALL_DIR%\bin
  48. copy /b .\outinc\openssl\* %OPENSSL_INSTALL_DIR%\include\openssl
  49. copy /b .\out\*.a %OPENSSL_INSTALL_DIR%\lib
  50. Ensure that OpenSSL's openssl.exe executable can be found on PATH before
  51. running pyOpenSSL's setup script. The setup script finds OpenSSL's include
  52. dir and lib dir based on the location of openssl.exe, and the test suite
  53. requires openssl.exe for output comparison. Alternatively, you can specify
  54. the --with-openssl option to setup.py's build_ext command with the path to
  55. the OpenSSL installation dir:
  56. > python setup.py build_ext --with-openssl=C:\path\to\openssl build
  57. pyOpenSSL is known to build with mingw32 for Python 2.3 through Python 2.5.
  58. Before using the mingw32 compiler for Python 2.3, you will have to create
  59. a Python library that MinGW understands. Find and download the pexports
  60. program, put it and MinGW's bin directory on path, then run from Python's
  61. install dir:
  62. > pexports python23.dll > libs\python23.def
  63. > dlltool --dllname python23.dll --def libs\python23.def \
  64. --output-lib libs\libpython23.a
  65. For Python 2.4 and 2.5, no special preparation is needed, just make sure that
  66. MinGW's gcc is on PATH. You can specify that mingw32 be used by passing
  67. the --compiler argument to build_ext:
  68. C:\pyOpenSSL-X.Y> setup.py build_ext -c mingw32 bdist_msi
  69. The bdist_msi command will build an MSI installer. It can be substituted
  70. with another bdist command if another kind of installer is desired or with
  71. the install command if you want to install directly.
  72. For Python 2.4 and 2.5 you can use Visual Studio 2003 in addition to MinGW.
  73. For Python 2.6, the official Windows installer of which is built with
  74. Microsoft Visual Studio 2008 (version 9.0), Microsoft Visual Studio 2008
  75. (version 9.0) is required.
  76. To build with MSVC, just omit the compiler specific option:
  77. C:\pyOpenSSL-X.Y> setup.py bdist_msi
  78. The resulting binary distribution will be placed in the dist directory. To
  79. install it, depending on what kind of distribution you create, run it,
  80. unzip it, or copy it to Python installation's site-packages.
  81. And similarily, you can do
  82. setup.py --help
  83. to get more information.
  84. Big thanks to Itamar Shtull-Trauring, Oleg Orlov, Zooko O'Whielacronx, Chris
  85. Galvan, Žiga Seilnacht, and #python and #distutils on FreeNode for their
  86. help with Windows build instructions and to Michael Schneider for providing
  87. Windows build hosts.
  88. -- Documentation --
  89. The documentation is written in LaTeX, using the standard Python templates,
  90. and tools to compile it into a number of forms are included. You need to
  91. supply things like dvips, latex2html yourself of course!
  92. To build the text, html, postscript or dvi forms of the documentation, this is
  93. what you do:
  94. cd doc
  95. # To make the text-only documentation:
  96. make text
  97. # To make the dvi form:
  98. make dvi
  99. It's as simple as that. Note that since Python's mkhowto script is used, if
  100. you do first ``make dvi'' and then ``make ps'', the dvi file will disappear.
  101. I included a special build target ``make all'' that will build all the
  102. documentation in an order that won't let anything disappear.
  103. @(#) $Id: INSTALL,v 1.7 2002/06/14 12:14:19 martin Exp $