about summary refs log tree commit diff stats
path: root/upgrade.sh
blob: e2ed3d3b0b206b72ebed2b73a2ce7d6a14b97373 (plain) (blame)
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
#!/bin/sh

linux_upgrade()
{
    echo
    echo Profanity installer... upgrading Profanity
    echo
    ./bootstrap.sh
    ./configure
    make clean
    make
    sudo make install
    echo
    echo Profanity installer... upgrade complete!
    echo
    echo Type \'profanity\' to run.
    echo
}

cygwin_upgrade()
{
    echo
    echo Profanity installer... upgrading Profanity
    echo
    export LIBRARY_PATH=/usr/local/lib
    ./bootstrap.sh
    ./configure
    make clean
    make
    make install
    echo
    echo Profanity installer... upgrade complete!
    echo
    echo Type \'profanity\' to run.
    echo
}

OS=`uname -s`
SYSTEM=unknown

if [ "${OS}" = "Linux" ]; then
    SYSTEM=linux
else
    echo $OS | grep -i cygwin
    if [ "$?" -eq 0 ]; then
        SYSTEM=cygwin
    fi
fi

case "$SYSTEM" in
unknown)    echo The upgrade script will not work on this OS.
            echo Try a manual upgrade instead.
            exit
            ;;
linux)      linux_upgrade
            ;;
cygwin)     cygwin_upgrade
            ;;
esac