1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
|
void install(string request, string dest)
{
string target;
int components = 0;
string base;
base = "tmp/install/";
md(base);
if (request == "x")
components = 15;
else
{
if (strfind(request, "d") != -1)
components |= 1;
if (strfind(request, "h") != -1)
components |= 2;
if (strfind(request, "l") != -1)
components |= 4;
if (strfind(request, "m") != -1)
components |= 8;
}
if (components & 1)
{
printf("\n installing documentation\n");
logZip("",
"READLINE "
"README "
"README.X11 "
"README.class-setup "
"README.immovable "
"README.milter "
"README.optimization "
"README.process-pipe "
"README.fnwrap "
"process-pipe.odp "
"process-pipe.pdf "
"TODO",
base + DOC "/");
logRecursive("documentation/examples", base + DOC "/examples");
logZip("scripts", "", base + DOC "/scripts");
// logInstall("documentation/images", "*.jpg", base + DOC "/images");
target = base + DOC + "/man";
logInstall("tmp/manhtml", "", target);
logInstall("documentation/man", LIBRARY ".jpg", target);
chdir(g_cwd + target);
run("ln -sf " LIBRARY ".7.html index.html");
run("ln -sf iterator.3.html reverseiterator.3.html");
run("ln -sf systemclock.3.html fileclock.3.html");
run("ln -sf systemclock.3.html highresolutionclock.3.html");
run("ln -sf systemclock.3.html steadyclock.3.html");
chdir(g_cwd + target);
logZip("", "README", base + DOC);
}
if (components & 2)
{
printf("\n installing the headers\n");
logInstall("tmp/" LIBRARY, "", base + HDR);
}
if (components & 4)
{
printf("\n installing the libraries\n");
logInstall(g_tmpliba, "", base + LIB);
#ifdef BUILD_SHARED
logInstall(g_tmplibso, "", base + LIB);
#endif
}
if (components & 8)
{
printf("\n installing the manual pages\n");
logZip("tmp/man/man3", "", base + MAN "/man3");
chdir(g_cwd + base + MAN "/man3");
run("ln -sf iterator.3bobcat.gz reverseiterator.3bobcat.gz");
run("ln -sf systemclock.3bobcat.gz fileclock.3bobcat.gz");
run("ln -sf systemclock.3bobcat.gz highresolutionclock.3bobcat.gz");
run("ln -sf systemclock.3bobcat.gz steadyclock.3bobcat.gz");
chdir(g_cwd);
logZip("tmp/man/man7", "", base + MAN "/man7");
}
chdir(g_cwd);
if (dest == "")
dest = "/";
else
md(dest);
dest = cutEoln(backtick("readlink -f " + dest)[0]);
if (g_logPath != "")
backtick("icmake/log " + dest + " " + g_logPath);
chdir(base);
run("../../icmake/installer " + dest + "/");
printf("\n Installation completed\n");
exit(0);
}
|