summaryrefslogtreecommitdiff
path: root/packaging/linux/server.sh
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/linux/server.sh')
-rwxr-xr-xpackaging/linux/server.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/packaging/linux/server.sh b/packaging/linux/server.sh
new file mode 100755
index 0000000..cd9414f
--- /dev/null
+++ b/packaging/linux/server.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+echo "*** GNU/Linux Binary Server Packager ***"
+
+if [ ! $1 ]; then
+ echo "usage: $0 version"
+ exit 1
+fi
+
+VERSION=$1
+INSTALL_DIR="pkgs/tuxanci-${VERSION}-server"
+BUILD_DIR="pkgs/tuxanci-${VERSION}-server-build"
+SVN='https://opensvn.csie.org/tuxanci_ng/'
+log='server.log'
+error="Error! See pkgs/${log} for more iformation"
+
+2&>1
+
+rm -rfv $INSTALL_DIR $BUILD_DIR > pkgs/"${log}" || ( echo $error; exit 1 )
+
+mkdir -pv pkgs >> pkgs/"${log}" || ( echo $error; exit 1 )
+
+echo "* Fetching files from SVN"
+svn export $SVN $BUILD_DIR >> pkgs/"${log}" || ( echo $error; exit 1 )
+
+echo "* Configuring"
+#echo "#define TUXANCI_NG_VERSION \"${VERSION}\"" > $BUILD_DIR/config.h || ( echo $error; exit 1 )
+
+echo "* Compiling"
+prevdir=`pwd`
+cd $BUILD_DIR
+cmake . -DServer=1 -DPREFIX=\\\".\\\" -DDATADIR=\\\".\\\" -DLIBDIR=\\\"./modules\\\" -DCMAKE_INSTALL_PREFIX:PATH=/ -DCMAKE_INSTALL_DATADIR=/ >> "${prevdir}"/pkgs/"${log}" || ( echo $error; exit 1 )
+make >> "${prevdir}"/pkgs/"${log}" || ( echo $error; exit 1 )
+make DESTDIR="${prevdir}/${INSTALL_DIR}" install >> "${prevdir}"/pkgs/"${log}" || ( echo $error; exit 1 )
+cd $prevdir
+
+echo "* Packaging"
+tar cjf "${INSTALL_DIR}".tar.bz2 $INSTALL_DIR || ( echo $error; exit 1 )
+
+echo "** GNU/Linux binary server package is ready!"
+