summaryrefslogtreecommitdiff
path: root/build/chroot-server-build.sh
blob: 3cc5c8710cb32a74c656e50a90c8bdda964e1d92 (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
#!/bin/bash

export CHROOT="$1"
export NAME=lenny
export DSTCHDIR="$2"
export DSTDIR="$CHROOT$DSTCHDIR"
export SRCDIR="$DSTDIR/server-code"
export SRCPLUGINSDIR="$SRCDIR/src/evol/build/src/.libs/"
export LOCALDIR="../../server-local/bin"

echo Removing old files...
rm -rf "$DSTDIR"
mkdir "$DSTDIR"

echo Coping files...
cp -r ../../server-code "$DSTDIR/server-code"
cp -r ../../server-data "$DSTDIR/server-data"
cp -r ../../server-local "$DSTDIR/server-local"
cp -r ../../tools "$DSTDIR/tools"

echo Enter chroot...
schroot -c "$NAME" --directory "$DSTCHDIR/tools/build/" "server-bin.sh"

if [[ $? == 0 ]]; then
    cp "$SRCDIR/char-server" "$LOCALDIR"
    cp "$SRCDIR/login-server" "$LOCALDIR"
    cp "$SRCDIR/map-server" "$LOCALDIR"
    cp "$SRCDIR/mapcache" "$LOCALDIR"
    mkdir "$LOCALDIR/plugins/"
    cp "$SRCDIR/plugins"/*.so "$LOCALDIR/plugins/"
    cp -f "$SRCPLUGINSDIR"/*.so "$LOCALDIR/plugins/"
fi
echo Exit chroot...