def extractLibevent(): chdir(DOWNLOAD_DIR) exec_command("tar xvzf libevent-2.0.20-stable.tar.gz -C %s"%DOWNLOAD_DIR) chdir(join(DOWNLOAD_DIR,"libevent-2.0.20-stable")) exec_command(join(DOWNLOAD_DIR, "libevent-2.0.20-stable", "configure")) exec_command("make") exec_command("sudo make install") exec_command(" sudo ln -s /usr/local/lib/libevent-2.0.5.dylib /usr/lib")
def _extractPcre(): chdir(DOWNLOAD_DIR) exec_command("tar xvzf pcre-8.20.tar.gz -C %s" % (DOWNLOAD_DIR)) chdir(join(DOWNLOAD_DIR, PCRE_DIR)) exec_command("%s --prefix=%s" % (join(DOWNLOAD_DIR, PCRE_DIR, "configure"), join(USR_LOCAL, PCRE_DIR))) exec_command("make") exec_command("sudo make install") exec_command('echo "export PATH=%s:\\$PATH" >> ~/.profile' % join(USR_LOCAL, PCRE_DIR, "bin"))
def _extractHttpd(): chdir(DOWNLOAD_DIR) path = abspath("/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.10.xctoolchain") if not exists(path): exec_command("sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.10.xctoolchain ") exec_command("tar xvzf httpd-2.4.16.tar.gz -C %s"%DOWNLOAD_DIR) chdir(join(DOWNLOAD_DIR, HTTPD_DIR)) exec_command("%s --prefix=%s"%(join(DOWNLOAD_DIR, HTTPD_DIR, "configure"), join(USR_LOCAL, "apache2"))) exec_command("make") exec_command("sudo make install")
def _extractPcre(): chdir(DOWNLOAD_DIR) exec_command("tar xvzf pcre-8.36.tar.gz -C %s"%( DOWNLOAD_DIR)) chdir(join(DOWNLOAD_DIR, PCRE_DIR)) exec_command("%s --prefix=%s"%(join(DOWNLOAD_DIR, PCRE_DIR, "configure"), join(USR_LOCAL, PCRE_DIR))) exec_command("make") exec_command("sudo make install")
def extractMemcached(): chdir(DOWNLOAD_DIR) exec_command("tar xvzf memcached-1.4.15.tar.gz -C %s"%DOWNLOAD_DIR) chdir(join(DOWNLOAD_DIR,"memcached-1.4.15")) exec_command(join(DOWNLOAD_DIR, "memcached-1.4.15", "configure")) exec_command("make") exec_command("sudo make install")
def extractCtags(): chdir(DOWNLOAD_DIR) exec_command("tar xvzf ctags-5.8.tar.gz -C %s"%DOWNLOAD_DIR) chdir(join(DOWNLOAD_DIR, CTAGS_DIR)) exec_command("%s --prefix=%s"%(join(DOWNLOAD_DIR, CTAGS_DIR, "configure"), join(USR_LOCAL, "ctags-exuberant"))) exec_command("make") exec_command("sudo make install")
def _installVirtualEnv(): exec_command("sudo pip install virtualenv") #FIXME: port for linux also chdir("/Library/Python/2.7/site-packages") exec_command("python virtualenv.py ~/ENV") exec_command('echo "source ~/ENV/bin/activate" >> ~/.profile') exec_command("source ~/ENV/bin/activate")
def setgit(): exec_command("git config --global color.ui auto") email = raw_input("\n\n\n\n\n\nEnter your email like you want it in git(Example: [email protected]):\n") name = raw_input("\n\n\n\n\n\nEnter your name like you want it in git(Example: Pranav Garg):\n") raw_input( "i AM USING EMAIL:%s AND NAME:%s FOR YOUR GIT. iF WRONG, THEN PRESS ctrl-c NOW AND RERUN THIS SCRIPT (PYTHON INSTALL_PATH.PY)"%(email, name)) exec_command('git config --global user.email "%s"'%email) exec_command('git config --global user.name "%s"'%name) chdir(HOME) exec_command('curl https://raw.github.com/git/git/master/contrib/completion/git-completion.bash -O') chdir(PROJECT_ROOT)
def _installSimpleJson(): exec_command("sudo pip install simplejson")
def _installPyCrypto(): exec_command("sudo pip install pycrypto")
def _installPiston(): exec_command("sudo pip install django-piston")
def _downloadPcre(): chdir(DOWNLOAD_DIR) exec_command("curl -o pcre-8.20.tar.gz -L %s" % PCRE_URL)
def downloadHttpd(): chdir(DOWNLOAD_DIR) exec_command("curl -o httpd-2.4.2.tar.gz -L %s" % HTTPD_URL)
def _downloadDjangoCas(): chdir(HOME_DIR) exec_command("git clone [email protected]:edlab/apps-django-cas.git projects/django.cas")
def _installDjango(): exec_command("sudo pip install Django")
def setup_vim(): chdir(HOME) exec_command('rm -rf ~/.vim') exec_command('rm -rf ~/.vimrc') exec_command('ln -s %s .vimrc'%join(PROJECT_ROOT, "vimrc")) exec_command('ln -s %s .vim'%join(PROJECT_ROOT, "vim")) exec_command('mkdir -p %s'%join(HOME, ".vim", "bundle")) chdir(join(HOME, ".vim", "bundle")) exec_command('rm -rf ctrlp.vim') exec_command("git clone https://github.com/kien/ctrlp.vim.git") exec_command('rm -rf nerdcommenter') exec_command("git clone https://github.com/scrooloose/nerdcommenter.git") chdir(PROJECT_ROOT)
def setpath(): exec_command('touch %s'%join(HOME, '.bash_profile')) exec_command('echo source %s | tee -a %s'%(join(PROJECT_ROOT, "profile"), join(HOME, '.bash_profile'))) exec_command('source %s'%join(HOME, '.bash_profile'))
def _extractPip(): chdir(DOWNLOAD_DIR) exec_command("tar xvzf pip-1.1.tar.gz -C %s"%DOWNLOAD_DIR) chdir(join(DOWNLOAD_DIR, PIP_DIR)) exec_command("sudo python setup.py install")
def _downloadPip(): chdir(DOWNLOAD_DIR) exec_command("curl -o pip-1.1.tar.gz -L %s"%PIP_URL)
def _installHayStack(): exec_command("sudo pip install django-haystack")
def _downloadVialogues(): chdir(HOME_DIR) exec_command("git clone [email protected]:edlab/apps-vialogues.git projects/vialogues_code")
def _downloadModWsgi(): chdir(DOWNLOAD_DIR) exec_command("hg clone https://code.google.com/p/modwsgi/ %s" % MOD_WSGI_DIR)
def _extractVialogues(): chdir(join(HOME_DIR, "projects", "vialogues_code")) exec_command("ln -s %s apps/accounts"%join(HOME_DIR, "projects", "django-cas")) exec_command("touch debug.log") exec_command("chmod go+rwx debug.log") exec_command("cp settings.py.development settings.py") exec_command("python manage.py syncdb") exec_command("python bootstrap.py")
def extractApacheSolr3_5_0(): chdir(DOWNLOAD_DIR) exec_command("tar xvzf apache-solr-3.5.0.tgz -C %s"%DOWNLOAD_DIR)
def _extractHttpd(): chdir(DOWNLOAD_DIR) exec_command("tar xvzf httpd-2.4.2.tar.gz -C %s" % DOWNLOAD_DIR) chdir(join(DOWNLOAD_DIR, HTTPD_DIR)) exec_command("%s --prefix=%s" % (join(DOWNLOAD_DIR, HTTPD_DIR, "configure"), join(USR_LOCAL, "apache2"))) exec_command("make") exec_command("sudo make install") exec_command('echo "export PATH=%s:\\$PATH" >> ~/.profile' % (join(USR_LOCAL, "apache2", "bin"))) exec_command('echo "alias rs=\\"sudo /usr/local/apache2/bin/apachectl -k restart\\"" >> ~/.profile')
def _installBoto(): exec_command("sudo pip install boto")
def _installMySqlDb(): exec_command('echo "export PATH=%s:\\$PATH" >> ~/.profile'%(join(USR_LOCAL, "mysql", "bin"))) #exec_command("sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib") exec_command("sudo pip install MySQL-python")
def downloadCtags(): chdir(DOWNLOAD_DIR) exec_command("curl -o ctags-5.8.tar.gz -L %s"%CTAGS_URL)
def _extractModWsgi(): chdir(join(DOWNLOAD_DIR, MOD_WSGI_DIR, MOD_WSGI_DIR)) exec_command("sudo ./configure --with-apxs=%s" % join(USR_LOCAL, "apache2/bin/apxs")) exec_command("make") exec_command("sudo make install")
def _installPySolr(): exec_command("sudo pip install pysolr")