forked from nexgen999/gbe_fork
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package_linux.sh
48 lines (41 loc) · 1.66 KB
/
package_linux.sh
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
#!/usr/bin/env bash
build_base_dir="build/linux"
out_dir="build/package/linux"
script_dir=$( cd -- "$( dirname -- "${0}" )" &> /dev/null && pwd )
[[ "$1" = '' ]] && {
echo "[X] missing build folder";
exit 1;
}
target_src_dir="$script_dir/$build_base_dir/$1"
[[ -d "$target_src_dir" ]] || {
echo "[X] build folder wasn't found";
exit 1;
}
# ::::::::::::::::::::::::::::::::::::::::::
echo "// copying readmes + example files"
cp -f -r "post_build/steam_settings.EXAMPLE/" "$target_src_dir/"
cp -f "post_build/README.release.md" "$target_src_dir/"
cp -f "CHANGELOG.md" "$target_src_dir/"
cp -f "CREDITS.md" "$target_src_dir/"
if [[ "$2" = "1" ]]; then
cp -f "post_build/README.debug.md" "$target_src_dir/"
fi
if [[ -d "$target_src_dir/experimental" ]]; then
cp -f "post_build/README.experimental_linux.md" "$target_src_dir/experimental/"
fi
if [[ -d "$target_src_dir/tools" ]]; then
mkdir -p "$target_src_dir/tools/steamclient_loader/"
cp -f -r tools/steamclient_loader/linux/* "$target_src_dir/tools/steamclient_loader/"
fi
if [[ -d "$target_src_dir/tools/generate_interfaces" ]]; then
cp -f "post_build/README.generate_interfaces.md" "$target_src_dir/tools/generate_interfaces/"
fi
if [[ -d "$target_src_dir/tools/lobby_connect" ]]; then
cp -f "post_build/README.lobby_connect.md" "$target_src_dir/tools/lobby_connect/"
fi
# ::::::::::::::::::::::::::::::::::::::::::
archive_dir="$script_dir/$out_dir/$1"
[[ -d "$archive_dir" ]] && rm -r -f "$archive_dir"
archive_file="$(dirname "$archive_dir")/emu-linux-$(basename "$archive_dir").tar.bz2"
mkdir -p "$(dirname "$archive_dir")"
tar -C "$(dirname "$target_src_dir")" -c -j -vf "$archive_file" "$(basename "$target_src_dir")"