From 7dcbcc973e6a6791f392e3413aef42a12fd28c7d Mon Sep 17 00:00:00 2001 From: scarab Date: Fri, 25 Jul 2008 12:13:11 +0000 Subject: "uprava vyroby binarky pro linux + par kosmetickejch uprav" git-svn-id: http://opensvn.csie.org/tuxanci_ng@169 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- packaging/linux/build.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 packaging/linux/build.sh (limited to 'packaging/linux/build.sh') diff --git a/packaging/linux/build.sh b/packaging/linux/build.sh new file mode 100755 index 0000000..c075d70 --- /dev/null +++ b/packaging/linux/build.sh @@ -0,0 +1,50 @@ +#!/bin/sh + +echo "*** GNU/Linux Binary Packager ***" + +if [ ! $1 ]; then + echo "usage: $0 -v version -s" + echo "eg.: \"$0 -v 0.4.0 -s\" will compile server without -s compile client" + exit 1 +fi +SRV="" +SRV_NAM="" +while getopts v:s arg +do + case $arg in + v) VERSION=${OPTARG};; + s) SRV="-DServer=1"; SRV_NAM="server-";; + *) echo "no arguments!"; exit 1;; + esac +done + +INSTALL_DIR="pkgs/tuxanci-${SRV_NAM}${VERSION}-linux" +BUILD_DIR="pkgs/build/" +SVN='https://opensvn.csie.org/tuxanci_ng/' +log='linux.log' +error="Error! See pkgs/${log} for more iformation" +mkdir -p pkgs/tuxanci-${SRV_NAM}${VERSION}-linux || ( echo $error; exit 1 ) +touch pkgs/${log} || ( echo $error; exit 1 ) +echo "" > pkgs/${log} || ( echo $error; exit 1 ) + +rm -rfv $INSTALL_DIR $BUILD_DIR > 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 . -DPREFIX=\\\"..\\\" -DCMAKE_INSTALL_PREFIX:PATH="${prevdir}/${INSTALL_DIR}" ${SRV} -DLIBDIR=\\\"../lib/\\\" >> "${prevdir}"/pkgs/"${log}" || ( echo $error; exit 1 ) +make >> "${prevdir}"/pkgs/"${log}" || ( echo $error; exit 1 ) +sudo make 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 package is ready!" + -- cgit v1.2.3