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
|
void rungzip9(string src, string dest)
{
int idx;
string file;
list man;
chdir(src);
man = makelist("*");
chdir(g_cwd);
for (idx = sizeof(man); idx--; )
{
file = element(idx, man);
run("gzip -9 < " + src + file + " > " + dest + file + ".gz");
}
}
void reqzip(string dest, string srcPath, string src)
{
list files;
int idx;
string file;
files = strtok(src, " ");
for (idx = sizeof(files); idx--; )
{
file = element(idx, files);
run("gzip -9 < " + srcPath + file + " > " + dest + file + ".gz");
}
}
void install(string where)
{
printf(" installing the executable\n");
md(where + BIN);
run("cp tmp/bin/* " + where + BIN);
printf(" installing the manual page stealth.1\n");
md(where + MAN);
reqzip(where + MAN + "/", "tmp/man/", "stealth.1");
printf(" installing the manual page stealthman.html\n");
md(where + DOC + "/man");
reqzip(where + DOC + "/man/", "tmp/manhtml/", "stealthman.html");
printf(" installing the information directly in and under $DOC\n");
reqzip(where + DOC + "/", "./", "changelog README ACKNOWLEDGEMENTS");
printf(" installing scripts\n");
md(where + DOC + "/scripts");
reqzip(where + DOC + "/scripts/", "./", "stealthmail");
printf(" installing examples\n");
md(where + DOC + "/examples");
rungzip9("example-policies/", where + DOC + "/examples/");
printf(" installing manual\n");
run("cp -r tmp/manual " + where + DOC);
printf(" Installation completed\n");
exit(0);
}
|