File: install

package info (click to toggle)
yodl 4.05.02-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,724 kB
  • sloc: ansic: 7,803; perl: 683; cpp: 570; sh: 411; xml: 190; makefile: 163
file content (122 lines) | stat: -rw-r--r-- 2,889 bytes parent folder | download | duplicates (2)
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
121
122
void _installYodl2(string where)
{
    list conversions;
    int idx;
    
    conversions = strtok(STD_CONVERSIONS, " ");
    
    for (idx = listlen(conversions); idx--; )
        run("ln -sf yodl2whatever " + where + BIN + "/yodl2" +
                                                    conversions[idx]); 

    run("chmod +x " + where + BIN +  "/yodl2*");
}

void _installYodlConverters(string where, int debian)
{
    list conversions;
    int idx;
    
    conversions = (list)"whatever" + strtok(STD_CONVERSIONS, " ");

    string gzipped;
   
    if (debian == 1)
        gzipped = ".1.gz ";
    else
        gzipped = ".1 ";

    for (idx = listlen(conversions); idx--; )
        run("ln -sf yodlconverters" + gzipped + 
            where + MAN + "/man1/yodl2" + conversions[idx] + gzipped);
}

void installExit(string what, string where)
{
    if (what == "programs")
    {
        md(where + BIN);
        run("cp " + g_install + BIN + "/* " + where + BIN);
        run("chmod +x " + where + BIN +  "/yodlstriproff");
        _installYodl2(where);

        exit(0);
    }

    if (what == "yodl")
    {
        md(where + BIN);
        run("cp " + g_install + BIN + "/yodl " + where + BIN);
        exit(0);
    }

    if (what == "yodlpost")
    {
        md(where + BIN);
        run("cp " + g_install + BIN + "/yodlpost " + where + BIN);
        exit(0);
    }

    if (what == "yodlverbinsert")
    {
        md(where + BIN);
        run("cp " + g_install + BIN + "/yodlverbinsert " + where + BIN);
        exit(0);
    }

    if (what == "yodlstriproff")
    {
        md(where + BIN);
        run("cp " + g_install + BIN + "/yodlstriproff " + where + BIN);
        run("chmod +x " + where + BIN +  "/yodlstriproff");
        exit(0);
    }

    if (what == "yodl2whatever")
    {
        md(where + BIN);
        run("cp " + g_install + BIN + "/yodl2whatever " + where + BIN);

        _installYodl2(where);        
        exit(0);
    }

    int debian = 0;
    
    if (what == "mandeb")
    {
        debian = 1;
        what = "man";
    }
         
    if (what == "man")
    {
        md(where + MAN);
        run("cp -r " + g_install + MAN + "/* " + where + MAN);
        _installYodlConverters(where, debian);  // debian: .gz links to
                                                // yodlconverters.1.gz
        exit(0);
    }

    if (what == "manual")
    {
        md(where + DOCDOC);
        run("cp -r " + g_install + DOCDOC + "/* " + where + DOCDOC);
        run("cp  AUTHORS.txt CHANGES changelog " + where + DOCDOC);
        exit(0);
    }

    if (what == "macros")
    {
        md(where + STD_INCLUDE);
        run("cp -r " + g_install + STD_INCLUDE + "/* " + where + STD_INCLUDE);
        exit(0);
    }

    if (what == "docs")
    {
        md(where + DOC);
        run("cp  AUTHORS.txt CHANGES changelog " + where + DOC);
        exit(0);
    }
}