This repository has been archived by the owner on Apr 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
install.sh
executable file
·340 lines (278 loc) · 9.18 KB
/
install.sh
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
#!/bin/bash
# Beah - Test harness. Part of Beaker project.
#
# Copyright (C) 2009 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# FIXME:
# - change "/usr/bin/env python" to "$PYBIN" (full path)
# - "/usr/bin/env python2.5" does not work in a_task :-(
# - This should be done by setup.py!
(
## BEAH_TEMP - directory used to store downloaded files and for building
## components.
echo "BEAH_TEMP=${BEAH_TEMP:="/root/beah"}"
## PYTHON:
## PY_VER - version of python to build. Uncomment to include python in
## installation.
#PY_VER=2.5 # This is known to work on RHEL4.8
#PY_VER=2.6.2
## PYBIN_NAME - python interpreter binary to install harness to.
#PYBIN_NAME=python2.6
echo "PYBIN_NAME=${PYBIN_NAME:="python"}"
## ZOPE INTERFACE:
## ZI_VER - version of zope-interface to download and build. Uncomment to
## include zope-interface in installation.
echo "ZI_VER=${ZI_VER:="3.3.0"}"
## TWISTED:
## TW_VER - version of Twisted framework to download and build. Uncomment to
## include Twisted in installation.
echo "TW_VER=${TW_VER:="8.2.0"}"
## SETUPTOOLS:
## ST_VER - version of setuptools module to download and build. Uncomment to
## include setuptools in installation.
echo "ST_VER=${ST_VER:="0.6c11"}"
## SIMPLEJSON:
## SJ_VER - version of simplejson module to download and build. Uncomment to
## include simplejson in installation.
echo "SJ_VER=${SJ_VER:="2.0.9"}"
## UUID:
## UUID_VER - version of uuid module to download and build. Uncomment to
## include uuid in installation. No necessary on python2.5 and newer.
echo "UUID_VER=${UUID_VER:="1.30"}"
## HASHLIB:
## HL_VER - version of hashlib module to download and build. Uncomment to
## include uuid in installation. No necessary on python2.5 and newer.
echo "HL_VER=${HL_VER:="20081119"}"
## GIT:
## GIT_VER - version of git to download and build. Uncomment to include git in
## installation.
## this did not work on 4.8
#GIT_VER=1.6.4.1
## BEAKER:
#BKR=
################################################################################
mkdir -p $BEAH_TEMP
pushd $BEAH_TEMP
################################################################################
# BUILD AND INSTALL NEWER PYTHON (E.G. 2.5):
################################################################################
if [[ -n "$PY_VER" && "$PY_VER" != "-" ]]; then
mkdir python
pushd python
(
wget http://www.python.org/ftp/python/${PY_VER}/Python-${PY_VER}.tar.bz2 && \
tar xvjf Python-${PY_VER}.tar.bz2 && \
cd Python-${PY_VER} && \
./configure && \
make && \
{ make test || true; } && \
make altinstall
echo $? > ${BEAH_TEMP}/python.rc
) | tee ${BEAH_TEMP}/python.out 2> ${BEAH_TEMP}/python.err
PY_OK=`cat ${BEAH_TEMP}/python.rc`
popd
else
PY_OK=0
fi
## PYBIN - full name of python binary. See PYBIN_NAME.
PYBIN=`which $PYBIN_NAME`
################################################################################
# BUILD AND INSTALL ZOPE.INTERFACE:
################################################################################
if [[ -n "$ZI_VER" && "$ZI_VER" != "-" ]]; then
mkdir zope
pushd zope
(
wget http://www.zope.org/Products/ZopeInterface/${ZI_VER}/zope.interface-${ZI_VER}.tar.gz && \
tar xvzf zope.interface-${ZI_VER}.tar.gz && \
cd zope.interface-${ZI_VER} && \
$PYBIN setup.py build && \
$PYBIN setup.py install
echo $? > ${BEAH_TEMP}/zope-interface.rc
) | tee ${BEAH_TEMP}/zope-interface.out 2> ${BEAH_TEMP}/zope-interface.err
ZI_OK=`cat ${BEAH_TEMP}/zope-interface.rc`
popd
else
ZI_OK=0
fi
################################################################################
# BUILD AND INSTALL TWISTED:
################################################################################
if [[ -n "$TW_VER" && "$TW_VER" != "-" ]]; then
mkdir twisted
pushd twisted
(
wget http://tmrc.mit.edu/mirror/twisted/Twisted/8.2/Twisted-${TW_VER}.tar.bz2 && \
tar xvjf Twisted-${TW_VER}.tar.bz2 && \
cd Twisted-${TW_VER} && \
$PYBIN setup.py install
echo $? > ${BEAH_TEMP}/twisted.rc
) | tee ${BEAH_TEMP}/twisted.out 2> ${BEAH_TEMP}/twisted.err
TW_OK=`cat ${BEAH_TEMP}/twisted.rc`
popd
else
TW_OK=0
fi
################################################################################
# BUILD AND INSTALL GIT:
################################################################################
if [[ -n "$GIT_VER" && "$GIT_VER" != "-" ]]; then
mkdir git
pushd git
(
wget http://kernel.org/pub/software/scm/git/git-${GIT_VER}.tar.bz2 && \
tar xvjf git-${GIT_VER}.tar.bz2 && \
cd git-${GIT_VER} && \
make configure && \
./configure --prefix=/usr/local && \
make all doc && \
make check && \
make install
echo $? > ${BEAH_TEMP}/git.rc
) | tee ${BEAH_TEMP}/git.out 2> ${BEAH_TEMP}/git.err
GIT_OK=`cat ${BEAH_TEMP}/git.rc`
popd
else
GIT_OK=0
fi
################################################################################
# BUILD AND INSTALL SETUPTOOLS:
################################################################################
if [[ -n "$ST_VER" && "$ST_VER" != "-" ]]; then
mkdir setuptools
pushd setuptools
(
wget http://pypi.python.org/packages/source/s/setuptools/setuptools-${ST_VER}.tar.gz && \
tar xvzf setuptools-${ST_VER}.tar.gz && \
cd setuptools-${ST_VER} && \
$PYBIN setup.py build && \
$PYBIN setup.py install
echo $? > ${BEAH_TEMP}/setuptools.rc
) | tee ${BEAH_TEMP}/setuptools.out 2> ${BEAH_TEMP}/setuptools.err
ST_OK=`cat ${BEAH_TEMP}/setuptools.rc`
popd
else
ST_OK=0
fi
################################################################################
# BUILD AND INSTALL SIMPLEJSON:
################################################################################
if [[ -n "$SJ_VER" && "$SJ_VER" != "-" ]]; then
mkdir simplejson
pushd simplejson
(
wget http://pypi.python.org/packages/source/s/simplejson/simplejson-2.0.9.tar.gz && \
tar xvzf simplejson-${SJ_VER}.tar.gz && \
cd simplejson-${SJ_VER} && \
$PYBIN setup.py build && \
$PYBIN setup.py install
echo $? > ${BEAH_TEMP}/simplejson.rc
) | tee ${BEAH_TEMP}/simplejson.out 2> ${BEAH_TEMP}/simplejson.err
SJ_OK=`cat ${BEAH_TEMP}/simplejson.rc`
popd
else
SJ_OK=0
fi
################################################################################
# BUILD AND INSTALL UUID:
################################################################################
if [[ -n "$UUID_VER" && "$UUID_VER" != "-" && "`python -V 2>&1`" < "Python 2.5" ]]; then
mkdir uuid
pushd uuid
(
wget http://pypi.python.org/packages/source/u/uuid/uuid-${UUID_VER}.tar.gz && \
tar xvzf uuid-${UUID_VER}.tar.gz && \
cd uuid-${UUID_VER} && \
$PYBIN setup.py build && \
$PYBIN setup.py install
echo $? > ${BEAH_TEMP}/uuid.rc
) | tee ${BEAH_TEMP}/uuid.out 2> ${BEAH_TEMP}/uuid.err
UUID_OK=`cat ${BEAH_TEMP}/uuid.rc`
popd
else
UUID_OK=0
fi
################################################################################
# BUILD AND INSTALL HASHLIB:
################################################################################
if [[ -n "$HL_VER" && "$HL_VER" != "-" && "`python -V 2>&1`" < "Python 2.5" ]]; then
mkdir hashlib
pushd hashlib
(
wget http://code.krypto.org/python/hashlib/hashlib-${HL_VER}.tar.gz && \
tar xvzf hashlib-${HL_VER}.tar.gz && \
cd hashlib-${HL_VER} && \
$PYBIN setup.py build && \
$PYBIN setup.py install
echo $? > ${BEAH_TEMP}/hashlib.rc
) | tee ${BEAH_TEMP}/hashlib.out 2> ${BEAH_TEMP}/hashlib.err
HL_OK=`cat ${BEAH_TEMP}/hashlib.rc`
popd
else
HL_OK=0
fi
################################################################################
# GET BEAKER FROM GIT:
################################################################################
if [[ -n "$BKR" ]]; then
git clone --depth 1 http://git.fedorahosted.org/git/beaker.git
fi
################################################################################
# SUMMARY:
################################################################################
if [[ "$PY_OK" -eq 0 ]]; then
echo "Python installed OK"
else
echo "--- ERROR: Python not installed"
fi
if [[ "$ZI_OK" -eq 0 ]]; then
echo "zope.interface installed OK"
else
echo "--- ERROR: zope.interface not installed"
fi
if [[ "$TW_OK" -eq 0 ]]; then
echo "Twisted installed OK"
else
echo "--- ERROR: Twisted not installed"
fi
if [[ "$ST_OK" -eq 0 ]]; then
echo "setuptools installed OK"
else
echo "--- ERROR: setuptools not installed"
fi
if [[ "$SJ_OK" -eq 0 ]]; then
echo "simplejson installed OK"
else
echo "--- ERROR: simplejson not installed"
fi
if [[ "$UUID_OK" -eq 0 ]]; then
echo "uuid installed OK"
else
echo "--- ERROR: uuid not installed"
fi
if [[ "$HL_OK" -eq 0 ]]; then
echo "hashlib installed OK"
else
echo "--- ERROR: hashlib not installed"
fi
if [[ "$GIT_OK" -eq 0 ]]; then
echo "Git installed OK"
else
echo "--- ERROR: Git not installed"
fi
################################################################################
popd
)