File: ale-clone-war2.postinst

package info (click to toggle)
ale-clone 1.15pre16.3-1
  • links: PTS
  • area: contrib
  • in suites: potato
  • size: 2,432 kB
  • ctags: 3,217
  • sloc: ansic: 37,483; sh: 1,105; makefile: 343
file content (79 lines) | stat: -rw-r--r-- 2,529 bytes parent folder | download
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
#!/bin/sh

set -e

DEST=/usr/share/games/ale-clone/WarII
if [ "$1" = "configure" -a "$2" != "" ]; then
    # anything special to do on upgrades?

    # before 1.15pre16.3-1 stuff was in /usr/share/games/ale-clone/data.
    # move it.
    if dpkg --compare-versions "$2" lt "1.15pre16.3-1"; then
        mv /usr/share/games/ale-clone/data $DEST
    fi
elif [ "$1" = "configure" -a "$2" = "" ]; then
    echo "Where's a good place to grab the WarCraft II data?"
    echo
    echo "There are a couple of good options here:"
    echo "    - an original WarCraft II Expansion Set CD (recommended)"
    echo "    - an original WarCraft II CD"
    echo "    - an existing WarCraft II installation"
    echo
    echo "(WarCraft is a registered trademark of Blizzard Entertainment, and"
    echo " the WarCraft data that ALE Clone uses is owned by Blizzard. If you"
    echo " don't own a legal copy of WarCraft II, please support the free Clone"
    echo " Graphics Project instead of doing something illegal and annoying"
    echo " people. Visit http://http://www.honors.montana.edu/~jjc/clone/)"
    echo
    echo -n "Which is more convenient, CD (c) or existing install (i)? [Ci] "
    read cdinst

    if [ "$cdinst" = "i" -o "$cdinst" = "I" ]; then
        echo -n "Where is your existing WarCraft II install? [/dos/war2] "
        read SOURCE
        if [ "$SOURCE" = "" ]; then
            SOURCE="/dos/war2"
        fi
    else
        echo -n "Where is your CD device mounted? [/cdrom] "
        read SOURCE
        if [ "$SOURCE" = "" ]; then
            SOURCE="/cdrom"
        fi
    fi

    if [ ! -d "$SOURCE" ]; then
        echo "Oh dear, $SOURCE isn't a directory. Dying horribly."
        exit 1
    fi

    if [ -d "$DEST/campaigns" -o -d "$DEST/puds" -o -d "$DEST/sound" \
         -o -d "$DEST/text" ];
    then
        echo "Oh dear, ALE Clone datafiles already seem to be present in"
        echo "$DEST. Dying horribly."
        exit 1
    fi

    echo
    echo "Okay, all that seemed to work. Now for the tedious part of actually"
    echo "converting all the files. This'll take a few minutes, and produce"
    echo "lots and lots of output."
    echo
    echo -n "Please press enter to begin: " 
    read junk

    mkdir -p $DEST
    /usr/lib/ale-clone/tools/build.sh -p "$SOURCE" -o "$DEST"

    mkdir $DEST/ccl
    cp /usr/lib/ale-clone/ccl/* $DEST/ccl/

    echo 
    echo 'All done!'
fi

update-alternatives --quiet --install /usr/share/games/ale-clone/default \
			ale-clone-data $DEST 20

##DEBHELPER##