summaryrefslogtreecommitdiff
path: root/build/chroot-server-build.sh
blob: 5704f5fa841b60e0ac122fc48cf20b5e954edccd (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
#!/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"

rm -rf "$DSTDIR"
mkdir "$DSTDIR"

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"

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