public void checkPreReqs() throws GT4Exception { CheckPrereqs preReq = new CheckPrereqs(); try { // JAVA preReq.checkCmd("java", "1.4.2"); // ANT String javaVer = System.getProperty("java.version"); if (preReq.checkVersion("1.5", javaVer)) { preReq.checkCmd("ant", "1.6.1"); } else { preReq.checkCmd("ant", "1.5.1"); } // C Compiler preReq.checkCmd("cc", "--version"); // TAR preReq.checkCmd("tar", null, "gnu"); // SED preReq.checkCmd("sed", null, "gnu"); // MAKE preReq.checkCmd("make", null, "gnu"); // SUDO preReq.checkCmd("sudo"); // POSTGRES // preReq.checkCmd("postgres", "7.1"); } catch (IOException ioe) { log.error(ioe); throw new GT4Exception(ioe); } catch (InterruptedException ie) { log.error(ie); throw new GT4Exception(ie); } catch (PrereqException pe) { log.error(pe); throw new GT4Exception(pe); } }
public synchronized void sfStart() throws SmartFrogException, RemoteException { super.sfStart(); CheckPrereqs chk = new CheckPrereqs(); try { chk.checkCmd(javaPath, "java", javaVersion, null); chk.checkCmd(antPath, "ant", antVersion, null); chk.checkCmd("tar", null, tarVendor); chk.checkCmd("sed", null, sedVendor); chk.checkCmd("cc", cVersion); chk.checkCmd("make", null, makeVendor); chk.checkCmd("sudo", null, null); // chk.checkCmd("postgres", postgresVersion); // chk.checkCmd("perl", null, null); chk.checkCmd(perlPath, "perl", perlVersion, null); } catch (IOException ioe) { sfLog().err("Exception in checking pre-requisites", ioe); throw new SmartFrogException("Exception in checking pre-requisites", ioe); } catch (PrereqException pe) { sfLog().err(pe); throw new SmartFrogException(pe); } catch (InterruptedException ie) { sfLog().err(ie); throw new SmartFrogException(ie); } sfLog().info("All pre-requisites for GT4 satisfied"); Configure configure = new Configure(installerDir, globusLoc); Installation gt4 = new Installation(installerDir, globusLoc); try { configure.runConfigure(confOpts); sfLog().info("./configure script executed successfully."); sfLog().info("Starting build..."); gt4.build(targets); sfLog().info("Installing in GLOBUS_LOCATION"); gt4.build("install"); } catch (GNUBuildException gbe) { sfLog().err("Error while installing GT4", gbe); throw new SmartFrogException("Error while isntalling GT4", gbe); } sfLog().info("GT4 Built successfully"); // terminate synchronously if (shouldTerminate) { TerminationRecord tr = TerminationRecord.normal("Terminating ...", sfCompleteName()); sfTerminate(tr); } }