-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathconfigure
executable file
·69 lines (61 loc) · 2.27 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
#!/bin/sh
PGPORT=
SQLAPI_PORT=
MAPAPI_PORT=
MAPNIK_VERSION=
ENVIRONMENT=development
STATUS="$0 $*"
# check requirements
node_version=`node --version`
if test $? -gt 0 -o -z "${node_version}"; then
echo "Required node.js (version 0.10+) not found"
exit 1
fi
# format: v0.10.26
node_version_minor=`echo "${node_version}" | sed 's/^v0\.\([0-9]*\).*/\1/'`
if test "$node_version_minor" -lt 10; then
echo "Required node.js version is 0.10+, ${node_version} found"
exit 1
fi
ruby_version=`ruby --version`
if test $? -gt 0 -o -z "${node_version}"; then
echo "Required ruby (version 1.9.3+) not found"
exit 1
fi
# format: ruby 1.9.3p484
ruby_version_major=`echo "${ruby_version}" | sed 's/^ruby \([0-9]*\)\.[0-9]*.*/\1/'`
ruby_version_minor=`echo "${ruby_version}" | sed 's/^ruby [0-9]*\.\([0-9]*\).*/\1/'`
ruby_version_patch=`echo "${ruby_version}" | sed 's/^ruby [0-9]*\.[0-9]*\.\([0-9]*\).*/\1/'`
if test "$ruby_version_major" -lt 1 ||
( test "$ruby_version_major" -eq 1 &&
test "$ruby_version_minor" -lt 9 ) ||
( test "$ruby_version_major" -eq 1 &&
test "$ruby_version_minor" -eq 9 &&
test "$ruby_version_patch" -lt 3 )
then
echo "Required ruby version is 1.9.3+, ${ruby_version_major}.${ruby_version_minor}.${ruby_version_patch} found"
exit 1
else
echo "Ruby ${ruby_version_major}.${ruby_version_minor}.${ruby_version_patch} found"
fi
usage() {
echo "Usage: $0 [OPTION]"
echo
echo "Configuration:"
echo " --help display this help and exit"
echo " --with-pgport=NUM access PostgreSQL server on TCP port NUM [$PGPORT]"
echo " --with-pguser=STRING access PostgreSQL as user STRING [$PGUSER]"
echo " --with-sqlapi-port=NUM access SQL-API server on TCP port NUM [$SQLAPI_PORT]"
echo " --with-mapapi-port=NUM access MAP-API server on TCP port NUM [$MAPAPI_PORT]"
echo " --with-mapnik-version=STRING set mapnik version string [$MAPNIK_VERSION]"
#echo " --environment=STRING set output environment name [$ENVIRONMENT]"
}
echo "Configuring map-api... "
cd map-api;
./configure $@ || exit 1;
./configure $@ --environment=test || exit 1;
cd -
echo "Configuring sql-api... "
cd sql-api; ./configure $@ || exit 1; cd -
echo "Configuring rails-app... "
cd rails-app; ./configure $@ || exit 1; cd -