add initial install-deps script
This commit is contained in:
parent
1c7c495914
commit
075538442f
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
deps
|
36
install-deps
Executable file
36
install-deps
Executable file
@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
from subprocess import Popen, PIPE
|
||||
|
||||
DEPS_DIR = 'deps'
|
||||
NUMPY_VER = '1.6.1'
|
||||
|
||||
numpy_src = 'http://downloads.sourceforge.net/project/numpy/NumPy/%s/numpy-%s.tar.gz' % (NUMPY_VER, NUMPY_VER)
|
||||
sources = [
|
||||
numpy_src
|
||||
]
|
||||
|
||||
def indirdo(dr, fn):
|
||||
owd = os.getcwd()
|
||||
os.chdir(dr)
|
||||
fn()
|
||||
os.chdir(owd)
|
||||
|
||||
if not os.path.exists(DEPS_DIR):
|
||||
os.makedirs(DEPS_DIR)
|
||||
os.chdir(DEPS_DIR)
|
||||
|
||||
for src_url in sources:
|
||||
src_fname = src_url.split('/')[-1]
|
||||
src_dname = src_fname.replace('.tar.gz', '')
|
||||
if not os.path.exists(src_fname):
|
||||
Popen(['wget', src_url]).wait()
|
||||
if not os.path.exists(src_dname):
|
||||
Popen(['tar', '-xvzf', src_fname]).wait()
|
||||
|
||||
if not os.path.exists('/usr/local/lib/python2.7/dist-packages/numpy'):
|
||||
indirdo('numpy-%s' % NUMPY_VER, lambda:
|
||||
Popen(['sudo', 'python', 'setup.py', 'install']).wait()
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user