[Aimmath-commit] AIM/WEB-INF/maple AutoConfWin.mws,NONE,1.1
Brought to you by:
gustav_delius,
npstrick
From: <gus...@us...> - 2003-08-27 09:30:02
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple In directory sc8-pr-cvs1:/tmp/cvs-serv4038/WEB-INF/maple Added Files: AutoConfWin.mws Log Message: installation worksheet for windows --- NEW FILE: AutoConfWin.mws --- {VERSION 5 0 "IBM INTEL NT" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Title " -1 18 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 1 2 2 2 1 1 1 1 } 3 1 0 0 12 12 1 0 1 0 2 2 19 1 }} {SECT 0 {EXCHG {PARA 18 "" 0 "" {TEXT -1 42 "Automatic Configuration o f AiM for Windows" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 102 "Copyright ( C) 2003 Neil Strickland\nDistributed without warranty under the GPL - \+ see README for details" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27026 "Config := table([]):\n\n# This worksheet will configure your Ai M system. Mostly this will be\n# done automatically. However you will \+ want to \n# change are the first three lines starting with Config['... , \n# following the explanations given.\n\n########################### ###########################################\n# The SMTP server that Ai M should use for sending mail.\n# You will certainly want to change th is setting.\nConfig['SMTPServer'] := \"smtp.york.ac.uk\":\n\n######### #############################################################\n# The f ully qualified host name of the server (eg aim.shef.ac.uk).\n# For ini tial testing purposes, you can set this to \"localhost\". This\n# wil l allow you to access AiM that it is running on, but not from any\n# o ther machine. \nConfig['HostName'] := \"localhost\":\n\n############# #########################################################\n# The name \+ of the subdirectory of the Tomcat\\webapps directory into \n# which yo u have copied the AiM files\nConfig['TomcatContext'] := \"AiM\":\n\n# \+ You probably won't need to make any changes below, unless you get an\n # error message after executing the worksheet.\n\n# Now simply press E nter to execute the worksheet.\n\n#################################### ##################################\n# The absolute path to the BLAT pr ogram, used for sending email\n# Config['BLATProgram'] := \"C:\\\\Tomc at\\\\webapps\\\\AiM\\\\bin\\\\blat\\\\blat.exe\":\n\n################ ######################################################\n# The absolute path to the kill program (used to kill processes on this OS).\n# Conf ig['KillProgram'] := \"C:\\\\Tomcat\\\\webapps\\\\AiM\\\\bin\\\\Proces s\\\\Process.exe\":\n\n############################################### #######################\n# The number of 'Recent Requests' to show on \+ the Alice Monitor page\n# Config['AliceHistorySize'] := 20:\n\n####### ###############################################################\n# The time limits placed on Maple processes by the Alice servlet. \n# Proce sses which take longer than the time limit are terminated.\n# The Admi nTimeLimit restricts the time allowed for Administrative\n# commands. \+ The StudentTimeLimit is the restriction on all other \n# commands. Gen erally the StudentTimeLimit should be shorter than\n# the admisitrativ e time limit. Both values are integers which specify \n# the time limi t in milliseconds.\n# Config['StudentTimeLimit'] := 60000: # one minu te\n# Config['AdminTimeLimit'] := 1200000: # twenty minutes\n\n###### ################################################################\n# Th e maximum number of maple processes that can be running at the same\n# time on this machine.\n# Config['MaxMapleProcesses'] := 8:\n\n####### ###############################################################\n# The top directory for the Java distribution. \n# Config['JavaHome'] := \" C:\\\\Program Files\\\\Java\\\\j2re1.4.2\":\n\n\n##################### #################################################\n# The top directory for the Tomcat distribution. \n# Config['CatalinaHome'] := \"C:\\\\To mcat\":\n\n\n######################################################### #############\n# The absolute path to the maple program. \n# Config['M apleProgram'] := \"C:\\\\Program Files\\\\Maple 8\\\\bin.win\\\\cma ple8.exe\":\n\n\n##################################################### #################\n# The absolute path to the tth program (used to con vert LaTeX to HTML).\n# Config['TtHProgram'] := \"C:\\\\Tomcat\\\\weba pps\\\\AiM\\\\bin\\\\tth\\\\tth.exe\":\n\n\n########################## ############################################\n# The directory where th e servlet should put temporary copies of uploaded\n# files. (The Mapl e part of the system will delete them or move them to\n# a more perman ent home moments later.) \n# Config['TempDir'] := \"C:\\\\WINDOWS\\\\ Temp\":\n\n\n######################################################### #############\n# The maximum allowed size for uploaded files, in bytes . The default is\n# ten megabytes.\n# Config['MaxPostSize'] := 104857 60:\n\n\n############################################################# #########\n# The number of the port on which Tomcat should listen. By default\n# this is 8080. For any port other than 80, the\n# number mu st be included explicitly in URL's (for example, \n# http://allserv.ru g.ac.be:8080). \n# Config['TomcatPort'] := 8080:\n\n\n\n############## ########################################################\n# In princip le this allows you to choose the language in which AiM's\n# messages a re presented. The required mechanisms are in place but \n# as yet the re are no tables of translated messages.\n# Config['Locale'] := \"en\" :\n\n\n############################################################### #######\n# Config['ShowToolBars'] := true:\n# true if the administrato r's browser windows should have a full set of\n# toolbars; false if th ey should be omitted to save space.\n\n\n############################# #########################################\n# The name of the time zone , and the number of SECONDS ahead of GMT.\n# Note that these are separ ate variables, not fields in the Config\n# table.\n#\n# The handling o f summer time may not be correct in Europe, and is\n# certainly incorr ect in the southern hemisphere. It is recommended\n# that you adjust \+ manually for this. \n#\n# `Date/LocalTimeZoneName` := \"GMT\":\n# ` Date/LocalTimeZoneOffset` := 0:\n\n\n################################# #####################################\n############################### #######################################\n# You can change the followin g fields if you dare, but you should\n# read the source code first and probably ask for advice.\n# Config['AimDir']\n# Config['LastRequestFi le']\n# Config['Locale']\n# Config['LogDir']\n# Config['MapleInitOptio ns']\n# Config['MapleVersion']\n# Config['OperatingSystem']\n# Config[ 'RootDir']\n# Config['ServletLogFile']\n# Config['DocumentURL']\n# Con fig['ServletURL']\n# Config['WEBINFDir']\n# Config['WebAppDir']\n# Con fig['WebDir']\n\n\n################################################### ###################\n\n\nprintf(\"AIM will now try to configure your s ystem automatically.\\n\"):\n\nread(\"Util0.mpl\"):\nread(\"OS0.mpl\") :\n\nif (os_os = \"DOS\") then\n setcase := util_tolowercase:\nelse\n \+ setcase := proc(s) s; end:\nfi:\n\nosname1 := proc()\n if (nargs = 0) \+ then\n NULL;\n else\n os_osname(args)\n fi;\nend:\n\nunassign('`Date /LocalTimeZoneName`'):\nunassign('`Date/LocalTimeZoneOffset`'):\n\np : = proc() printf(args); end:\n\nif (waffle = true) then\n q := eval(p): \nelse\n q := proc() 1; end:\nfi:\n\nsetconfig :=\n# KM\n# DIST proc(k ::name,v::\{integer,string,boolean\})\n proc(k::name,v::\{numeric,stri ng,boolean\})\n# END KM\n # Set Config[k] to v unless Config[k] is al ready defined and\n # has the same type as v or is NULL.\n global Co nfig;\n\n if member([k],[indices(Config)]) then\n if not(type([Conf ig[k]],[whattype(v)])) and Config[k] <> NULL then\n q(\"Config[%A] \+ was set manually to %A\\n\",k,Config[k]);\n q(\"This has the wrong \+ type and is being overridden by the default,\\n\"):\n q(\"which is \+ %A.\\n\\n\",v):\n Config[k] := v:\n fi:\n else\n Config[k] := \+ v:\n fi:\n end:\n\n################################################## ####################\n\n# Determine operating system and Maple version number\n\nprintf(\"%s%s\\n\",os_vnummsg,os_osmsg):\n\nif (os_vnum = 0 ) then stop; fi:\n\nConfig['MapleVersion'] := os_vnum:\nConfig['Ope ratingSystem'] := os_os:\n\n########################################## ############################\n\n# Define some functions to access the \+ file system\n\nstrip := proc(s::string,t::string)\n if length(s) >= le ngth(t) and\n substring(s,-length(t) .. -1) = t then\n RETURN(subs tring(s,1..(-length(t)-1)));\n else\n RETURN(NULL):\n fi:\nend:\n\n\n ###################################################################### \n\n\npath := getenv(\"PATH\"):\nif path = NULL then\n path := []: \n \+ q(\"Execution path is empty\\n\"):\nelse \n path := [os_pathsplit(path )]:\n q(\"Execution path is %A\\n\",path):\nfi:\n\nlook_for_dir :=\n p roc(target::string)\n local msg,checks,places,ans,newdirs,l,r,c,d,d1, \n place,x,y,m,prog,progdir,ok,found,location;\n global proble ms;\n\n p(\"\\nLooking for %s\\n\",target):\n\n found := false:\n l ocation := NULL:\n\n checks,places :=\n selectremove(e -> evalb(lhs (e) = \"Check\"),[args[2..-1]]):\n \n checks := map(rhs,checks):\n\n ans := NULL;\n newdirs := []:\n\n for place in places do\n l := \+ lhs(place):\n r := rhs(place):\n newdirs := NULL:\n if l = \"Con f\" then\n if member([r],[indices(Config)]) then\n d := Config[ r];\n if type([d],[string]) then\n newdirs := [setcase(d)];\n q(\"Config['%a'] was set manually to %a\\n\",r,d):\n else\n \+ q(\"Config['%a'] was set to %A,\\n which is not a string\\n\",\n \+ r,d):\n fi:\n else\n q(\"Config['%a'] is not set\\n \",r):\n fi:\n elif l = \"Env\" then\n newdirs := [getenv(r)]: \n if newdirs = [] then\n q(\"Environment variable %s is not se t\\n\",r):\n else\n q(\"Environment variable %s is set to %s\\n \",r,op(newdirs)):\n fi:\n elif l = \"Def\" then\n d := r[1]: \n q(\"Checking default location %s%s%s* ...\",d,os_pathsep,r[2]): \n if r[1] = \"\" or r[1] = \"c:\" or r[1] = \"C:\" then\n d1 : = cat(d,\"/\"):\n else\n d1 := d;\n fi:\n if (os_direxist s(d1)) then\n newdirs := map(setcase,os_listfiles(d1)):\n newd irs := select(util_startswith,newdirs,setcase(r[2])):\n newdirs := map((x,y) -> os_osname(cat(y,\"/\",x)),newdirs,d):\n newdirs := s elect(os_direxists,newdirs):\n if newdirs = [] then\n q(\"not found\\n\"):\n fi:\n else\n q(\"directory does not exist. \\n\"):\n fi:\n elif l = \"Path\" then\n q(\"Checking the path for executables like *%s%s ...\",os_pathsep,r):\n progdir,prog := \+ op(util_splitfilename(r)):\n if os_os = \"Linux\" then\n d := u til_striptrailspaces(os_system0(\"which %a\",prog)):\n if util_end swith(d,r) then\n d := substring(d,1..-length(r)-1):\n newdi rs := [d]:\n fi:\n else\n newdirs := map(setcase,select(uti l_endswith,path,progdir)):\n newdirs :=\n select((x,y) -> os_ fileexists(cat(x,\"/\",y)),newdirs,prog):\n newdirs := map((x,m) - > substring(x,1..-m-1),newdirs,length(r)):\n fi:\n if newdirs = \+ [] then\n q(\"not found\\n\"):\n fi:\n fi:\n\n for d in new dirs do\n q(\"trying %s ... \",d):\n if os_direxists(d) then\n \+ q(\"exists ... \"):\n ok := true:\n for c in checks do\n \+ if not(os_fileexists(cat(d,\"/\",c))) then\n ok := false:\n \+ break:\n fi:\n od:\n if ( ok ) then\n q(\" OK\\ n\"):\n p(\"%s found at %s\\n\",target,d):\n found := true: \n location := d:\n if (testmode <> true) then\n RETUR N(d):\n fi:\n else\n q(\" not OK (does not contain %s)\\ n\",c):\n fi:\n fi:\n od:\n od:\n if (found <> true) then\n p(\"Could not find %s\\n\",target):\n problems := true:\n fi:\n \+ RETURN(location):\n end:\n \n######################################## ##########\n\nlook_for_prog :=\n proc(target::string)\n local msg,che cks,places,ans,l,r,c,d,place,x,y,m,f,ok,e,cmd,location;\n global prob lems;\n\n p(\"\\nLooking for %s\\n\",target):\n location := NULL:\n \n checks,places :=\n selectremove(e -> evalb(lhs(e) = \"Check\"),[ args[2..-1]]):\n \n checks := map(rhs,checks):\n\n ans := NULL;\n\n for place in places do\n l := lhs(place):\n r := rhs(place):\n \+ f := NULL:\n if l = \"Conf\" then\n if member([r],[indices(Confi g)]) then\n d := Config[r];\n if type([d],[string]) then\n \+ f := d;\n q(\"Config['%a'] was set manually to %a\\n\",r,d):\n \+ else\n q(\"Config['%a'] was set to %A,\\n which is not a stri ng\\n\",\n r,d):\n fi:\n else\n q(\"Config['%a'] is \+ not set\\n\",r):\n fi:\n elif l = \"Def\" then\n f := r:\n \+ if os_fileexists(f) then\n q(\"Found at default location %s\\n\",f )\n else\n q(\"Nothing in default location %s\\n\",f):\n f \+ := NULL;\n fi:\n elif l = \"Path\" then\n q(\"Checking the pat h for executables like *%s%s ...\",os_pathsep,r):\n if os_os = \"Li nux\" then\n d := util_striptrailspaces(os_system0(\"which %a\",r) ):\n if os_fileexists(d) then\n f := d: \n q(\"found at \+ %s\\n\",f):\n else\n q(\"not found\\n\"):\n fi:\n else \n d := map((x,y) -> cat(x,\"/\",y),path,r): \n d := select(os _fileexists,d):\n if d <> [] then \n f := d[1]: \n q(\"f ound at %s\\n\",f):\n else\n q(\"not found\\n\"):\n f := NULL;\n fi:\n fi:\n fi:\n\n if f <> NULL then\n f := os _osname(f):\n q(\"Trying %s ... \",f):\n if os_fileexists(f) the n\n q(\"exists ... \"):\n ok := true:\n for c in checks do \n cmd := cat(\"\\\"\",f,\"\\\" \",c[1]);\n e := traperror(o s_system(cmd)):\n if e = lasterror then\n q(\"\\nNot OK : e rror while executing %a : %s\\n\",cmd,e):\n elif SearchText(c[2], e) = 0 then\n q(\"\\nNot OK : '%s %s' does not produce '%s' in t he output.\\n\",\n f,c[1],c[2]):\n if length(e) > 300 th en e := cat(substring(e,1..300),\"...\"): fi:\n q(\"Output was: \+ \\n%s\\n\\n\",e):\n ok := false;\n break:\n fi:\n \+ od:\n if ( ok ) then\n q(\" OK\\n\"):\n p(\"%s found at %s\\n\",target,f):\n location := f:\n if (testmode <> true) then RETURN(f): fi:\n else\n q(\"Not OK\\n\"):\n fi:\n \+ else\n q(\"does not exist.\\n\"):\n fi:\n fi:\n od:\n if \+ (location = NULL) then\n p(\"Could not find %s\\n\",target):\n pro blems := true:\n fi:\n RETURN(location):\n end:\n\nproblems := false ;\n\n################################################################# #####\n\n# Look for Java\n\n# Config['JavaHome']\n# JAVA_HOME in the e nvironment\n# Defaults: Linux: /usr/java/jdk*, /usr/local/jdk*\n# \+ DOS: c:\\java\\jdk*, c:\\jdk*\n# double parent of java executabl e (try 'where', or PATH)\n#\n# Check: should contain file bin/java\n\n if os_os = \"Linux\" then\n Config['JavaHome'] :=\n look_for_dir(\n \+ \"Java\",\n \"Conf\" = 'JavaHome',\n \"Env\" = \"JAVA_HOME\",\n \+ \"Def\" = [\"/usr/java\",\"jdk\"],\n \"Def\" = [\"/usr/local\",\" jdk\"],\n \"Path\" = \"bin/java\",\n \"Check\" = \"bin/java\"\n ): \nelse\n Config['JavaHome'] :=\n osname1(look_for_dir(\n \"Java\",\n \+ \"Conf\" = 'JavaHome',\n \"Env\" = \"JAVA_HOME\",\n \"Def\" = \+ [\"C:\\\\java\",\"jdk\"],\n \"Def\" = [\"C:\\\\java\",\"j2\"],\n \+ \"Def\" = [\"C:\",\"jdk\"],\n \"Def\" = [\"C:\",\"j2\"],\n \"Def \" = [\"C:\\\\Program Files\\\\java\",\"jdk\"],\n \"Def\" = [\"C: \\\\Program Files\\\\java\",\"j2\"],\n \"Def\" = [\"C:\\\\Program F iles\",\"jdk\"],\n \"Def\" = [\"C:\\\\Program Files\",\"j2\"],\n \+ \"Path\" = \"bin/java.exe\",\n \"Check\" = \"bin/java.exe\"\n )):\nf i:\n \n\n############################################################# #########\n\n# Look for Tomcat\n\ncd := [util_slashsplit(currentdir()) ]:\nif nops(cd) > 4 then\n cd := util_slashjoin(op(cd[1..-6])):\n cd : = (\"Def\" = [cd,\"tomcat\"], \"Def\" = [cd,\"jakarta-tomcat\"]):\nels e\n cd := NULL:\nfi:\n\nif os_os = \"Linux\" then\n Config['CatalinaHo me'] :=\n look_for_dir(\n \"Tomcat\",\n \"Conf\" = 'CatalinaHome',\n \"Env\" = \"CATALINA_HOME\",\n \"Def\" = [\"/usr/local\",\"tomcat \"],\n \"Def\" = [\"/usr/local\",\"jakarta-tomcat\"],\n cd,\n \"Ch eck\" = \"bin/catalina.sh\"\n ):\nelse\n Config['CatalinaHome'] :=\n o sname1(look_for_dir(\n \"Tomcat\",\n \"Conf\" = 'CatalinaHome',\n \+ \"Env\" = \"CATALINA_HOME\",\n \"Def\" = [\"C:\",\"tomcat\"],\n \" Def\" = [\"C:\",\"jakarta-tomcat\"],\n \"Def\" = [\"C:\\\\Program F iles\",\"tomcat\"],\n \"Def\" = [\"C:\\\\Program Files\",\"jakarta-t omcat\"],\n cd,\n \"Check\" = \"bin/catalina.bat\"\n )):\nfi:\n\n\n# ##################################################################### \n\n# Look for Maple\n\nif os_os = \"Linux\" then\n Config['MapleProgr am'] :=\n look_for_prog(\n \"Maple\",\n \"Conf\" = 'MapleProgram', \n \"Def\" = \"/bin/maple\",\n \"Def\" = \"/usr/bin/maple\",\n \+ \"Def\" = \"/usr/local/bin/maple\",\n \"Def\" = \"/usr/local/mapl e/bin/maple\",\n \"Def\" = \"/usr/local/maple_su/bin/maple\",\n \" Path\" = \"maple\",\n \"Check\" = [\"-c quit;\",\"Waterloo\"]\n ):\n else\n Config['MapleProgram'] :=\n osname1(look_for_prog(\n \"Maple\" ,\n \"Conf\" = 'MapleProgram',\n \"Def\" = \"C:\\\\Maple\\\\bin.w nt\\\\cmaple.exe\",\n \"Def\" = \"C:\\\\Program Files\\\\Maple\\\\b in.wnt\\\\cmaple.exe\",\n \"Def\" = \"C:\\\\Maple 8\\\\bin.win\\\\c maple8.exe\",\n \"Def\" = \"C:\\\\Program Files\\\\Maple 8\\\\bin.w in\\\\cmaple8.exe\",\n \"Def\" = \"C:\\\\Program Files\\\\Maple 9\\ \\bin.win\\\\cmaple9.exe\",\n \"Def\" = \"C:\\\\Maple 7\\\\bin.wnt \\\\cmaple.exe\",\n \"Def\" = \"C:\\\\Program Files\\\\Maple 7\\\\b in.wnt\\\\cmaple.exe\",\n \"Def\" = \"C:\\\\Maple 6\\\\bin.wnt\\\\c maple.exe\",\n \"Def\" = \"C:\\\\Program Files\\\\Maple 6\\\\bin.wn t\\\\cmaple.exe\",\n \"Path\" = \"cmaple8.exe\",\n \"Path\" = \"cm aple.exe\",\n \"Check\" = [\"-c quit;\",\"Waterloo\"]\n )):\nfi:\n\n \n#################################################################### ##\n\n# Look for upload directory\n\nif os_os = \"Linux\" then\n Confi g['TempDir'] :=\n look_for_dir(\n \"upload directory\",\n \"Conf\" \+ = 'TempDir',\n \"Env\" = \"TempDir\",\n \"Env\" = \"TMPDIR\",\n \+ \"Def\" = [\"\",\"tmp\"]\n ):\nelse\n Config['TempDir'] :=\n osname 1(look_for_dir(\n \"upload directory\",\n \"Conf\" = 'TempDir',\n \+ \"Env\" = \"TempDir\",\n \"Env\" = \"TMPDIR\",\n \"Env\" = \"T emp\",\n \"Env\" = \"TMP\",\n \"Def\" = [\"C:\",\"temp\"],\n \" Def\" = [\"C:\",\"tmp\"]\n )):\nfi:\n\nsetconfig('MaxPostSize',10 * \+ 1024 * 1024):\n\n##################################################### #################\n\np(\"\\nFinding the host name\\n\"):\n\nif type([ Config['HostName']],[string]) then\n q(\"The host name was set manuall y to %a\\n\",Config['HostName']):\nelse\n if os_os = \"Linux\" then\n \+ hostname := traperror(ssystem(\"hostname --fqdn\")):\n if hostname = lasterror then\n err := hostname:\n elif hostname[1] > 0 then\n \+ err := hostname[2]:\n else\n hostname := hostname[2]:\n err := NU LL:\n fi:\n if err = NULL then\n if length(hostname) > 0 and subst ring(hostname,-1..-1)= \"\\n\" then\n hostname := substring(hostnam e,1..-2):\n fi:\n q(\"'hostname --fqdn' returned %a\\n\",hostname) :\n if (hostname = \"localhost.localdomain\") then\n hostname := \+ \"localhost\":\n fi:\n else\n q(\"Error while running 'hostname - -fqdn' :\\n%s\\n\\n\",err):\n fi:\n else\n hostname := \"localhost\" :\n fi: \n\nConfig['HostName'] := hostname:\n\nfi:\n\np(\"Host name se t to %s\\n\\n\",Config['HostName']):\n\n############################## ########################################\n\nsetconfig('Locale',\"en\") :\n\n################################################################# #####\n\np(\"Setting time zone\\n\"):\n\n\ntimezone := NULL:\ntimeoffs et := NULL:\n\nzones :=\n table([\n \"ADT\" =-03,\n \"AHST\"=-10,\n \" AST\" =-04,\n \"AT\" =-02,\n \"BST\" =+01,\n \"BT\" =+03,\n \"CAT\" \+ =-10,\n \"CCT\" =+08,\n \"CDT\" =-05,\n \"CET\" =+01,\n \"CST\" =-06, \n \"EADT\"=+11,\n \"EAST\"=+10,\n \"EDT\" =-04,\n \"EET\" =+02,\n \"E ST\" =-05,\n \"FST\" =+02,\n \"FWT\" =+01,\n \"GMT\" = 0,\n \"GST\" = +10,\n \"HDT\" =-09,\n \"HST\" =-10,\n \"IDLE\"=+12,\n \"IDLW\"=-12,\n \"JST\" =+09,\n \"MDT\" =-06,\n \"MEST\"=+02,\n \"MET\" =+01,\n \"MEW T\"=+01,\n \"MST\" =-07,\n \"NT\" =-11,\n \"NZDT\"=+13,\n \"NZST\"=+1 2,\n \"PDT\" =-07,\n \"PST\" =-08,\n \"SST\" =+02,\n \"SWT\" =+01,\n \+ \"UTC\" = 0,\n \"WADT\"=+08,\n \"WAST\"=+07,\n \"WAT\" =-01,\n \"WET \" = 0,\n \"YDT\" =-08,\n \"YST\" =-09\n]):\n\n\nif os_os = \"Linux\" then\n timezone := traperror(util_striptrailspaces(os_system(\"date + %%Z\")));\n if timezone = lasterror then timezone := NULL: fi:\n t0 := traperror(parse(os_system(\"date +\\\"(%%H*60+%%M)\\\"\"))):\n t0 := \+ traperror(parse(os_system(\"date -u +\\\"(%%H*60+%%M)\\\"\"))):\n if t ype([t0,t1],[integer,integer]) then\n if t0 > t1 + 13 * 60 then\n t 0 := t0 - 24 * 60:\n fi:\n timeoffset := round((t0 - t1)/15) * 15 * \+ 60: \n fi:\nfi:\n\nif type([`Date/LocalTimeZoneName`],[string]) then\n timezone := `Date/LocalTimeZoneName`:\n q(\"Time zone was set manuall y to %a\\n\",timezone):\nelif timezone <> NULL then\n q(\"Time zone wa s determined automatically as %a\\n\",timezone):\nelse\n q(\"Could not determine time zone, assuming GMT\\n\"):\n timezone := \"GMT\":\nfi: \n\n\nif type([`Date/LocalTimeZoneOffset`],[integer]) then\n timeoffse t := `Date/LocalTimeZoneOffset`:\n q(\"The offset from UTC was set man ually to %d\\n\",timeoffset):\n if timeoffset <> 0 and abs(timeoffset) < 24 then\n q(\"This appears to be in hours, but it needs to be in s econds.\\n\"):\n q(\"It will be converted automatically.\\n\"):\n ti meoffset := timeoffset * 3600:\n else\n if not (type(integer,timeoffs et/900)) then\n timeoffset := round(timeoffset / 900) * 900:\n q( \"This was rounded to %d\\n\",timeoffset):\n fi:\n fi:\nelif type([zo nes[timezone]],[integer]) then\n timeoffset := zones[timezone] * 3600: \n q(\"The offset from UTC is %d hour(s)\\n\",zones[timezone]):\nelif \+ timeoffset <> NULL then\n timeoffset := round(timeoffset / 900) * 900: \n q(\"The offset from UTC was calculated as %A hour(s)\\n\",\n time offset/3600.):\nelse\n q(\"The offset from UTC could not be determined , and will be taken\\n\"):\n q(\"to be zero. \\n\"):\n timeoffset := 0 :\nfi:\n\n`Date/LocalTimeZoneName` := timezone:\n`Date/LocalTimeZoneOf fset` := timeoffset:\n\np(\"Time zone set to %s (= UTC +%A hours)\\n\" ,timezone,timeoffset/3600):\n\n####################################### ###############################\n\np(\"Setting other configuration opt ions\\n\"):\n\nif type([Config['TomcatPort']],[integer]) then\n Config ['TomcatPort'] := sprintf(\"%d\",Config['TomcatPort']):\nfi:\n\nsetcon fig('TomcatPort' , \"8080\"):\n\nif (Config['TomcatPort'] = \"80\") th en\n setconfig('HostPort' , Config['HostName']):\nelse\n setconfig('Ho stPort' , cat(Config['HostName'],\":\",Config['TomcatPort'])):\nfi:\n \nsetconfig('TomcatContext' , \"AiM\"):\n\nif Config['TomcatContext'] \+ = \"ROOT\" then\n setconfig('FullContext',Config['HostPort']):\n setco nfig('WebAppDir',\n os_maplename(cat(Config['CatalinaHome'],\"/webapp s/ROOT\"))):\nelse\n setconfig('FullContext',\n cat(Config['HostPort' ],\"/\",Config['TomcatContext'])):\n setconfig('WebAppDir' ,\n os_map lename(\n cat(Config['CatalinaHome'],\"/webapps/\",Config['TomcatCon text']))):\nfi:\n\nprintf(Config['WebAppDir']);\n\nsetconfig('WEBINFDi r' ,\n cat(Config['WebAppDir'],\"/WEB-INF\")):\n\nsetconfig('AimDir' \+ , Config['WEBINFDir']):\nsetconfig('LogDir' , cat(Config['AimDir'], \"/logs\")):\nsetconfig('RootDir' , cat(Config['AimDir'],\"/root\")): \n\nsetconfig('ServletLogFile',os_osname(cat(Config['LogDir'],\"/servl etlog\"))):\nsetconfig('LastRequestFile',os_osname(cat(Config['LogDir' ],\"/lastrequest\"))):\nsetconfig('EmailLogFile',os_osname(cat(Config[ 'LogDir'],\"/emaillog\"))):\n\nsetconfig('WebDir' , Config['WebAppDir' ]):\nsetconfig('DocDir' , cat(Config['WebAppDir'],\"/doc\")):\n\nsetco nfig('ServletURL', cat(\"http://\",Config['FullContext'],\"/Alice\")): \nsetconfig('DocumentURL' , cat(\"http://\",Config['FullContext'])):\n \nsetconfig('ShowToolBars' , true):\n\nsetconfig('MapleInitOptions',\" default\"):\n\n\n##################################################### #################\n\n# Look for TtH\n\nif os_os = \"Linux\" then\n Con fig['TtHProgram'] :=\n look_for_prog(\n \"TtH\",\n \"Conf\" = 'TtHP rogram',\n \"Path\" = \"tth\",\n \"Def\" = \"/usr/local/bin/tth\" ,\n \"Def\" = \"/usr/bin/tth\",\n \"Def\" = \"/bin/tth\",\n \"D ef\" = cat(Config['WebAppDir'],\"/bin/tth_exe/tth\"),\n \"Check\" = [\"-r < tthtest.tex\",\"TtH is OK\"]\n ):\nelse\n Config['TtHProgram' ] :=\n os_osname(look_for_prog(\n \"TtH\",\n \"Conf\" = 'TtHProgram ',\n \"Path\" = \"tth.exe\",\n \"Def\" = \"C:\\\\TtH\\\\tth.exe\" ,\n \"Def\" = \"C:\\\\Program Files\\\\tth.exe\",\n \"Def\" = \" C:\\\\Program Files\\\\TtH\\\\tth.exe\",\n \"Def\" = cat(Config['We bAppDir'],\"\\\\bin\\\\tth_exe\\\\tth.exe\"),\n \"Check\" = [\"-r < t thtest.tex\",\"TtH is OK\"]\n )):\nfi:\n\n\n########################## ############################################\n\n# Look for the Kill Pr ogram\n\nif os_os = \"Linux\" then\n Config['KillProgram'] :=\"/bin/ki ll\";\n os_osname(look_for_prog(\n \"Kill Process Utility\",\n \"C onf\" = 'KillProgram',\n \"Path\" = \"kill\",\n \"Def\" = \"/b in/kill\",\n \"Def\" = \"/usr/bin/kill\",\n \"Def\" = \"/usr/l ocal/bin/kill\",\n \"Check\" = [\"\",\"kill\"]\n )):\n Config['Kill ProgramArg'] :=\"-9\";\nelse\n Config['KillProgram'] :=\n os_osname(lo ok_for_prog(\n \"Kill Process Utility\",\n \"Conf\" = 'KillProgram' ,\n \"Path\" = \"Process.exe\",\n \"Def\" = \"C:\\\\AIM\\\\Proces s\",\n \"Def\" = \"C:\\\\Process\",\n \"Def\" = cat(Config['WebA ppDir'],\"\\\\bin\\\\process\\\\Process.exe\"),\n \"Check\" = [\"-v\" ,\"beyondlogic.org\"]\n )):\n setconfig('KillProgramArg',\"-k\");\nfi: \n\n\n################################################################ ######\n\n# Look for email program\n\nif os_os = \"Linux\" then\n Conf ig['SendmailProgram'] :=\n look_for_prog(\n \"sendmail\",\n \"Conf\" = 'SendmailProgram',\n \"Path\" = \"sendmail\",\n \"Def\" = \"/ usr/lib/sendmail\",\n \"Def\" = \"/usr/bin/sendmail\"\n ):\n setcon fig('BLATProgram',\"\"):\n setconfig('SMTPServer',\"\"):\nelse\n Confi g['BLATProgram'] := cat(Config['CatalinaHome'],\"\\\\bin\\\\blat\\\\bl at.exe\"):\n setconfig('SendmailProgram',\"\");\n setconfig('SMTPServe r',\"\"):\nfi:\n\np(\"\\n\"):\n\n\n\nsetconfig('AliceHistorySize',20): \nsetconfig('MaxMapleProcesses',8):\nsetconfig('StudentTimeLimit',6000 0): # one minute\nsetconfig('AdminTimeLimit',1200000): # twenty minu tes\n\nsetconfig('TimeLimit',2.0): # two seconds\n\n\np(\"\\n\"):\n\n# ##################################################################### \n\nread(\"ConfigFields.mpl\"):\n\np(\"Writing Config.mpl and ServletC onfig.mpl\\n\"):\n\nif os_fileexists(\"Config.mpl\") then\n p(\"Renami ng Config.mpl as Config.bak\\n\\n\"):\n err := traperror(os_rename(\"C onfig.mpl\",\"Config.bak\")):\n if (err = lasterror) then\n p(\"Faile d: %s\\n\",err):\n `quit`(1):\n fi:\nfi:\n\nm := proc() fprintf(fd,ar gs); q(args); end:\n\naddhash :=\n proc(s::string) \n convert(subs(10 = op([10,35,32]),convert(s,bytes))[2..-1],bytes):\n end:\n\npadeq := \n proc(k::name,l::integer)\n m(\"'%a'%s = %a,\\n\",k,\n cat(\" \" $ (15 - length(k))),\n `if`(Config[k] = NULL,\"NULL\",Config[k])): \n end:\n\nhdr := \"\nThis file is generated automatically by AutoConf .mpl. It is\nrecommended that you do not edit it directly. Instead, \+ you should\ncreate a separate file called ManualConfig.mpl and copy ov er any\ndefinitions (from either Config.mpl or ServletConfig.mpl) that you\nwish to override. You can then run AutoConf.mpl to fill in the \nremaining definitions and check that everything is consistent.\n\": \n\n\nfd := traperror(fopen(\"Config.mpl\",'WRITE')):\nif (fd = laster ror) then\n p(\"Could not open Config.mpl for writing:\\n%a\\n\\n\",fd ):\n `quit`(1):\nfi:\n\nfprintf(fd,addhash(hdr)):\nfprintf(fd,\"\\n\\n \"):\n\nm(\"Config := table([\\n\"):\n\nfor x in ConfigFields do\n pad eq(x[1],15):\n fprintf(fd,addhash(x[3])):\n fprintf(fd,\"\\n\\n\"):\no d:\n\nm(\"NULL]):\\n\\n\"):\n\nm(\"`Date/LocalTimeZoneName` := %a:\\ n\",`Date/LocalTimeZoneName`):\nm(\"`Date/LocalTimeZoneOffset` := %d: \\n\",`Date/LocalTimeZoneOffset`):\n\nm(\"\\n\\n\"):\n\nerr := traperr or(fclose(fd)):\nif err = lasterror then\n p(\"Could not close Config. mpl:\\n%a\\n\\n\",err):\n `quit`(1):\nfi:\n\nfd := traperror(fopen(\"S ervletConfig.mpl\",'WRITE')):\nif (fd = lasterror) then\n p(\"Could no t open ServletConfig.mpl for writing:\\n%a\\n\\n\",fd):\n `quit`(1):\n fi:\n\nfprintf(fd,addhash(hdr)):\nfprintf(fd,\"\\n\\n\"):\n\nm(\"Servl etConfig := table([\\n\"):\n\nfor x in ServletConfigFields do\n padeq( x[1],18):\n fprintf(fd,addhash(x[3])):\n fprintf(fd,\"\\n\\n\"):\nod: \n\nm(\"NULL]):\\n\\n\"):\n\nerr := traperror(fclose(fd)):\nif err = l asterror then\n p(\"Could not close ServletConfig.mpl:\\n%a\\n\\n\",er r):\n `quit`(1):\nfi:\n\n\n########################################### ###########################\n\nif problems = true then\n p(\"There wer e configuration problems.\\n\"):\n p(\"Please read the messages above. \\n\"):\n if (waffle <> true) then\n p (\"You can get more detailed messages by setting waffle := true \\n\") :\n p(\"before executing the worksheet again. \+ \\n\"):\n fi:\n p(\"To fix the problems, edit the relevant entries \+ at the top of \\n\"):\n p(\"the worksheet and then execute it again. \+ \\n\"):\n if (dontquit <> true) then `quit`(1): fi:\nfi:\n\nif pr oblems = false then read(\"Servlet.mpl\"): \n p(\"AIM was successfully configured. \\n\"):\nfi:\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "2 0 0" 27026 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 } {PAGENUMBERS 0 1 2 33 1 1 } |