Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TAlienPackage.h
Go to the documentation of this file.
1 // @(#)root/alien:$Id$
2 // Author: Lucia Jancurova/Andreas-Joachim Peters 1/10/2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TAlienPackage
13 #define ROOT_TAlienPackage
14 
15 #include "Rtypes.h"
16 #include "TList.h"
17 #include "TGrid.h"
18 
19 //////////////////////////////////////////////////////////////////////////
20 // //
21 // TAlienPackage //
22 // //
23 // Class providing package management functionality like the AliEn //
24 // Package Management System. //
25 // Allows to setup software packages on a local desktop like in the //
26 // GRID environment. //
27 // //
28 //////////////////////////////////////////////////////////////////////////
29 
30 class TAlienPackage {
31 
32 private:
33  TString fName; // package principal name
34  TString fVersion; // package version
35  TString fPlatform; // package platform
36  TString fInstallationDirectory; // installation directory
37  TString fAliEnMainPackageDir; // path to alien packages in the AliEn FC
38  TString fPostInstallCommand; // command to execute for postinstall
39  TString fEnableCommand; // command to enable the package
40  TList *fInstallList; // package list with names of dependency packages
41  TList *fPackages; // package list TPackage with this and dependency packages
42  Int_t fDebugLevel; // internal debug level
43  Bool_t fEnabled; // true if package is enabled for execution
44 
45  Bool_t PostInstall (TString name, TString version); // runs the postinstall procedure for this package
46  Bool_t InstallSinglePackage (TString name, TString version, Bool_t isDep = kFALSE); // installs the defined package without dependencies
47  Bool_t InstallAllPackages (); // installs the defined package + all dependency packages
48 
49  public:
50  TAlienPackage ();
51 
52  TAlienPackage(const char *name,
53  const char *version,
54  const char *platform,
55  const char *installationdirectory = "/var/tmp/alien/packages");
56 
57  virtual ~ TAlienPackage ();
58 
59  Bool_t Enable(); // install/enable the defined package
60  const char *GetEnable(); // return shell command to enable package
61  Bool_t Exec(const char *cmdline); // execute <cmd> with this package
62  Bool_t UnInstall(); // uninstall the defined package
63  Bool_t ReInstall(); // reinstall the defined package
64  Bool_t CheckDependencies(); // get all the dependencies of a package
65 
66  Bool_t IsDirectory(const char *dir1, const char *str); // check for <str> in GRID directory <dir1>
67  Bool_t CheckDirectories(TString name, TString version); // check that the defined package is existing as an alien package directory
68 
69  void SetName(const TString & theValue) { fName = theValue; }
70  // set the name of the package
71  TString GetName() const { return fName; }
72  // get the name of the package
73  void SetVersion(const TString & theValue) { fVersion = theValue; }
74  // set the version of the package
75  TString GetVersion() const { return fVersion; }
76  // get the version of the package
77  void SetPlatform(const TString & theValue) { fPlatform = theValue; }
78  // set the platform for the package
79  TString GetPlatform() const { return fPlatform; }
80  // get the platform for the package
81  void SetInstallationDirectory(const TString & theValue) { fInstallationDirectory = theValue; }
82  // set the installation directory
83  TString GetInstallationDirectory() const { return fInstallationDirectory; }
84  // get the installation directory
85  void SetAliEnMainPackageDir(const TString & theValue) { fAliEnMainPackageDir = theValue; }
86  // set the alien path to look for the named package
87  TString GetAliEnMainPackageDir() const { return fAliEnMainPackageDir; }
88  // get the alien path to look for the named package
89  void SetInstallList(TList * theValue) { fInstallList = theValue; }
90  // set the install(dependency) package list
91  TList *GetInstallList() const { return fInstallList; }
92  // get the install(dependency) package list;
93  void SetDebugLevel(Int_t & theValue) { fDebugLevel = theValue; }
94  // set the internal debug level
95  Int_t GetDebugLevel() { return fDebugLevel; }
96  // get the internal debug level
97 
98  ClassDef (TAlienPackage, 0); // Alien package interface
99 };
100 
101 #endif