def script(self): for ap in sys.path: if conda.installSubDir in ap: self.bauk( "Cannot compile ROOT because you have already inserted anaconda onto your python path. Please " "touch ~/.nokaveEnv, begin a new shell, and try again") #if not test: arch_url = li.fromKPMGrepo("root_" + self.options["Version"] + "_" + linuxVersion.lower() + ".tar.gz") noarch_url = li.fromKPMGrepo("root_" + self.options["Version"] + "_noarch.tar.gz", arch="noarch") if self.options["Strategy"] == "Default" or self.options["Strategy"] == "Copy": if arch_url: self.options["Strategy"] = "Copy" else: print "The version you have requested is not available precompiled for this OS, I will try to compile " \ "" \ "from source" self.options["Strategy"] = "Compile" if self.options["Strategy"] == "Copy": self.src_from = arch_url elif self.options["Strategy"] == "Compile" and noarch_url: self.src_from = noarch_url elif self.options["Strategy"] == "Compile": self.src_from = self.src_from + "root_" + self.options["Version"] + ".source.tar.gz" else: self.bauk( "Strategy can either be Default, Compile OR Copy only. Compile takes the source from the root " "website, Copy takes the precompiled version from our deployment area, default first tries the copy, " "then the compile") dest = "root.tar.gz" #copy to tmp for unpacking self.copy(self.src_from, dest) #untar, move to correct location and clean self.run("tar xvzf " + dest) os.system("mkdir -p " + os.sep.join(self.installDir.split(os.sep)[:-1])) os.system("mv root " + self.installDir) os.chdir(self.installDir) if self.options["Strategy"] == "Compile": self.compile() os.chdir(self.tmpdir) if self.options["UpdateSoftlink"]: linkat = self.topdir + os.sep + 'root' + os.sep + "pro" if os.path.exists(linkat): os.system("rm " + linkat) os.system("ln -s " + self.installDir + " " + linkat) os.chdir(self.tmpdir) for package in self.options["pip"]: self.run( "bash -c 'source " + self.toolbox.envscript() + "; source " + self.installDir + "/bin/thisroot.sh; " "pip install " + package + "'") return
else: self.bauk("couldn't find eclipse directory to move!") if linuxVersion == "Centos6": self.run("echo '-Dorg.eclipse.swt.internal.gtk.cairoGraphics=false' >> " + self.installDir + "/eclipse.ini") return eclipse = EclipseComponent("Eclipse") eclipse.workstation = True eclipse.node = False eclipse.pre = {"Centos6": ["yum -y install java-1.7.0-openjdk java-1.7.0-openjdk-devel"], "Centos7": ["yum -y install java-1.7.0-openjdk java-1.7.0-openjdk-devel"], "Ubuntu": ["apt-get -y install default-jre default-jdk "] } eclipse.installSubDir = "eclipse" eclipse.src_from = li.fromKPMGrepo("eclipse.tar.gz", arch="noarch") eclipse.registerToolbox(toolbox) eclipse.env = """ ecl="%%INSTALLDIR%%" if [ -d ${ecl} ]; then if [[ ":$PATH:" == *":$ecl:"* ]]; then true else export PATH=${ecl}:${PATH} fi fi """ ####################### ANACONDA ############################ class Conda(Component):