#coding=utf-8

def run():
    import sys
    import os
    realpath = os.path.realpath(__file__)
    dirname = os.path.dirname(realpath)
    other_dir = dirname + "/other"
    print 'copy to /usr/local/pypy'
    cmd = "cd %s && cp -rf pypy-5.9-linux_x86_64-portable /usr/local/pypy" % other_dir
    import util
    util.execmd(cmd)
    print 'install pip'
    get_pip = other_dir + "/get-pip.py"
    cmd = "/usr/local/pypy/bin/pypy %s" % get_pip
    util.execmd(cmd)
    print 'set env'
    cmd = """echo 'PATH="/usr/local/pypy/bin:$PATH"' >> /etc/profile"""
    util.execmd(cmd)
    cmd = "source /etc/profile"
    util.execmd(cmd)
    print 'install pypy on /usr/local/pypy'
    print 'done!'