forked from alibaba/havenask
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure
More file actions
executable file
·68 lines (52 loc) · 1.84 KB
/
configure
File metadata and controls
executable file
·68 lines (52 loc) · 1.84 KB
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
#!/bin/env python
import os
import sys
HERE = os.path.split(os.path.realpath(__file__))[0]
def executCmd(cmd):
print (cmd)
os.system(cmd)
def doPrepareBuildConfig(code, installDir):
subPath = os.path.join(HERE, 'aios', code)
buildOptions = os.path.join(subPath, 'build_options.py')
cmd = 'cp %s/build_options.tpl %s' % (subPath, buildOptions)
executCmd(cmd)
cmd = "sed -i s#%{install_root}#" + installDir + "#g " + buildOptions
executCmd(cmd)
if not os.path.exists(buildOptions):
print ('prepare build config for %s failed.' % code)
return False
else:
return True
def prepareBuildConfig(installDir):
if not doPrepareBuildConfig('indexlib', installDir) or \
not doPrepareBuildConfig('build_service', installDir) or \
not doPrepareBuildConfig('ha3', installDir):
return False
return True
def initInstallDir(installDir):
if os.path.exists(installDir):
cmd = 'rm -rf %s' % installDir
executCmd(cmd)
cmd = 'mkdir %s' % installDir
executCmd(cmd)
cmd = 'cp -r /ha3_depends/iquan/ ' + installDir
executCmd(cmd)
installShareDir = os.path.join(installDir, 'usr/local/share/')
cmd = 'mkdir -p ' + installShareDir
executCmd(cmd)
cmd = 'cp -r /ha3_depends/usr/local/share/* %s' % installShareDir
executCmd(cmd)
if not os.path.exists(installDir) or \
not os.path.exists(os.path.join(installShareDir, 'src')) or \
not os.path.exists(os.path.join(installShareDir, 'cava/mock')):
print ('init install dir failed.')
return False
return True
if __name__ == '__main__':
installDir = os.path.join(HERE, 'ha3_install')
if len(sys.argv) > 1:
installDir = sys.argv[1]
if not initInstallDir(installDir):
sys.exist(-1)
if not prepareBuildConfig(installDir):
sys.exit(-1)