File: pingus-cvs-build

package info (click to toggle)
pingus 0.7.6-5.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 31,636 kB
  • sloc: cpp: 42,076; xml: 2,319; lisp: 521; ruby: 455; ansic: 365; objc: 248; sh: 247; makefile: 143; python: 15
file content (170 lines) | stat: -rwxr-xr-x 3,663 bytes parent folder | download | duplicates (10)
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#!/bin/sh

## Usage: pingus-cvs-build PREFIX
##
## Wannabe usage:
##
##   pingus-cvs-build --prefix="" --rebuild-hermes --skip-clanlib
##
## Todo: Build a GUI around this...

## Diskspace Usage:
##    Around: >900MB
##    
set -e

if [ ! $# -eq 1 ]; then
    echo "Usage: $0 PREFIX"
    exit 1;
fi

TARGET_DIRECTORY="$1"

echo -n "Do you want to compile and install pingus to '$TARGET_DIRECTORY'? [y/N] "

read answer
if [ ! "x$answer" = "xy" ]; then
    echo "abort"
    exit 0
fi

CVSROOT=':pserver:anonymous@cvs.clanlib.org:/var/lib/cvs'
export CVSROOT

echo "### Setting up environment variables."
LD_LIBRARY_PATH="$TARGET_DIRECTORY/lib/"
export LD_LIBRARY_PATH

LIBRARY_PATH="$TARGET_DIRECTORY/lib/"
export LIBRARY_PATH

LD_RUN_PATH="$TARGET_DIRECTORY/lib/"
export LD_RUN_PATH

PATH="$TARGET_DIRECTORY/bin:$PATH"
export PATH

CPLUS_INCLUDE_PATH="$TARGET_DIRECTORY/include/"
export CPLUS_INCLUDE_PATH

mkdir -p "$TARGET_DIRECTORY/src/"
cd "$TARGET_DIRECTORY/src/"


# FIXME: insert version check here
if [ ! -x "$TARGET_DIRECTORY/bin/autoconf" ]; then
    echo "### downloading new automake and autoconf"
    wget -c ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.57.tar.gz
    tar --extract --verbose --gzip --file  autoconf-2.57.tar.gz
    pushd autoconf-2.57
    ./configure --prefix="$TARGET_DIRECTORY"
    make
    make install
    popd
fi

# FIXME: insert version check here
if [ ! -x "$TARGET_DIRECTORY/bin/automake-1.7" ]; then
    wget -c ftp://ftp.gnu.org/gnu/automake/automake-1.7.3.tar.gz
    tar --extract --verbose  --gzip --file automake-1.7.3.tar.gz
    pushd automake-1.7.3
    ./configure --prefix="$TARGET_DIRECTORY"
    make
    make install
    popd
fi

if [ ! -x "$TARGET_DIRECTORY/bin/libtool" ]; then
    wget -c ftp://ftp.gnu.org/gnu/libtool/libtool-1.4.2.tar.gz
    tar --extract --verbose  --gzip --file libtool-1.4.2.tar.gz
    pushd libtool-1.4.2
    ./configure --prefix="$TARGET_DIRECTORY"
    make
    make install
    popd
fi

if [ ! -x "$TARGET_DIRECTORY/bin/gettext" ]; then
    wget -c ftp://ftp.gnu.org/gnu/gettext/gettext-0.11.2.tar.gz
    tar --extract --verbose  --gzip --file gettext-0.11.2.tar.gz
    pushd gettext-0.11.2
    ./configure --prefix="$TARGET_DIRECTORY"
    make
    make install
    popd
fi

echo "### We are now loging into CVS, just press return."
cvs login

#PS1="\[\033[1;32m\][=Pingus=:\w]\[\033[00m$\] "
#export PS1

cat > "$TARGET_DIRECTORY/start_pingus" <<EOF
#!/bin/sh

set -e

LD_LIBRARY_PATH="$TARGET_DIRECTORY/lib/"
export LD_LIBRARY_PATH

LIBRARY_PATH="$TARGET_DIRECTORY/lib/"
export LIBRARY_PATH

LD_RUN_PATH="$TARGET_DIRECTORY/lib/"
export LD_RUN_PATH

CPLUS_INCLUDE_PATH="$TARGET_DIRECTORY/include/"
export CPLUS_INCLUDE_PATH

cd games/
./pingus
EOF

chmod +x "$TARGET_DIRECTORY/start_pingus"

CXXFLAGS="-O2"
export CXXFLAGS


if [ ! -e  "$TARGET_DIRECTORY/include/Hermes/Hermes.h" ]; then
    cvs -z3 checkout Libs/Hermes-1.3
    echo "### We are now going to compile Hermes."
    pushd Libs/Hermes-1.3
    ./autogen.sh
    ./configure --prefix="$TARGET_DIRECTORY"
    make
    make install 
    popd
else
    echo "### Skipping Hermes, since already installed"
fi

cvs -z3 checkout Libs/ClanLib-0.6
echo "### We are now going to compile ClanLib."
pushd Libs/ClanLib-0.6
./autogen.sh
./configure --prefix="$TARGET_DIRECTORY"
make
make install 
popd


CXXFLAGS="-Wall -g"
export CXXFLAGS

cvs -z3 checkout Games/Pingus
echo "### We are now going to compile Pingus."
pushd Games/Pingus
./autogen.sh
./configure --prefix="$TARGET_DIRECTORY"
make
make install 
popd

echo "### You should now be able to start Pingus with:"
echo ""
echo "   cd $TARGET_DIRECTORY; ./start_pingus"
echo ""

# EOF #