-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure
executable file
·127 lines (106 loc) · 2.55 KB
/
configure
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
#!/bin/sh
# This is the configuration script for Rubber.
# As a part of Rubber, it is covered by the GPL (see COPYING for details).
# (c) Emmanuel Beffara, 2002--2006
# this is the only place where there is version number:
version=1.2
release=1
python=""
prefix=/usr/local
bindir='${prefix}/bin'
datadir='${prefix}/share'
moddir='${datadir}/rubber'
mandir='${prefix}/man'
infodir='${prefix}/info'
### First, parse the command line.
while test -n "$1"; do
case $1 in
--help)
cat <<EOF
Usage: $0 [options]
Options: [defaults in brackets after descriptions]
--help print this message
--python=PYTHON use the interpreter named PYTHON
--prefix=PREFIX install files in PREFIX [$prefix]
--bindir=DIR user executables in DIR [PREFIX/bin]
--datadir=DATADIR read-only data in DATADIR [PREFIX/share]
--moddir=DIR python modules in DIR [DATADIR/rubber]
--mandir=DIR man documentation in DIR [PREFIX/man]
--infodir=DIR texinfo documentation in DIR [PREFIX/info]
EOF
exit
;;
--python=*)
python=${1#*=}
;;
--prefix=*)
prefix=${1#*=}
;;
--bindir=*)
bindir=${1#*=}
;;
--datadir=*)
datadir=${1#*=}
;;
--moddir=*)
moddir=${1#*=}
;;
--mandir=*)
mandir=${1#*=}
;;
--infodir=*)
infodir=${1#*=}
;;
*)
echo "$0: unrecognized option $1" 1>&2
esac
shift
done
### Check that we can install the program.
if test -z "$python"; then
for cmd in python2.2 python2 python; do
if which $cmd > /dev/null 2>&1; then
python=$cmd
break
fi
done
if test -z "$python"; then
cat <<EOF
I could not run the Python interpreter. Since Rubber is written in Python, you
need a working Pyhton installation. Please make it so...
EOF
exit 1
fi
if test $python = python; then
echo "I found Python, this is a good start."
else
echo "I found Python 2 (as $python), good."
fi
elif which $python > /dev/null 2>&1; then
echo "I will use $python as the interpreter."
else
cat <<EOF
You told me to use $python as the interpreter but I cannot run it.
No offense, but you're not helping, here.
EOF
exit 1
fi
python=`which $python`
$python setup.py check || exit 1
echo "The system seems all right, so let's configure Rubber."
### Configure the package
cat > settings.py <<EOF
sub = {
"python": "$python",
"version": "$version",
"release": "$release",
"prefix": "$prefix",
"bindir": "$bindir",
"datadir": "$datadir",
"moddir": "$moddir",
"mandir": "$mandir",
"infodir": "$infodir"
}
EOF
echo "settings.py generated"
env PYTHONPATH=.:$PYTHONPATH $python setup.py config