summaryrefslogtreecommitdiff
path: root/doc/install.tex
blob: 91df05deea2d06e68d46306ecfb20ebd7237ed74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
% $Id$

\documentclass{howto}

\title{Installing M2Crypto}

\release{0.13}

\author{Ng Pheng Siong}
\authoraddress{Email: \email{ngps@netmemetic.com}}

\begin{document}
\maketitle

\section{Software Pre-requisites}

The following software packages are pre-requisites:    

\begin{itemize}
  \item  Python 2.1, 2.2 or 2.3
  \item  OpenSSL 0.9.7 or later
  \item  SWIG 1.3.21
\end{itemize}

\begin{notice}
Note:
\begin{itemize}
  \item  Earlier versions of Python may or may not work.
  \item  This release is incompatible with OpenSSL versions prior to 0.9.7.
  \item  Earlier versions of SWIG may or may not work.
\end{itemize}
\end{notice}

\section{Installing on \UNIX}

\begin{verbatim}
$ unzip m2crypto-0.13.zip
$ cd m2crypto-0.13
$ python setup.py build
# python setup.py install
$ cd tests
$ python alltests.py
\end{verbatim}

Also see the examples in \file{m2crypto-0.13/demo}.

\section{Installing on Windows}

This distribution has been built and test with mingw XXX and MS VC++
6.0.

Before building from source, you need to install OpenSSL's include files,
import libraries and DLLs.

Here is the relevant section from \file{setup.py}.

\begin{verbatim}
if os.name == 'nt':
    openssl_dir = 'c:\\pkg\\openssl'
    include_dirs = [my_inc, openssl_dir + '/include']
    library_dirs = [openssl_dir + '\\lib']
    libraries = ['ssl32', 'eay32']
    extra_compile_args = [ "-DTHREADING" ]
\end{verbatim}

By convention, I place OpenSSL include files in
\file{c:/pkg/openssl/include} and the import libraries in
\file{c:/pkg/openssl/lib}.

\subsection{Preparation}

Read Sebastien Sauvage's webpage at
\texttt{http://sebsauvage.net/python/mingw.html}.

\subsection{Import Libraries}

For mingw32, the OpenSSL import libraries are named \file{libeay32.a} and
\file{libssl32.a}. For VC++, the import libraries, as built by OpenSSL, are
named \file{libeay32.lib} and \file{ssleay32.lib}.

For mingw32, you'll need to create \file{libpython2[123].a}, depending
on your version of Python.

\subsection{OpenSSL DLLs}

OpenSSL DLLs for mingw32 are named \file{libeay32.dll} and
\file{libssl32.dll}. With VC++, the OpenSSL DLLs, as built, are named
\file{libeay32.dll} and \file{ssleay32.dll}.

Install these DLLs somewhere on your PATH; by convention, I place them in
\file{c:/bin}, together with \file{openssl.exe}.

\subsection{Installing}

Build M2Crypto. Do one of the following:

\begin{verbatim}
python setup.py build
python setup.py build -cmingw32
\end{verbatim}

Then,

\begin{verbatim}
python setup.py install
cd tests
python alltests.py
\end{verbatim}

\section{Installing on Mac OS X}

Larry Bugbee has kindly contributed these instructions for Mac OS X 10.2.
I've edited his report lightly to fit the flow of a Python LaTeX document.
Below, Larry writes in the first person.

0. MacOSX 10.2 comes with OpenSSL 0.9.6x and installing a current version
can lead to incompatabilities between Apache and other apps depending on
0.9.6. I am not ready for the hassle to rebuild Apache and all the other
dependencies, so I built OpenSSL 0.9.7c in \file{/usr/local} with:

\begin{verbatim}
./config --prefix=/usr/local --openssldir=/usr/local/openssl
make
...etc.
\end{verbatim}

1. Goto \file{m2crypto-0.13/SWIG}.

\begin{verbatim}
cd m2crypto-0.13
cd SWIG
\end{verbatim}

2. Check the path to the version of OpenSSL you want for M2Crypto. If you
decided to install a newer OpenSSL in \file{/usr/local} and not use Apple's
pre-installed version, the path in \file{Makefile.osx} is ready to go.

\begin{verbatim}
make -f Makefile.osx
cd ..
\end{verbatim}

3. Move the directory \file{M2Crypto} into Python's \file{site-packages}
directory.

6. If you have PyUnit installed:

\begin{verbatim}
cd tests
python alltests.py
\end{verbatim}

7. Try out the various test programs:

\begin{verbatim}
cd ..
cd demo
\end{verbatim}

\end{document}