scripts:de-cluttering [skip ci]

make has an "install" feature. We'll figure out how to work with make
can cmake, and redo these scripts from scratch if necessary

(closes #155)
(closes #71)
(closes #154)
This commit is contained in:
andy5995
2018-09-07 11:36:58 -05:00
committed by Andy Alt
parent 656820714b
commit 64190969f4
22 changed files with 0 additions and 1579 deletions

View File

@@ -1,30 +0,0 @@
#!/bin/bash
# Use this script to build MegaGlest CodeBlocks project files from CMake
# ----------------------------------------------------------------------------
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
# Copyright (c) 2013 Mark Vejvoda under GNU GPL v3.0+
CURRENTDIR="$(dirname $(readlink -f $0))"
mkdir -p codeblocks
cd codeblocks
if [ -f 'CMakeCache.txt' ]; then rm -f 'CMakeCache.txt'; fi
LANG=C
NUMCORES=`lscpu -p | grep -cv '^#'`
if [ "$NUMCORES" = '' ]; then NUMCORES=1; fi
# This is for regular developers and used by our installer
cmake -G"CodeBlocks - Unix Makefiles" -DCMAKE_INSTALL_PREFIX= -DWANT_STATIC_LIBS=ON -DCMAKE_ECLIPSE_MAKE_ARGUMENTS=-j$NUMCORES ${CURRENTDIR}/../../
if [ $? -ne 0 ]; then
echo 'ERROR: CMAKE failed.' >&2; exit 1
fi
cd ${CURRENTDIR}
echo ''
echo '*** CodeBlocks Project files [MegaGlest.cbp] can be opened from the folder: [codeblocks]'
echo 'detected and using: ' $NUMCORES ' cores...'
echo 'Browse where your build tree is ['${CURRENTDIR}'/codeblocks] and select the project.'
echo 'You get a fully functional CodeBlocks project'
echo ''
ls -la codeblocks

View File

@@ -1,33 +0,0 @@
#!/bin/bash
# Use this script to build MegaGlest Eclipse project files from CMake
# ----------------------------------------------------------------------------
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
# Copyright (c) 2011 Mark Vejvoda under GNU GPL v3.0+
CURRENTDIR="$(dirname $(readlink -f $0))"
mkdir -p eclipse
cd eclipse
if [ -f 'CMakeCache.txt' ]; then rm -f 'CMakeCache.txt'; fi
LANG=C
NUMCORES=`lscpu -p | grep -cv '^#'`
if [ "$NUMCORES" = '' ]; then NUMCORES=1; fi
# This is for regular developers and used by our installer
cmake -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_INSTALL_PREFIX= -DWANT_STATIC_LIBS=ON -DCMAKE_ECLIPSE_MAKE_ARGUMENTS=-j$NUMCORES ${CURRENTDIR}/../../
if [ $? -ne 0 ]; then
echo 'ERROR: CMAKE failed.' >&2; exit 1
fi
cd ${CURRENTDIR}
echo ''
echo '*** Eclipse Project files [.project and .cproject] can be imported from the folder: [eclipse]'
echo 'detected and using: ' $NUMCORES ' cores...'
echo 'Import the created project using Menu File->Import'
echo 'Select General->Existing projects into workspace:'
echo 'Browse where your build tree is ['${CURRENTDIR}'/eclipse] and select the directory.'
echo 'Keep "Copy projects into workspace" unchecked.'
echo 'You get a fully functional eclipse project'
echo ''
ls -la eclipse

View File

@@ -1,38 +0,0 @@
#!/bin/sh
#
# Use this script to compile using mingw compiler (experimental script)
# ----------------------------------------------------------------------------
# Originally written by Mark Vejvoda <mark_vejvoda@hotmail.com>
# Copyright (c) 2012 Mark Vejvoda under GNU GPL v3.0
NUMCORES=`lscpu -p | grep -cv '^#'`
if [ "$NUMCORES" = '' ]; then NUMCORES=1; fi
#PROJECT_SOURCE_DIR="$(dirname $(readlink -f $0))"
mkdir -p build-win32
cd build-win32
cmake -DCMAKE_TOOLCHAIN_FILE=../../mk/cmake/Modules/Toolchain-mingw32.cmake -DXERCESC_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/xerces-c-src_2_8_0/include -DXERCESC_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/xerces-c-src_2_8_0/lib -DXERCESC_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/xerces-c-src_2_8_0/lib/libxerces-c2_8_0.dll -DOPENAL_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/openal-soft-1.12.854 -DOPENAL_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/OpenAL32.dll -DOGG_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/libogg-1.2.1/include -DOGG_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/libogg.dll -DVORBIS_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/libvorbis.dll -DVORBIS_FILE_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/libvorbisfile.dll -DLUA_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/lua-5.1/src -DLUA_LIBRARIES=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/lua5.1.dll -DJPEG_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/jpeg-8b -DJPEG_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/libjpeg.dll -DZLIB_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/zlib-1.2.5 -DZLIB_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/libz.a -DPNG_PNG_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/lpng141 -DPNG_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/libpng.dll -DCURL_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/curl-7.21.3/include -DCURL_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/libcurl.dll -DSDL_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/SDL-1.2.x/include -DFREETYPE_INCLUDE_DIR_ft2build=${PROJECT_SOURCE_DIR}/source/win32_deps/freetype-2.4.8/include -DFREETYPE_INCLUDE_DIR_freetype2=${PROJECT_SOURCE_DIR}/source/win32_deps/freetype-2.4.8/include/freetype -DFREETYPE_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/libfreetype-6.dll -DFTGL_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/ftgl-2.1.3~rc5/src -DFTGL_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/libftgl.a -DGLEW_INCLUDE_PATH=${PROJECT_SOURCE_DIR}/source/win32_deps/glew-1.7.0/include -DGLEW_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/glew32.dll -DCMAKE_INSTALL_PREFIX= -DWANT_STATIC_LIBS=ON -DHAS_SSE_EXTENSION=ON ..
make -j$NUMCORES
#echo 'You may now launch mega-glest from this folder like this:'
#echo '../mk/linux/glest.bin --ini-path=../mk/linux/ --data-path=../mk/linux/'
echo 'Copying mingw dependencies if they are missing...'
[[ -f "data/glest_game/lua51.dll" ]] && cp source/win32_deps/lib/lua5.1.dll data/glest_game/lua51.dll
[[ -f "data/glest_game/libcurl-4.dll" ]] && cp source/win32_deps/curl-7.21.3/lib/.libs/libcurl-4.dll data/glest_game/libcurl-4.dll
[[ -f "data/glest_game/libxerces-c2_8_0.dll" ]] && cp source/win32_deps/xerces-c-src_2_8_0/lib/libxerces-c2_8_0.dll data/glest_game/libxerces-c2_8_0.dll
[[ -f "data/glest_game/libpng14.dll" ]] && cp source/win32_deps/lpng141/libpng14.dll data/glest_game/libpng14.dll
[[ -f "data/glest_game/libjpeg-8.dll" ]] && cp source/win32_deps/lib/libjpeg.dll data/glest_game/libjpeg-8.dll
[[ -f "data/glest_game/libvorbisfile-3.dll" ]] && cp source/win32_deps/lib/libvorbisfile.dll data/glest_game/libvorbisfile-3.dll
[[ -f "data/glest_game/libvorbis-0.dll" ]] && cp source/win32_deps/lib/libvorbis.dll data/glest_game/libvorbis-0.dll
[[ -f "data/glest_game/libogg-0.dll" ]] && cp source/win32_deps/lib/libogg.dll data/glest_game/libogg-0.dll
[[ -f "data/glest_game/OpenAL32.dll" ]] && cp source/win32_deps/lib/OpenAL32.dll data/glest_game/OpenAL32.dll
[[ -f "data/glest_game/SDLmain.dll" ]] && cp source/win32_deps/lib/SDLmain.dll data/glest_game/SDLmain.dll
[[ -f "data/glest_game/SDL.dll" ]] && cp source/win32_deps/lib/SDL.dll data/glest_game/SDL.dll
[[ -f "data/glest_game/wxmsw28u_gcc_custom.dll" ]] && cp source/win32_deps/wxWidgets-2.8.10/lib/wxmsw28u_gcc_custom.dll data/glest_game/wxmsw28u_gcc_custom.dll
[[ -f "data/glest_game/wxmsw28u_gl_gcc_custom.dll" ]] && cp source/win32_deps/wxWidgets-2.8.10/lib/wxmsw28u_gl_gcc_custom.dll data/glest_game/wxmsw28u_gl_gcc_custom.dll
[[ -f "data/glest_game/zlib.dll" ]] && cp source/win32_deps/lib/zlib.dll data/glest_game/zlib.dll
[[ -f "data/glest_game/mingwm10.dll" ]] && cp /usr/share/doc/mingw32-runtime/mingwm10.dll data/glest_game/mingwm10.dll

View File

@@ -1,222 +0,0 @@
#!/bin/bash
# Use this script to build ZetaGlest Binary Archive for a Version Release
# ----------------------------------------------------------------------------
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
# Copyright (c) 2011 Mark Vejvoda under GNU GPL v3.0+
LANG=C
CURRENTDIR="$(dirname "$(readlink -f "$0")")"
# set this to non 0 to skip building the binary
skipbinarybuild=0
if [ "$1" = "-CI" ] || ( [ "$1" = "--installer" ] && \
[ "$(find "$CURRENTDIR" -maxdepth 1 -name 'zetaglest' -mmin -60)" ] ); then
skipbinarybuild=1
fi
# Consider setting this for small packages if there's plenty of RAM and CPU available:
#export XZ_OPT="$XZ_OPT -9e"
if [ "$1" = "-CI" ] || [ "$1" = "--installer" ] || [ "$(echo "$1" | grep '\--show-result-path')" != "" ]; then
if [ "$2" != "" ]; then SOURCE_BRANCH="$2"; fi
fi
cd "$CURRENTDIR"
VERSION=`./mg-version.sh --version`
kernel=`uname -s | tr '[A-Z]' '[a-z]'`
architecture=`uname -m | tr '[A-Z]' '[a-z]'`
RELEASEDIR_ROOT="$CURRENTDIR/../../../release/"
PROJDIR="$CURRENTDIR/"
REPODIR="$CURRENTDIR/../.."
REPO_DATADIR="$REPODIR/../zetaglest-data"
if [ -d "$REPODIR/.git" ] && [ "$(which git 2>/dev/null)" != "" ]; then
cd "$REPODIR"
if [ "$SOURCE_BRANCH" = "" ]; then SOURCE_BRANCH="$(git branch | awk -F '* ' '/^* / {print $2}')"; fi
SOURCE_COMMIT="$(echo "[$(git rev-list HEAD --count).$(git log -1 --format=%h --abbrev=7)]")"
fi
ARCHIVE_TYPE="tar.xz"
SNAPSHOTNAME="mg-binary-$kernel-$architecture"
SN_PACKAGE="$SNAPSHOTNAME-$VERSION-$SOURCE_BRANCH.$ARCHIVE_TYPE"
RELEASENAME="zetaglest-binary-$kernel-$architecture"
PACKAGE="$RELEASENAME-$VERSION.$ARCHIVE_TYPE"
if [ "$SOURCE_BRANCH" != "" ] && [ "$SOURCE_BRANCH" != "master" ] && [ "$(echo "$VERSION" | grep '\-dev$')" != "" ]; then
RELEASENAME="$SNAPSHOTNAME"; PACKAGE="$SN_PACKAGE"
fi
RELEASEDIR="${RELEASEDIR_ROOT}/${RELEASENAME-$VERSION}"
if [ "$1" = "--show-result-path" ]; then echo "${RELEASEDIR_ROOT}/$PACKAGE"; exit 0
elif [ "$1" = "--show-result-path2" ]; then echo "${RELEASEDIR_ROOT}/$RELEASENAME"; exit 0; fi
echo "Creating binary package in $RELEASEDIR"
if [ "$SOURCE_BRANCH" != "" ]; then echo "Detected parameters for source repository: branch=[$SOURCE_BRANCH], commit=$SOURCE_COMMIT"; fi
[[ -d "$RELEASEDIR" ]] && rm -rf "$RELEASEDIR"
mkdir -p "$RELEASEDIR"
if [ $skipbinarybuild = 0 ]
then
# build the binaries
echo "building binaries ..."
cd $PROJDIR
[[ -d "build" ]] && rm -rf "build"
./build-zg.sh
if [ $? -ne 0 ]; then
echo 'ERROR: "./build-zg.sh" failed.' >&2; exit 1
fi
else
echo "SKIPPING build of binaries ..."
fi
cd $PROJDIR
mkdir -p "$RELEASEDIR/lib"
if [ -d "lib" ]; then rm -rf "lib"; fi
echo "building binary dependencies ..."
for zg_bin in zetaglest zetaglest_editor zetaglest_g3dviewer; do
./makedeps_folder.sh "$zg_bin"
if [ "$?" -ne "0" ]; then echo "ERROR: \"./makedeps_folder.sh $zg_bin\" failed." >&2; exit 2; fi
done
# copy binary info
cd $PROJDIR
echo "copying binaries ..."
cp -r lib/* "$RELEASEDIR/lib"
if [ $? != 0 ]; then
exit $?
fi
cp ../shared/*.ico {../shared/,}*.ini "$RELEASEDIR/"
if [ $? != 0 ]; then
exit $?
fi
if [ -e "$RELEASEDIR/glest-dev.ini" ]; then
rm -f "$RELEASEDIR/glest-dev.ini"
if [ $? != 0 ]; then
exit $?
fi
fi
cd $REPO_DATADIR/others/icons
if [ $? != 0 ]; then
exit $?
fi
cp *.bmp *.png *.xpm "$RELEASEDIR/"
if [ $? != 0 ]; then
exit $?
fi
if [ "$1" != "--installer" ]; then
cd $REPO_DATADIR/others/desktop
if [ $? != 0 ]; then
exit $?
fi
cp *.desktop "$RELEASEDIR/"
if [ $? != 0 ]; then
exit $?
fi
fi
cd $PROJDIR
if [ $? != 0 ]; then
exit $?
fi
cp zetaglest zetaglest_editor zetaglest_g3dviewer start_zetaglest_gameserver "$RELEASEDIR/"
if [ $? != 0 ]; then
exit $?
fi
cd "$CURRENTDIR/tools-for-standalone-client"
if [ $? != 0 ]; then
exit $?
fi
cp start_zetaglest start_zetaglest_mapeditor start_zetaglest_g3dviewer "$RELEASEDIR/"
if [ $? != 0 ]; then
exit $?
fi
if [ "$1" != "--installer" ]; then
cp zetaglest-configure-desktop.sh "$RELEASEDIR/"
if [ $? != 0 ]; then
exit $?
fi
fi
if [ "$(echo "$VERSION" | grep -v '\-dev$')" != "" ]; then
./prepare-mini-update.sh --only_script; sleep 0.5s
cp zetaglest-mini-update.sh "$RELEASEDIR/"
if [ $? != 0 ]; then
exit $?
fi
if [ -e "zetaglest-mini-update.sh" ]; then
rm -f "zetaglest-mini-update.sh"
if [ $? != 0 ]; then
exit $?
fi
fi
cd $CURRENTDIR
if [ -e "zetaglest" ] && [ "$1" != "--installer" ]; then
ldd_log="$(echo "$VERSION - $kernel - $architecture - $(date +%F)")"
ldd_log="$(echo -e "$ldd_log\n\nzetaglest:\n$(ldd zetaglest | awk '{print $1}')")"
if [ -e "zetaglest_editor" ]; then
ldd_log="$(echo -e "$ldd_log\n\nzetaglest_editor:\n$(ldd zetaglest_editor | awk '{print $1}')")"
fi
if [ -e "zetaglest_g3dviewer" ]; then
ldd_log="$(echo -e "$ldd_log\n\nzetaglest_g3dviewer:\n$(ldd zetaglest_g3dviewer | awk '{print $1}')")"
fi
echo "$ldd_log" > "$RELEASEDIR/ldd-zetaglest.log"
fi
echo "$(date -u)" > "$RELEASEDIR/build-time.log"
fi
mkdir -p "$RELEASEDIR/blender/"
if [ $? != 0 ]; then
exit $?
fi
cp "$CURRENTDIR/../../source/tools/glexemel/"*.py "$RELEASEDIR/blender/"
if [ $? != 0 ]; then
exit $?
fi
if [ "$1" != "--installer" ]; then
echo "creating $PACKAGE"
cd $CURRENTDIR
if [ $? != 0 ]; then
exit $?
fi
[[ -f "${RELEASEDIR_ROOT}/$PACKAGE" ]] && rm -f "${RELEASEDIR_ROOT}/$PACKAGE"
cd $RELEASEDIR
if [ $? != 0 ]; then
exit $?
fi
tar -cf - * | xz > ../$PACKAGE
if [ $? != 0 ]; then
exit $?
fi
cd $CURRENTDIR
if [ $? != 0 ]; then
exit $?
fi
ls -la ${RELEASEDIR_ROOT}/$PACKAGE
if [ $? != 0 ]; then
exit $?
fi
fi
if [ "$1" = "-CI" ] && [ -d "$RELEASEDIR" ]; then
rm -rf "$RELEASEDIR"
if [ $? != 0 ]; then
exit $?
fi
fi

View File

@@ -1,157 +0,0 @@
#!/bin/bash
# Use this script to build MegaGlest Data Archive for a Version Release
# (Data archive for 'snapshots', with embedded content)
# ----------------------------------------------------------------------------
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
# Copyright (c) 2011 Mark Vejvoda under GNU GPL v3.0+
# Consider setting this for small packages if there's plenty of RAM and CPU available:
#export XZ_OPT="$XZ_OPT -9e"
KERNEL="$(uname -s | tr '[A-Z]' '[a-z]')"
if [ "$KERNEL" = "darwin" ]; then
CURRENTDIR="$(cd "$(dirname "$0")"; pwd)"
else
CURRENTDIR="$(dirname "$(readlink -f "$0")")"
fi
cd "$CURRENTDIR"
if [ "$1" != "" ] && [ "$2" != "" ]; then SOURCE_BRANCH="$2"; fi
VERSION=`./mg-version.sh --version`
REPODIR="$CURRENTDIR/../../"
REPO_DATADIR="$REPODIR/../zetaglest-data"
if [ -f "$REPO_DATADIR/.git" ] && [ "$(which git 2>/dev/null)" != "" ]; then
cd "$REPO_DATADIR"
DATA_BRANCH="$(git branch | grep '^* ' | awk '{print $2}')"
# on macos are problems with more advanced using awk ^
DATA_COMMIT_NR="$(git rev-list HEAD --count)"
DATA_COMMIT="$(echo "[$DATA_COMMIT_NR.$(git log -1 --format=%h --abbrev=7)]")"
DATA_HASH=$(git log -1 --format=%H)
fi
if [ -d "$REPODIR/.git" ] && [ "$(which git 2>/dev/null)" != "" ]; then
cd "$REPODIR"
if [ "$SOURCE_BRANCH" = "" ]; then SOURCE_BRANCH="$(git branch | grep '^* ' | awk '{print $2}')"; fi
# on macos are problems with more advanced using awk ^
SOURCE_COMMIT="$(echo "[$(git rev-list HEAD --count).$(git log -1 --format=%h --abbrev=7)]")"
if [ "$DATA_HASH" = "" ]; then DATA_HASH=$(git submodule status "$REPO_DATADIR" | awk '{print $1}'); fi
fi
classic_snapshot_for_tests=0
if [ "$SOURCE_BRANCH" != "" ] && [ "$SOURCE_BRANCH" != "master" ] && [ "$(echo "$VERSION" | grep '\-dev$')" != "" ]; then
classic_snapshot_for_tests=1
fi
if [ "$classic_snapshot_for_tests" -eq "1" ]; then ARCHIVE_TYPE="7z"; else ARCHIVE_TYPE="tar.xz"; fi
SNAPSHOTNAME="mg-data-universal"
SN_PACKAGE="$SNAPSHOTNAME-$VERSION-$SOURCE_BRANCH.$ARCHIVE_TYPE"
RELEASENAME="megaglest-standalone-data"
PACKAGE="$RELEASENAME-$VERSION.$ARCHIVE_TYPE"
RELEASEDIR_ROOT="$CURRENTDIR/../../../release"
if [ "$classic_snapshot_for_tests" -eq "1" ]; then RELEASENAME="$SNAPSHOTNAME"; PACKAGE="$SN_PACKAGE"; fi
RELEASEDIR="${RELEASEDIR_ROOT}/${RELEASENAME-$VERSION}"
if [ "$1" = "--show-result-path" ]; then echo "${RELEASEDIR_ROOT}/$PACKAGE"; exit 0
elif [ "$1" = "--show-result-path2" ]; then echo "${RELEASEDIR_ROOT}/$RELEASENAME"; exit 0; fi
DATA_HASH_MEMORY="$RELEASEDIR_ROOT/data_memory"
DATA_HASH_FILE="$DATA_HASH_MEMORY/$VERSION-$SOURCE_BRANCH.log"
if [ ! -d "$DATA_HASH_MEMORY" ]; then mkdir -p "$DATA_HASH_MEMORY"; fi
SyncNote() {
echo; echo " This situation is allowed for \"git submodule\", but in MG case it usually mean sync to wrong data commit. In case of wrong sync, to fix the situation someone should again commit in the megaglest-source repo the recent data HASH. If sync to older data wasn't a mistake then just ignore this warning."; echo
}
if [ "$DATA_HASH" != "" ]; then
if [ -e "$DATA_HASH_FILE" ]; then
CAT_DATA_HASH_FILE="$(cat "$DATA_HASH_FILE" | head -1)"
DATA_COMMIT_PREV_NR="$(echo "$CAT_DATA_HASH_FILE" | awk '{print $2}')"
DATA_COMMIT_LATEST_NR="$(echo "$CAT_DATA_HASH_FILE" | awk '{print $3}')"
else
echo "$DATA_HASH $DATA_COMMIT_NR $DATA_COMMIT_NR" > "$DATA_HASH_FILE"
fi
if [ -e "$DATA_HASH_FILE" ] && [ "$DATA_COMMIT_PREV_NR" != "" ]; then
if [ "$DATA_COMMIT_NR" -lt "$DATA_COMMIT_PREV_NR" ]; then
echo; echo " warning: Detected older git revision of data than previously, $DATA_COMMIT_NR < $DATA_COMMIT_PREV_NR."
SyncNote
else
if [ "$DATA_COMMIT_LATEST_NR" != "" ] && [ "$DATA_COMMIT_NR" -lt "$DATA_COMMIT_LATEST_NR" ]; then
echo; echo " warning: Detected older git revision of data than synced in the past, $DATA_COMMIT_NR < $DATA_COMMIT_LATEST_NR."
SyncNote
if [ "$DATA_COMMIT_NR" -gt "$DATA_COMMIT_PREV_NR" ]; then DATA_COMMIT_LATEST_NR="$DATA_COMMIT_NR"; fi
# ^ first sync commit -gt than the wrong one = warning seen for last time, so situation still may be not fixed, but is most likely improved and we avoid endless warnings
fi
if [ "$1" != "--installer" ] && [ "$(echo "$CAT_DATA_HASH_FILE" | grep "$DATA_HASH")" != "" ]; then
echo; echo " NOTE: The archive wasn't created because for almost sure it would be exactly the same like last time (the same commit) and new creation date would convince many users to download it again."; echo
exit 0
fi
fi
if [ "$DATA_COMMIT_LATEST_NR" = "" ] || [ "$DATA_COMMIT_NR" -gt "$DATA_COMMIT_LATEST_NR" ]; then
DATA_COMMIT_LATEST_NR="$DATA_COMMIT_NR"
fi
echo "$DATA_HASH $DATA_COMMIT_NR $DATA_COMMIT_LATEST_NR" > "$DATA_HASH_FILE"
fi
fi
cd "$CURRENTDIR"
if [ "$DATA_BRANCH" != "" ]; then echo "Detected parameters for data repository: branch=[$DATA_BRANCH], commit=$DATA_COMMIT"; fi
if [ "$SOURCE_BRANCH" != "" ]; then echo "Detected parameters for source repository: branch=[$SOURCE_BRANCH], commit=$SOURCE_COMMIT"; fi
if [ "$1" != "--installer" ]; then echo "Creating data package in $RELEASEDIR"; else echo "Creating data directory $RELEASEDIR"; fi
[[ -d "$RELEASEDIR" ]] && rm -rf "$RELEASEDIR"
mkdir -p "$RELEASEDIR"
# copy data
echo "copying data ..."
mkdir -p "$RELEASEDIR/data/"
cd "$RELEASEDIR/data/"
git archive --remote ${REPODIR}/data/glest_game/ HEAD:data | tar x
cd "$RELEASEDIR"
mkdir -p "$RELEASEDIR/docs/"
cd "$RELEASEDIR/docs/"
git archive --remote ${REPODIR}/data/glest_game/ HEAD:docs | tar x
git archive --remote ${REPODIR} HEAD:docs | tar x
cd "$RELEASEDIR"
mkdir -p "$RELEASEDIR/maps/"
cd "$RELEASEDIR/maps/"
git archive --remote ${REPODIR}/data/glest_game/ HEAD:maps | tar x
cd "$RELEASEDIR"
mkdir -p "$RELEASEDIR/scenarios/"
cd "$RELEASEDIR/scenarios/"
git archive --remote ${REPODIR}/data/glest_game/ HEAD:scenarios | tar x
cd "$RELEASEDIR"
mkdir -p "$RELEASEDIR/techs/"
cd "$RELEASEDIR/techs/"
git archive --remote ${REPODIR}/data/glest_game/ HEAD:techs | tar x
cd "$RELEASEDIR"
mkdir -p "$RELEASEDIR/tilesets/"
cd "$RELEASEDIR/tilesets/"
git archive --remote ${REPODIR}/data/glest_game/ HEAD:tilesets | tar x
cd "$RELEASEDIR"
mkdir -p "$RELEASEDIR/tutorials/"
cd "$RELEASEDIR/tutorials/"
git archive --remote ${REPODIR}/data/glest_game/ HEAD:tutorials | tar x
echo "Removing non required files ..."
cd "$CURRENTDIR"
# START
# END
cd "$CURRENTDIR"
if [ "$1" != "--installer" ]; then
echo "creating data archive: $PACKAGE"
[[ -f "${RELEASEDIR_ROOT}/$PACKAGE" ]] && rm "${RELEASEDIR_ROOT}/$PACKAGE"
cd $RELEASEDIR
if [ "$ARCHIVE_TYPE" = "7z" ] && [ "$(which 7za 2>/dev/null)" != "" ]; then
cd ..
7za a "$PACKAGE" "$RELEASEDIR" >/dev/null
else
tar -cf - * | xz > ../$PACKAGE
fi
cd $CURRENTDIR
ls -la ${RELEASEDIR_ROOT}/$PACKAGE
fi
if [ "$1" = "-CI" ] && [ -d "$RELEASEDIR" ]; then rm -rf "$RELEASEDIR"; fi

View File

@@ -1,108 +0,0 @@
#!/bin/bash
# Use this script to build MegaGlest Data Diff Archive for a Version Release
# ----------------------------------------------------------------------------
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
# Copyright (c) 2011 Mark Vejvoda under GNU GPL v3.0+
# This script compares two mega-glest data content folders for file differences,
# then creates an archive of ONLY the differences (including files ONLY in new version)
# Consider setting this for small packages if there's plenty of RAM and CPU available:
#export XZ_OPT="$XZ_OPT -9e"
OLD_VERSION=`./mg-version.sh --oldversion`
VERSION=`./mg-version.sh --version`
NEW_SUBFOLDER_PATH="megaglest-$VERSION"
CURRENTDIR="$(dirname $(readlink -f $0))"
RELEASEDIR_ROOT="$CURRENTDIR/../../../release/"
cd $RELEASEDIR_ROOT
CURDIR=$RELEASEDIR_ROOT
cd $CURRENTDIR
RELEASENAME=megaglest-data-updates-$VERSION
cd $CURDIR
echo "Creating data package $RELEASENAME (comparing against $OLD_VERSION)"
#if [ ! -e megaglest-data-$VERSION-changes.txt ]; then
diff --strip-trailing-cr --brief -r -x "*~" megaglest-data-$OLD_VERSION/megaglest-$OLD_VERSION megaglest-data-$VERSION/megaglest-$VERSION > megaglest-data-$VERSION-changes.txt
#fi
cd megaglest-data-$VERSION
[[ -f "../megaglest-data-$VERSION-fileslist.txt" ]] && rm "../megaglest-data-$VERSION-fileslist.txt"
cat ../megaglest-data-$VERSION-changes.txt | while read line;
do
#echo "$line" # Output the line itself.
#echo `expr match "$line" 'megaglest-data-$VERSION'`
#addfilepos=`expr match "$line" 'megaglest-data-$VERSION'`
#echo [$line]
#echo `awk "BEGIN {print index(\"$line\", \"megaglest-data-$VERSION\")}"`
addfilepos=`awk "BEGIN {print index(\"$line\", \"megaglest-data-$VERSION\")}"`
#echo [$addfilepos]
#echo [${line:$addfilepos-1}]
#echo [Looking for ONLY in: `expr match "$line" 'Only in '`]
onlyinpos=`expr match "$line" "Only in "`
#echo [$onlyinpos]
if [ "$onlyinpos" -eq "8" ]; then
echo **NOTE: Found ONLY IN string... original line [${line}]
onlyinpos=`expr match "$line" "Only in megaglest-data-$VERSION"`
if [ "$onlyinpos" -ge "24" ]; then
line=${line:$addfilepos-1}
line=${line/: //}
line=${line/megaglest-data-$VERSION\/}
echo New path: [$line]
else
echo **NOTE: skipping file since it is not in current version [${line}] match [$onlyinpos]
line=
echo New path: [$line]
fi
else
echo Section B ... original line [${line}]
line=${line:$addfilepos-1}
line=${line/ differ/}
line=${line/megaglest-data-$VERSION\/}
echo New path: [$line]
fi
#compress_files="${compress_files} ${line}"
#echo compress_files = [$compress_files]
#echo ${line##megaglest-data-$VERSION*}
if [ -n "${line}" ]; then
echo "${line} " >> ../megaglest-data-$VERSION-fileslist.txt
fi
done
#exit
files_list=`cat ../megaglest-data-$VERSION-fileslist.txt`
#echo compress_files = [$files_list]
[[ -f "../$RELEASENAME.tar.xz" ]] && rm "../$RELEASENAME.tar.xz"
echo Current Folder is [`pwd`]
#echo 7za a "../$RELEASENAME.7z" $files_list
#7za a -mx=9 -ms=on -mhc=on "../$RELEASENAME.7z" $files_list
tar -cf - --add-file $files_list | xz > ../$RELEASENAME.tar.xz
cd $CURRENTDIR

View File

@@ -1,53 +0,0 @@
#!/bin/bash
# Use this script to build MegaGlest Data Source Archive for a Version Release
# (Archive for 'third' repository)
# ----------------------------------------------------------------------------
# 2011 Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
# 2015 Improved by filux <heross(@@)o2.pl>
# Copyright (c) 2011-2015 under GNU GPL v3.0+
# Consider setting this for small packages if there's plenty of RAM and CPU available:
#export XZ_OPT="$XZ_OPT -9e"
VERSION=`./mg-version.sh --version`
RELEASENAME=megaglest-data-source
PACKAGE="$RELEASENAME-$VERSION.tar.xz"
CURRENTDIR="$(dirname $(readlink -f $0))"
RELEASEDIR_ROOT="$CURRENTDIR/../../../release"
RELEASEDIR="$RELEASEDIR_ROOT/$RELEASENAME-$VERSION/megaglest-$VERSION"
SOURCEDIR="$CURRENTDIR/../../source/"
# Below we assume you have the data source contents root in a folder called: megaglest-data-source/
REPODIR="$(readlink -f "$CURRENTDIR/../../../megaglest-data-source/")"
echo "Creating data package in $RELEASEDIR"
[[ -d "$RELEASEDIR" ]] && rm -rf "$RELEASEDIR"
mkdir -p "$RELEASEDIR"
if [ ! -d "$REPODIR" ]; then
echo "ERROR: directory not found: $REPODIR"
exit 1
fi
cd "$REPODIR"
CURRENTCOMMIT="$(git rev-parse HEAD 2>/dev/null)"
if [ "$CURRENTCOMMIT" = "" ] && [ "$(git rev-parse HEAD)" != "" ]; then
echo "ERROR: git is not installed or git repository not found in: $REPODIR"
exit 1
fi
WANTEDCOMMIT="$(git show-ref --tags -d | grep "refs/tags/$VERSION" | awk '{print $1}')"
if [ "$WANTEDCOMMIT" != "$CURRENTCOMMIT" ]; then
echo "*NOTE: This script currently only works on the matching commit to the release's tag, aborting!"
echo "**Hints: Maybe tag is not set yet, or maybe e.g. you are in wrong branch."
exit 1
fi
# copy data
mkdir -p "$RELEASEDIR/data-source"
cd "$RELEASEDIR/data-source"
git archive --remote ${REPODIR}/ HEAD: | tar x
cd "$CURRENTDIR"
echo "creating $PACKAGE"
[[ -f "$RELEASEDIR_ROOT/$PACKAGE" ]] && rm "$RELEASEDIR_ROOT/$PACKAGE"
tar -cf - -C "$RELEASEDIR_ROOT/$RELEASENAME-$VERSION/" "megaglest-$VERSION" | xz > $RELEASEDIR_ROOT/$PACKAGE
ls -la $RELEASEDIR_ROOT/$PACKAGE

View File

@@ -1,97 +0,0 @@
#!/bin/bash
# Use this script to build MegaGlest Data Archive for a Version Release
# (Data archive for 'make install', without embedded content)
# ----------------------------------------------------------------------------
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
# Copyright (c) 2011 Mark Vejvoda under GNU GPL v3.0+
# Consider setting this for small packages if there's plenty of RAM and CPU available:
#export XZ_OPT="$XZ_OPT -9e"
VERSION=`./mg-version.sh --version`
RELEASENAME=megaglest-data
PACKAGE="$RELEASENAME-$VERSION.tar.xz"
CURRENTDIR="$(dirname $(readlink -f $0))"
RELEASEDIR_ROOT="$CURRENTDIR/../../../release"
RELEASEDIR="$RELEASEDIR_ROOT/$RELEASENAME-$VERSION/megaglest-$VERSION"
SOURCEDIR="$CURRENTDIR/../../source/"
REPODIR="$CURRENTDIR/../../"
echo "Creating data package in $RELEASEDIR"
[[ -d "$RELEASEDIR" ]] && rm -rf "$RELEASEDIR"
mkdir -p "$RELEASEDIR"
# copy data
echo "Exporting image and ini files ..."
cd "$RELEASEDIR"
git archive --remote ${REPODIR}/data/glest_game/ HEAD: CMakeLists.txt | tar x
echo "Exporting game data files ..."
cd "$RELEASEDIR"
mkdir -p "$RELEASEDIR/data/"
cd "$RELEASEDIR/data/"
git archive --remote ${REPODIR}/data/glest_game/ HEAD:data | tar x
echo "Exporting doc files ..."
cd "$RELEASEDIR"
mkdir -p "$RELEASEDIR/docs/"
cd "$RELEASEDIR/docs/"
git archive --remote ${REPODIR}/data/glest_game/ HEAD:docs | tar x
cd "$RELEASEDIR/docs/"
git archive --remote ${REPODIR} HEAD:docs/ CHANGELOG.txt | tar x
cd "$RELEASEDIR/docs/"
git archive --remote ${REPODIR} HEAD:docs/ README.txt | tar x
echo "Exporting map files ..."
cd "$RELEASEDIR"
mkdir -p "$RELEASEDIR/maps/"
cd "$RELEASEDIR/maps/"
git archive --remote ${REPODIR}/data/glest_game/ HEAD:maps | tar x
echo "Exporting scenario files ..."
cd "$RELEASEDIR"
mkdir -p "$RELEASEDIR/scenarios/"
cd "$RELEASEDIR/scenarios/"
git archive --remote ${REPODIR}/data/glest_game/ HEAD:scenarios | tar x
echo "Exporting tech files ..."
cd "$RELEASEDIR"
mkdir -p "$RELEASEDIR/techs/"
cd "$RELEASEDIR/techs/"
git archive --remote ${REPODIR}/data/glest_game/ HEAD:techs | tar x
echo "Exporting tileset files ..."
cd "$RELEASEDIR"
mkdir -p "$RELEASEDIR/tilesets/"
cd "$RELEASEDIR/tilesets/"
git archive --remote ${REPODIR}/data/glest_game/ HEAD:tilesets | tar x
echo "Exporting tutorial files ..."
cd "$RELEASEDIR"
mkdir -p "$RELEASEDIR/tutorials/"
cd "$RELEASEDIR/tutorials/"
git archive --remote ${REPODIR}/data/glest_game/ HEAD:tutorials | tar x
echo "Exporting files from 'others' directory ..."
cd "$RELEASEDIR"
mkdir -p "$RELEASEDIR/others/"
cd "$RELEASEDIR/others/"
git archive --remote ${REPODIR}/data/glest_game/ HEAD:others | tar x
echo "Removing non required files ..."
cd "$CURRENTDIR"
# START
# remove embedded data
rm -rf "$RELEASEDIR/data/core/fonts"
rm -rf "$RELEASEDIR/data/core/misc_textures/flags"
# END
echo "creating $PACKAGE"
[[ -f "$RELEASEDIR_ROOT/$PACKAGE" ]] && rm "$RELEASEDIR_ROOT/$PACKAGE"
tar -cf - -C "$RELEASEDIR_ROOT/$RELEASENAME-$VERSION/" "megaglest-$VERSION" | xz > $RELEASEDIR_ROOT/$PACKAGE
ls -la $RELEASEDIR_ROOT/$PACKAGE

View File

@@ -1,51 +0,0 @@
#!/bin/bash
# Use this script to build MegaGlest Embedded Library Source Code Archive for
# a Version Release
# (Archive for 'make install', with embedded/missing content in other archives)
# ----------------------------------------------------------------------------
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
# Copyright (c) 2011 Mark Vejvoda under GNU GPL v3.0+
VERSION=$(./mg-version.sh --version)
RELEASENAME=megaglest-source-embedded
PACKAGE="$RELEASENAME-$VERSION.tar.xz"
CURRENTDIR="$(dirname $(readlink -f $0))"
RELEASEDIR_ROOT="$CURRENTDIR/../../../release"
RELEASEDIR="$RELEASEDIR_ROOT/$RELEASENAME-$VERSION/megaglest-$VERSION"
SOURCEDIR="$CURRENTDIR/../../source/"
REPODIR="$CURRENTDIR/../../"
echo "Creating source package in $RELEASEDIR"
[[ -d "$RELEASEDIR" ]] && rm -rf "$RELEASEDIR"
mkdir -p "$RELEASEDIR"
mkdir -p "$RELEASEDIR/source/shared_lib/sources/libircclient/"
mkdir -p "$RELEASEDIR/source/shared_lib/include/libircclient/"
cd "$RELEASEDIR/source/shared_lib/sources/libircclient/"
git archive --remote ${REPODIR} HEAD:source/shared_lib/sources/libircclient | tar x
cd "$RELEASEDIR/source/shared_lib/include/libircclient/"
git archive --remote ${REPODIR} HEAD:source/shared_lib/include/libircclient | tar x
mkdir -p "$RELEASEDIR/source/shared_lib/sources/platform/miniupnpc/"
mkdir -p "$RELEASEDIR/source/shared_lib/include/platform/miniupnpc/"
cd "$RELEASEDIR/source/shared_lib/sources/platform/miniupnpc/"
git archive --remote ${REPODIR} HEAD:source/shared_lib/sources/platform/miniupnpc | tar x
cd "$RELEASEDIR/source/shared_lib/include/platform/miniupnpc/"
git archive --remote ${REPODIR} HEAD:source/shared_lib/include/platform/miniupnpc | tar x
mkdir -p "$RELEASEDIR/data/core/misc_textures/flags/"
cd "$RELEASEDIR/data/core/misc_textures/flags/"
git archive --remote ${REPODIR}/data/glest_game/ HEAD:data/core/misc_textures/flags | tar x
mkdir -p "$RELEASEDIR/data/core/fonts/"
cd "$RELEASEDIR/data/core/fonts/"
git archive --remote ${REPODIR}/data/glest_game/ HEAD:data/core/fonts | tar x
cd "$CURRENTDIR"
echo "Creating $PACKAGE"
[[ -f "$RELEASEDIR_ROOT/$PACKAGE" ]] && rm "$RELEASEDIR_ROOT/$PACKAGE"
tar cJf "$RELEASEDIR_ROOT/$PACKAGE" -C "$RELEASEDIR_ROOT/$RELEASENAME-$VERSION" "megaglest-$VERSION"
ls -la $RELEASEDIR_ROOT/$PACKAGE

View File

@@ -1,61 +0,0 @@
#!/bin/bash
# Use this script to build ZetaGlest Source Code Archive for a Version Release
# (Source archive for 'make install', without embedded content)
# ----------------------------------------------------------------------------
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
# Copyright (c) 2011 Mark Vejvoda under GNU GPL v3.0+
VERSION=$(./mg-version.sh --version)
RELEASENAME=zetaglest-binary
PACKAGE="$RELEASENAME-$VERSION.tar.xz"
CURRENTDIR="$(dirname $(readlink -f $0))"
RELEASEDIR_ROOT="$CURRENTDIR/../../../release"
RELEASEDIR="$RELEASEDIR_ROOT/$RELEASENAME-$VERSION/zetaglest-$VERSION"
SOURCEDIR="$CURRENTDIR/../../source/"
REPODIR="$CURRENTDIR/../../"
echo "Creating source package in: ${RELEASEDIR} git REPO is in: ${REPODIR}"
# exit 1
[[ -d "$RELEASEDIR" ]] && rm -rf "$RELEASEDIR"
mkdir -p "$RELEASEDIR"
echo "Exporting source ..."
cd "$RELEASEDIR"
mkdir source
cd source
git archive --remote ${REPODIR} HEAD:source | tar x
cd "$RELEASEDIR"
echo "Exporting mk ..."
mkdir -p mk
cd mk
git archive --remote ${REPODIR} HEAD:mk | tar x
cd "$RELEASEDIR"
echo "Exporting docs ..."
mkdir docs
cd docs
git archive --remote ${REPODIR} HEAD:docs | tar x
cd "$RELEASEDIR"
git archive --remote ${REPODIR} HEAD: CMakeLists.txt | tar x
# exit 1
# START
echo "Removing non required files ..."
# remove embedded library code as that will be packaged in a seperate archive
rm -rf "$RELEASEDIR/source/shared_lib/sources/libircclient/"
rm -rf "$RELEASEDIR/source/shared_lib/include/libircclient/"
rm -rf "$RELEASEDIR/source/shared_lib/sources/platform/miniupnpc/"
rm -rf "$RELEASEDIR/source/shared_lib/include/platform/miniupnpc/"
# END
cd ${CURRENTDIR}
echo "Creating $PACKAGE"
[[ -f "$RELEASEDIR_ROOT/$PACKAGE" ]] && rm "$RELEASEDIR_ROOT/$PACKAGE"
tar cJf "$RELEASEDIR_ROOT/$PACKAGE" -C "$RELEASEDIR_ROOT/$RELEASENAME-$VERSION" "zetaglest-$VERSION"
tar cJf "$RELEASEDIR_ROOT/$PACKAGE" -C "$RELEASEDIR_ROOT/$RELEASENAME-$VERSION" "zetaglest-$VERSION"
ls -la $RELEASEDIR_ROOT/$PACKAGE

View File

@@ -1,43 +0,0 @@
#!/bin/bash
usage() {
echo
echo 'Usage:'
echo "$(basename $0)"' <COMMAND>'
echo
echo 'COMMAND is a standard git command, e.g. "pull" to run "git pull"'
}
case $1 in
pull|status|branch )
echo '==> Running "git '"$1"'" on main repository...'
cd $(dirname $0)
git $1
if [ $? -ne 0 ]; then
echo 'Error: Failed to run "git '"$1"'" on main repository.' >&2
exit 2
fi
echo
echo '==> Running "git '"$1"'" on submodules...'
git submodule foreach git $1
if [ $? -ne 0 ]; then
echo 'Error: Failed to run "git '"$1"'" on submodules.' >&2
exit 2
fi
;;
'' )
echo 'Error: No command was provided.'"$1" >&2
usage
exit 1
;;
* )
echo 'Error: Unknown command: '"$1" >&2
exit 1
;;
esac

View File

@@ -1,6 +0,0 @@
/MegaGlest*
/mgdata.*
/data/
/image/
/makedeps_folder.sh
/cmake-build/

View File

@@ -1,352 +0,0 @@
#!/bin/bash
# Use this script to build ZetaGlest Installer for a Version Release
# ----------------------------------------------------------------------------
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
# Copyright (c) 2011 Mark Vejvoda under GNU GPL v3.0+
# This script is not robust for all platforms or situations. Use as a rough
# example, but invest effort in what it's trying to do, and what it produces.
# (make sure you don't build in features you don't need, etc).
# To install the installer silently you may run it like this:
# ./zetaglest-installer.run --noprompt --i-agree-to-all-licenses --destination /home/softcoder/megaglest-temp-test --noreadme --ui=stdio
# Consider setting this for small packages if there's plenty of RAM and CPU available:
#export XZ_OPT="$XZ_OPT -9e"
CURRENTDIR="$(dirname "$(readlink -f "$0")")"
cd "$CURRENTDIR"
# below describe various folder paths relative to the installer root folder
zetaglest_linux_path="$CURRENTDIR/../.."
BINARY_DIR="$($zetaglest_linux_path/make-binary-archive.sh --show-result-path2)"
DATA_DIR="$($zetaglest_linux_path/make-data-archive.sh --show-result-path2)"
VERSION=`$zetaglest_linux_path/mg-version.sh --version`
kernel=`uname -s | tr '[A-Z]' '[a-z]'`
architecture=`uname -m | tr '[A-Z]' '[a-z]'`
zg_installer_bin_name=ZetaGlest-Installer-${VERSION}_${architecture}_${kernel}.run
if [ "$(which zip 2>/dev/null)" = "" ]; then
echo "Compression tool 'zip' DOES NOT EXIST on this system, please install it"; exit 1
fi
if [ "$(which xz 2>/dev/null)" = "" ]; then
echo "Compression tool 'xz' DOES NOT EXIST on this system, please install it"; exit 1
fi
if [ "$(which tar 2>/dev/null)" = "" ]; then
echo "Compression tool 'tar' DOES NOT EXIST on this system, please install it"; exit 1
fi
# Below is the name of the archive to create and tack onto the installer.
# *NOTE: The filename's extension is of critical importance as the installer
# does a patch on extension to figure out how to decompress!
#
#zetaglest_archiver_app_data='tar -cf - * | xz > mgdata.tar.xz'
zetaglest_archivefilename_data="mgdata.tar.xz"
#zetaglest_archiver_app="zip -9r "
#zetaglest_archivefilename="mgdata.zip"
zetaglest_archiver_app="zip -0r "
zetaglest_archivefilename="mgpkg.zip"
#zetaglest_archiver_app="tar -c --bzip2 -f "
#zetaglest_archivefilename="mgdata.tar.bz2"
# Grab the version #
#
echo "Linux project root path [$zetaglest_linux_path]"
echo "About to build Installer for $VERSION"
# Stop if anything produces an error.
set -e
REPACKONLY=0
DEBUG=0
if [ "$1" = "--debug" -o "$2" = "--debug" ]; then
echo "debug build!"
DEBUG=1
fi
if [ "$1" = "--repackonly" -o "$2" = "--repackonly" ]; then
echo "repacking installer only!"
REPACKONLY=1
fi
APPNAME="ZetaGlest Installer"
# I use a "cross compiler" to build binaries that are isolated from the
# particulars of my Linux workstation's current distribution. This both
# keeps me at a consistent ABI for generated binaries and prevent subtle
# dependencies from leaking in.
# You may not care about this at all. In which case, just use the
# CC=gcc and CXX=g++ lines instead.
CC="$( which gcc 2>/dev/null )"
CXX="$( which g++ 2>/dev/null )"
#CC=/opt/crosstool/gcc-3.3.6-glibc-2.3.5/i686-unknown-linux-gnu/i686-unknown-linux-gnu/bin/gcc
#CXX=/opt/crosstool/gcc-3.3.6-glibc-2.3.5/i686-unknown-linux-gnu/i686-unknown-linux-gnu/bin/g++
OSTYPE=`uname -s`
if [ "$OSTYPE" = "Linux" ]; then
NCPU=`lscpu -p | grep -cv '^#'`
if [ "$NUMCORES" = '' ]; then NUMCORES=1; fi
elif [ "$OSTYPE" = "Darwin" ]; then
NCPU=`sysctl -n hw.ncpu`
elif [ "$OSTYPE" = "SunOS" ]; then
NCPU=`/usr/sbin/psrinfo |wc -l |sed -e 's/^ *//g;s/ *$//g'`
else
NCPU=1
fi
if [ "x$NCPU" = "x" ]; then
NCPU=1
fi
if [ "x$NCPU" = "x0" ]; then
NCPU=1
fi
echo "Will use make -j$NCPU. If this is wrong, check NCPU at top of script."
# Show everything that we do here on stdout.
set -x
if [ "$DEBUG" = "1" ]; then
LUASTRIPOPT=
BUILDTYPE=Debug
TRUEIFDEBUG=TRUE
FALSEIFDEBUG=FALSE
else
LUASTRIPOPT=-s
BUILDTYPE=MinSizeRel
TRUEIFDEBUG=FALSE
FALSEIFDEBUG=TRUE
fi
# Clean up previous run, build fresh dirs for Base Archive.
cd "$CURRENTDIR"
rm -rf image ${zg_installer_bin_name} ${zetaglest_archivefilename}
if [ $? != 0 ]; then
exit $?
fi
mkdir image
mkdir image/guis
mkdir image/scripts
mkdir image/data
mkdir image/meta
# This next section copies live data from the ZetaGlest directories
if [ $REPACKONLY -eq 0 ]; then
cd "$CURRENTDIR"
INSTALLDATADIR="data"
rm -rf $INSTALLDATADIR
mkdir $INSTALLDATADIR
echo Copying ZetaGlest binary files...
$zetaglest_linux_path/make-binary-archive.sh --installer
cd "$BINARY_DIR"
cp -r * "$CURRENTDIR/$INSTALLDATADIR"
if [ $? != 0 ]; then
exit $?
fi
echo Copying ZetaGlest data files...
$zetaglest_linux_path/make-data-archive.sh --installer
cd "$DATA_DIR"
if [ $? != 0 ]; then
exit $?
fi
cp -r * "$CURRENTDIR/$INSTALLDATADIR"
if [ $? != 0 ]; then
exit $?
fi
cd "$CURRENTDIR"
cp zetaglest-uninstall.ico "$CURRENTDIR/$INSTALLDATADIR"
if [ $? != 0 ]; then
exit $?
fi
fi
if [ ! -d data/docs ]; then
echo "We don't see data/docs ..."
echo " Either you're in the wrong directory, or you didn't copy the"
echo " install data into here (it's unreasonably big to store it in"
echo " revision control for no good reason)."
exit 1
fi
# Build MojoSetup binaries from scratch.
# YOU ALWAYS NEED THE LUA PARSER IF YOU WANT UNINSTALL SUPPORT!
#cd mojosetup
cd "$CURRENTDIR"
rm -rf cmake-build
if [ $? != 0 ]; then
exit $?
fi
mkdir cmake-build
cd cmake-build
# 'MOJOSETUP_GUI_*_STATIC=TRUE' > oddly it is not static after this, but isn't optional anymore so this kills portability
cmake \
-DCMAKE_BUILD_TYPE=$BUILDTYPE \
-DCMAKE_C_COMPILER=$CC \
-DMOJOSETUP_MULTIARCH=FALSE \
-DMOJOSETUP_ARCHIVE_ZIP=TRUE \
-DMOJOSETUP_ARCHIVE_TAR=TRUE \
-DMOJOSETUP_ARCHIVE_TAR_BZ2=TRUE \
-DMOJOSETUP_ARCHIVE_TAR_GZ=TRUE \
-DMOJOSETUP_ARCHIVE_TAR_XZ=TRUE \
-DMOJOSETUP_INPUT_XZ=TRUE \
-DMOJOSETUP_BUILD_LUAC=TRUE \
-DMOJOSETUP_GUI_GTKPLUS2=TRUE \
-DMOJOSETUP_GUI_GTKPLUS2_STATIC=FALSE \
-DMOJOSETUP_GUI_NCURSES=TRUE \
-DMOJOSETUP_GUI_NCURSES_STATIC=FALSE \
-DMOJOSETUP_GUI_STDIO=TRUE \
-DMOJOSETUP_GUI_STDIO_STATIC=TRUE \
-DMOJOSETUP_GUI_WWW=FALSE \
-DMOJOSETUP_LUALIB_DB=FALSE \
-DMOJOSETUP_LUALIB_IO=TRUE \
-DMOJOSETUP_LUALIB_MATH=FALSE \
-DMOJOSETUP_LUALIB_OS=TRUE \
-DMOJOSETUP_LUALIB_PACKAGE=TRUE \
-DMOJOSETUP_LUA_PARSER=TRUE \
-DMOJOSETUP_IMAGE_BMP=TRUE \
-DMOJOSETUP_IMAGE_JPG=FALSE \
-DMOJOSETUP_IMAGE_PNG=FALSE \
-DMOJOSETUP_INTERNAL_BZLIB=TRUE \
-DMOJOSETUP_INTERNAL_LIBLZMA=TRUE \
-DMOJOSETUP_URL_HTTP=FALSE \
-DMOJOSETUP_URL_FTP=FALSE \
../mojosetup
# Perhaps needed to remove compiler / linker warnings considered as errors
# sed -i 's/-Werror//' Makefile
make -j$NCPU
# Strip the binaries and GUI plugins, put them somewhere useful.
if [ "$DEBUG" != "1" ]; then
strip ./mojosetup
fi
if [ $? != 0 ]; then
exit $?
fi
mv ./mojosetup ../${zg_installer_bin_name}
for feh in *.so *.dll *.dylib ; do
if [ -f $feh ]; then
if [ "$DEBUG" != "1" ]; then
strip $feh
fi
mv $feh ../image/guis
fi
done
# Compile the Lua scripts, put them in the base archive.
for feh in ../mojosetup/scripts/*.lua ; do
feh_b="$(basename $feh)"
./mojoluac $LUASTRIPOPT -o ../image/scripts/${feh_b}c $feh
done
# Don't want the example config...use our's instead.
rm -f ../image/scripts/config.luac
./mojoluac $LUASTRIPOPT -o ../image/scripts/config.luac ../scripts/config.lua
# Don't want the example app_localization...use our's instead.
rm -f ../image/scripts/app_localization.luac
./mojoluac $LUASTRIPOPT -o ../image/scripts/app_localization.luac ../scripts/app_localization.lua
# Fill in the rest of the Base Archive...
cd ..
shopt -s extglob
if [ $REPACKONLY -eq 0 ]; then
# Compress the main data archive
cd data
#${zetaglest_archiver_app_data} ${zetaglest_archivefilename_data}
tar -cf - * | xz > ../$zetaglest_archivefilename_data
# now remove everything except for the docs folder and the data archive
rm -rf !(docs|${zetaglest_archivefilename_data})
# now remove everything in the docs except files listed in config.lua
cd docs
rm -rf !(gnu_gpl_*.txt|cc-by-sa-*-unported.txt|README.txt)
cd ..
cd ..
mv -f $zetaglest_archivefilename_data data/
fi
cp -R data/* image/data/
if [ $? != 0 ]; then
exit $?
fi
cp meta/* image/meta/
if [ $? != 0 ]; then
exit $?
fi
# Need these scripts to do things like install menu items, etc, on Unix.
if [ "$OSTYPE" = "Linux" ]; then
USE_XDG_UTILS=1
fi
if [ "$OSTYPE" = "SunOS" ]; then
USE_XDG_UTILS=1
fi
if [ "x$USE_XDG_UTILS" = "x1" ]; then
mkdir image/meta/xdg-utils
cp $CURRENTDIR/mojosetup/meta/xdg-utils/* image/meta/xdg-utils/
if [ $? != 0 ]; then
exit $?
fi
chmod a+rx image/meta/xdg-utils/*
fi
if [ "$OSTYPE" = "Darwin" ]; then
# Build up the application bundle for Mac OS X...
APPBUNDLE="$APPNAME.app"
rm -rf "$APPBUNDLE"
cp -Rv ../misc/MacAppBundleSkeleton "$APPBUNDLE"
perl -w -pi -e 's/YOUR_APPLICATION_NAME_HERE/'"$APPNAME"'/g;' "${APPBUNDLE}/Contents/Info.plist"
mv zetaglest-installer "${APPBUNDLE}/Contents/MacOS/mojosetup"
mv image/* "${APPBUNDLE}/Contents/MacOS/"
rmdir image
ibtool --compile "${APPBUNDLE}/Contents/Resources/MojoSetup.nib" ../misc/MojoSetup.xib
else
# Make an archive of the Base Archive dirs and nuke the originals...
cd image
# create the compressed image for the installer (this will use zip as a container)
# zip -9r ../${zetaglest_archivefilename} *
${zetaglest_archiver_app} ../${zetaglest_archivefilename} *
cd ..
rm -rf image
# Append the archive to the mojosetup binary, so it's "self-extracting."
cat ${zetaglest_archivefilename} >> ./${zg_installer_bin_name}
rm -f ${zetaglest_archivefilename}
fi
# ...and that's that.
set +e
set +x
echo "Successfully built!"
ls -lha ${zg_installer_bin_name}
if [ "$DEBUG" = "1" ]; then
echo
echo
echo
echo 'ATTENTION: THIS IS A DEBUG BUILD!'
echo " DON'T DISTRIBUTE TO THE PUBLIC."
echo ' THIS IS PROBABLY BIGGER AND SLOWER THAN IT SHOULD BE.'
echo ' YOU HAVE BEEN WARNED!'
echo
echo
echo
fi
exit 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 475 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 KiB

Submodule mk/linux/tools-for-standalone-client/installer/mojosetup deleted from 86bb138f83

View File

@@ -1,79 +0,0 @@
-- Lines starting with "--" are comments in this file.
-- You should add your installer's strings here, instead of localization.lua,
-- but localization.lua has instructions on how this file is formatted.
MojoSetup.applocalization = {
["Uninstall complete"] = {
en = "Uninstall complete. You may also delete '.megaglest' in your home directory to remove personal settings.",
de = "Deinstallation abgeschlossen. Um auch Deine MegaGlest-Konfiguration zu entfernen kannst Du jetzt noch das Verzeichnis '.megaglest' in Deinem Home-Verzeichnis löschen.",
es = "Desinstalación completa.",
pl = "Usuwanie zakończone. Możesz usunąć '.megaglest' w katalogu domowym by usunąć zapisane gry i ustawienia.",
it = "Disinstallazione completata. Se desideri cancellare i salvataggi e le impostazioni cancella '.megaglest' nella tua directory home.",
};
["MegaGlest README"] = {
en = "MegaGlest README",
de = "MegaGlest README-Datei",
es = "LEEME",
pl = "MegaGlest README",
it = "Informazioni su MegaGlest",
};
["docs/README"] = {
};
["MegaGlest Game License"] = {
en = "MegaGlest Game Licence",
de = "MegaGlest-Lizenz (Spiel)",
es = "Licencia de uso de MegaGlest",
pl = "Licencja gry MegaGlest",
it = "Licenza di MegaGlest",
};
["MegaGlest Data License"] = {
en = "MegaGlest Data Licence",
de = "MegaGlest-Lizenz (Daten)",
es = "Licencia de uso de MegaGlest",
pl = "Licencja danych MegaGlest",
it = "Licenza di MegaGlest",
};
["MegaGlest Uninstall Title"] = {
en = "Remove previous version",
de = "Entfernen der vorherigen Version",
es = "Remove previous version",
pl = "Usuń poprzednią wersję",
it = "Rimuovere la versione precedente",
};
["MegaGlest Uninstall Prompt"] = {
en = "We have detected a previous installation of MegaGlest, should we remove it?",
de = "Es wurde eine frühere Installation von MegaGlest erkannt. Möchtest Du sie entfernen?",
es = "We have detected a previous installation of MegaGlest, should we remove it?",
pl = "Wykryto poprzednią instalację MegaGlest, usunąć ją?",
it = "E' stata trovata una versione meno recente di MegaGlest, vuoi rimuoverla?",
};
["MegaGlest Visit Website Title"] = {
en = "Visit megaglest.org",
de = "Besuche megaglest.org",
es = "Visit megaglest.org",
pl = "Odwiedź megaglest.org",
it = "Visita megaglest.org",
};
["MegaGlest Visit Website Prompt"] = {
en = "Would you like to view our getting started page on megaglest.org?",
de = "Möchtest Du unseren 'Getting Started'-Guide auf megaglest.org ansehen?",
es = "Would you like to view our getting started page on megaglest.org?",
pl = "Czy chcesz zobaczyć stronę z pierwszymi krokami na megaglest.org?",
it = "Vorresti visualizzare la nostra pagina di benvenuto su megaglest.org?",
};
["docs/LICENSE"] = {
};
};
-- end of app_localization.lua ...

View File

@@ -1,172 +0,0 @@
local GAME_INSTALL_SIZE = 705000000;
local GAME_VERSION = "0.8.01";
local _ = MojoSetup.translate
Setup.Package
{
vendor = "github.com/ZetaGlest",
id = "zetaglest",
description = _("ZetaGlest v" .. GAME_VERSION),
version = GAME_VERSION,
splash = "glestforumsheader.bmp",
superuser = false,
write_manifest = true,
support_uninstall = true,
recommended_destinations =
{
MojoSetup.info.homedir,
"/opt/games",
"/usr/local/games"
},
precheck = function(package)
-- MojoSetup.msgbox('Test#1', MojoSetup.info.homedir .. '/zetaglest/uninstall-zetaglest.sh')
local previousPath = ''
if MojoSetup.platform.exists(MojoSetup.info.homedir .. '/zetaglest/uninstall-zetaglest.sh') then
previousPath = MojoSetup.info.homedir .. '/zetaglest/'
elseif MojoSetup.platform.exists('/opt/games/zetaglest/uninstall-zetaglest.sh') then
previousPath = '/opt/games/zetaglest/'
elseif MojoSetup.platform.exists('/usr/local/games/zegaglest/uninstall-zetaglest.sh') then
previousPath = '/usr/local/games/zegaglest/'
end
if previousPath ~= '' then
if MojoSetup.promptyn(_("ZetaGlest Uninstall Title"), _("ZetaGlest Uninstall Prompt") .. '\n\n[' .. previousPath .. ']') then
os.execute(previousPath .. 'uninstall-zegaglest.sh')
end
end
end,
preinstall = function(package)
local previousPath = ''
if MojoSetup.platform.exists(MojoSetup.info.homedir .. '/zetaglest/mydata/') then
previousPath = MojoSetup.info.homedir .. '/zetaglest/'
elseif MojoSetup.platform.exists('/opt/games/zetaglest/mydata/') then
previousPath = '/opt/games/zetaglest/'
elseif MojoSetup.platform.exists('/usr/local/games/zetaglest/mydata/') then
previousPath = '/usr/local/games/zetaglest/'
end
-- Move mod data folder to new location if we find it
if previousPath ~= '' then
local instPathData = MojoSetup.info.homedir .. '/.zetaglest/'
local instPath = instPathData
-- MojoSetup.msgbox('Moving mod folder','About to move mod folder from [' .. previousPath .. '] to [' .. instPath .. ']')
os.execute('mkdir ' .. instPathData)
os.execute('mv ' .. previousPath .. 'mydata/* ' .. instPath)
os.execute('mv ' .. previousPath .. 'glestuser.ini ' .. instPath .. 'glestuser.ini')
end
end,
postinstall = function(package)
if MojoSetup.promptyn(_("ZetaGlest Visit Website Title"), _("ZetaGlest Visit Website Prompt")) then
MojoSetup.launchbrowser("http://zetaglest.org/get-started.html")
end
end,
postuninstall = function(package)
-- Cleanup additional files
if MojoSetup.destination ~= '' then
if MojoSetup.platform.exists(MojoSetup.destination .. '/lib/') then
os.execute('rm -rf ' .. MojoSetup.destination .. '/lib/')
end
if MojoSetup.platform.exists(MojoSetup.destination .. '/.lib_bak/') then
os.execute('rm -rf ' .. MojoSetup.destination .. '/.lib_bak/')
end
if MojoSetup.platform.exists(MojoSetup.destination) then
os.execute('rm -rf ' .. MojoSetup.destination)
end
end
end,
Setup.Eula
{
description = _("ZetaGlest Game License"),
source = _("docs/gnu_gpl_3.0.txt")
},
Setup.Eula
{
description = _("ZetaGlest Data License"),
source = _("docs/cc-by-sa-3.0-unported.txt")
},
Setup.Readme
{
description = _("ZetaGlest README"),
source = _("docs/README.txt")
},
Setup.Option
{
value = true,
required = true,
disabled = false,
bytes = GAME_INSTALL_SIZE,
description = _("ZetaGlest v" .. GAME_VERSION),
Setup.File
{
-- Just install everything we see...
source = "base:///mgdata.tar.xz",
},
Setup.DesktopMenuItem
{
disabled = false,
name = _("ZetaGlest v" .. GAME_VERSION),
genericname = _("ZetaGlest"),
tooltip = _("A real time strategy game."),
builtin_icon = false,
icon = "zetaglest.png",
commandline = "%0/start_zetaglest",
category = "Game;StrategyGame"
},
Setup.DesktopMenuItem
{
disabled = false,
name = _("ZetaGlest Map Editor v" .. GAME_VERSION),
genericname = _("ZetaGlest"),
tooltip = _("A real time strategy game."),
builtin_icon = false,
icon = "zetaglest.png",
commandline = "%0/start_zetaglest_mapeditor",
category = "Game;StrategyGame",
--mimetype = {"application/x-gbm", "application/mgm"}
},
Setup.DesktopMenuItem
{
disabled = false,
name = _("ZetaGlest G3D Model Viewer v" .. GAME_VERSION),
genericname = _("ZetaGlest"),
tooltip = _("A real time strategy game."),
builtin_icon = false,
icon = "zetaglest.png",
commandline = "%0/start_zetaglest_g3dviewer",
category = "Game;StrategyGame",
--mimetype = {"application/x-g3d"}
},
Setup.DesktopMenuItem
{
disabled = false,
name = _("ZetaGlest Uninstall v" .. GAME_VERSION),
genericname = _("ZetaGlest"),
tooltip = _("A real time strategy game."),
builtin_icon = false,
icon = "zetaglest-uninstall.ico",
commandline = "%0/uninstall-zetaglest.sh",
category = "Game;StrategyGame"
}
}
}
-- end of config.lua ...

View File

@@ -1,76 +0,0 @@
#!/bin/sh
# 2015 Written by filux <heross(@@)o2.pl>
# Copyright (c) 2015-2017 under GNU GPL v3.0+
# ----------------------------------------------------------------------------
LANG=C
CURRENTDIR="$(dirname "$(readlink -f "$0")")"
cd "$CURRENTDIR"
ENGINE_VERSION="$(../mg-version.sh --version)"
MU_PACKAGE_NAME='megaglest-mu-$ENGINE_VERSION-linux.tar.gz'
mkdir -p lib-x86; mkdir -p lib-x86_64
if [ "$?" -eq "0" ]; then
echo '#!/bin/sh
# 2015 Written by filux <heross(@@)o2.pl>
# Copyright (c) 2015-2017 under GNU GPL v3.0+
# ----------------------------------------------------------------------------
LANG=C
CURRENTDIR="$(dirname "$(readlink -f "$0")")"
cd "$CURRENTDIR"
ENGINE_VERSION="'"$ENGINE_VERSION"'"
MU_PACKAGE_NAME="'"$MU_PACKAGE_NAME"'"
MU_ADDRESS="https://github.com/MegaGlest/megaglest-source/releases/download/$ENGINE_VERSION/$MU_PACKAGE_NAME"
if [ "$(which curl 2>/dev/null)" = "" ]; then
echo "Downloading tool '"'curl'"' DOES NOT EXIST on this system, please install it."
exit 1
fi
ARCHITECTURE="$(uname -m | tr '"'[A-Z]'"' '"'[a-z]'"')"
if [ "$ARCHITECTURE" = "x86_64" ]; then LibDir="lib-x86_64"; else LibDir="lib-x86"; fi
if [ ! -e "$MU_PACKAGE_NAME" ]; then
echo "Downloading $MU_PACKAGE_NAME ..."
curl -L -# "$MU_ADDRESS" -o "$MU_PACKAGE_NAME"; sleep 2s
if [ -e "$MU_PACKAGE_NAME" ] && [ "$(tar -tf "$MU_PACKAGE_NAME" 2>/dev/null)" != "" ]; then
echo "Extracting $MU_PACKAGE_NAME ..."; sleep 2s
tar xzf "$MU_PACKAGE_NAME" -C "./"; sleep 1s
fi
if [ ! -e "$MU_PACKAGE_NAME" ]; then echo "The $MU_PACKAGE_NAME was not found ..."; fi
if [ -e "megaglest-mini_update/megaglest-mini-update.sh" ]; then
cp -f --no-dereference --preserve=all "megaglest-mini_update/megaglest-mini-update.sh" ./; sleep 0.5s
./megaglest-mini-update.sh; sleep 0.5s
else
rm -f "$MU_PACKAGE_NAME"
fi
else
if [ -d "megaglest-mini_update" ]; then
if [ -d "megaglest-mini_update/$LibDir" ]; then
mv "megaglest-mini_update/$LibDir" "megaglest-mini_update/lib"; sleep 0.25s
rm -rf "lib" ".lib_bak" "lib-x86_64" "lib-x86" "megaglest-mini_update/lib-x86_64" "megaglest-mini_update/lib-x86"
sleep 0.25s
fi
mv -f "megaglest-mini_update/"* "./"; sleep 0.5s; rm -rf "megaglest-mini_update"
echo "Mini update finished."
fi
rm -f "$MU_PACKAGE_NAME"
fi
exit 0' > "megaglest-mini-update.sh"
chmod +x "megaglest-mini-update.sh"
if [ "$1" != "--only_script" ]; then
rm -f "megaglest-mu-"*"-linux.tar.gz"
if [ -d "megaglest-mini_update" ]; then rm -rf "megaglest-mini_update"; fi
mkdir -p "megaglest-mini_update"
cp -f --no-dereference --preserve=all start_megaglest \
start_megaglest_mapeditor start_megaglest_g3dviewer \
megaglest-mini-update.sh megaglest-configure-desktop.sh "megaglest-mini_update"
cp -R -f --no-dereference --preserve=all lib-x86 lib-x86_64 "megaglest-mini_update"
sleep 0.5s
GZIP=-9 tar czf "megaglest-mu-$ENGINE_VERSION-linux.tar.gz" "megaglest-mini_update"
rm -rf "megaglest-mini_update"
rm -f "megaglest-mini-update.sh"
fi
fi
exit 0

View File

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB