Skip to content

Instantly share code, notes, and snippets.

@ghisguth
Created October 16, 2009 22:19
Show Gist options
  • Save ghisguth/212115 to your computer and use it in GitHub Desktop.
Save ghisguth/212115 to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
GG_ROOT=$PWD
GGDEB_ROOT=$PWD/build/deb
GGDEB_DEBIAN=$GGDEB_ROOT/DEBIAN
GGDEB_CONTROL=$GGDEB_DEBIAN/control
GGDEB_CONFFILES=$GGDEB_DEBIAN/conffiles
GGDEB_SERVER=$GGDEB_ROOT/opt/server
GGDEB_ETC=$GGDEB_ROOT/etc/seduction
if [ "$GGDEB_OUT" = "" ]; then
GGDEB_OUT='../../repo'
fi
rm -rf $GGDEB_ROOT
mkdir -p $GGDEB_DEBIAN || exit 1
version=`git describe --match=v* HEAD`
if [ -e $version ]; then
version=`date +%s`
fi
echo "Package: ggseductionserver
Version: $version
Architecture: amd64
Depends: libc6 (>= 2.4), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1), libboost-system1.38.0 (>=1.38.0),
libboost-thread1.38.0 (>=1.38.0), libboost-regex1.38.0 (>=1.38.0), libboost-serialization1.38.0 (>=1.38.0), libboost-program-options1.38.0 (>=1.38.0),
tokyotyrant, tokyocabinet, mysql-client (>=5.0), libssl0.9.8 (>=0.9.8), libreadline5 (>= 5.2), libmysql++3 (>= 3.0),
libpcre3 (>= 7.6), libpcrecpp0 (>= 7.6), libgd2-xpm (>= 2.0)
Maintainer: Alexander Fedora <alexander.fedora@gmail.com>
Description: server
This is server" > $GGDEB_CONTROL || exit 1
echo "/etc/seduction/seductiond.conf
/etc/seduction/seductiond.log.properties
/etc/seduction/script_config.lua
/etc/seduction/script_seduction_config.lua
/etc/seduction/tyrant/config" > $GGDEB_CONFFILES || exit 1
mkdir -p $GGDEB_ETC || exit 1
mkdir -p $GGDEB_SERVER || exit 1
mkdir -p $GGDEB_SERVER/build || exit 1
mkdir -p $GGDEB_SERVER/script || exit 1
mkdir -p $GGDEB_SERVER/etc || exit 1
cp $GG_ROOT/build/*.so $GGDEB_SERVER/build/ || exit 1
cp $GG_ROOT/build/seductiond $GGDEB_SERVER/build/ || exit 1
cp $GG_ROOT/build/test $GGDEB_SERVER/build/ || exit 1
cp -R $GG_ROOT/etc/ $GGDEB_SERVER/ || exit 1
cp $GG_ROOT/script/config.lua.sample $GGDEB_SERVER/script/ || exit 1
cp $GG_ROOT/etc/seduction/seductiond.conf.example $GGDEB_ETC/seductiond.conf || exit 1
cp $GG_ROOT/etc/log.properties.example $GGDEB_ETC/seductiond.log.properties || exit 1
cp $GG_ROOT/script/config.lua.sample $GGDEB_ETC/script_config.lua || exit 1
cp $GG_ROOT/script/seduction/config.lua.sample $GGDEB_ETC/script_seduction_config.lua || exit 1
cp -R $GG_ROOT/etc/seduction/tyrant/ $GGDEB_ETC/tyrant || exit 1
cd $GG_ROOT
for file in `find script -type f -name '*.lua' | grep -v '/test/'`; do
dir=`dirname $file`
name=`basename $file`
mkdir -p $GGDEB_SERVER/$dir || exit 1
if [ $name != "config.lua" -o $file = 'script/core/config.lua' ]; then
$GG_ROOT/build/luac -o $GGDEB_SERVER/$dir/$name $file || exit 1
fi
done
cd -
ln -s /etc/seduction/script_config.lua $GGDEB_SERVER/script/config.lua
ln -s /etc/seduction/script_seduction_config.lua $GGDEB_SERVER/script/seduction/config.lua
deb_name='ggseductionserver_'$version'.deb'
dpkg -b $GGDEB_ROOT $GGDEB_OUT/$deb_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment