Skip to content

Instantly share code, notes, and snippets.

@ghisguth
Created October 16, 2009 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghisguth/212118 to your computer and use it in GitHub Desktop.
Save ghisguth/212118 to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
GG_ROOT=$PWD/info
GGDEB_ROOT=$PWD/deb
GGDEB_DEBIAN=$GGDEB_ROOT/DEBIAN
GGDEB_CONTROL=$GGDEB_DEBIAN/control
GGDEB_SERVER=$GGDEB_ROOT/opt/infoportal
GGDEB_ETC=$GGDEB_ROOT/etc/seduction
if [ -e $GGDEB_OUT ]; then
GGDEB_OUT='../repo'
fi
rm -rf $GGDEB_ROOT
mkdir -p $GGDEB_DEBIAN || exit 1
mkdir -p $GGDEB_ETC || exit 1
version=`git --git-dir=../glagol/.git/ describe HEAD | sed -e 's/^v//g'`
svn_version=`git log -n 100 | grep git-svn-id | sed -e 's/^.*@\([0-9]\+\).*$/\1/g' | head -n 1`
if [ -e $version ]; then
version=`date +%s`
fi
version=$version-$svn_version
echo "Package: ggseductioninfo
Version: $version
Architecture: all
Maintainer: Alexander Fedora <alexander.fedora@gmail.com>
Description: seduction infoportal
This is infoportal" > $GGDEB_CONTROL || exit 1
mkdir -p $GGDEB_SERVER || exit 1
rsync -av --exclude '_*' --exclude '/data' --exclude '*dbi_config.inc' --exclude '*config.inc' $GG_ROOT/ $GGDEB_SERVER/ > /dev/null || exit 1
ln -s /etc/seduction/info_config.inc $GGDEB_SERVER/include/config.inc
ln -s /etc/seduction/info_dbi_config.inc $GGDEB_SERVER/include/dbi_config.inc
deb_name='ggseductioninfo_'$version'.deb'
dpkg -b $GGDEB_ROOT $GGDEB_OUT/$deb_name
rm -rf $GGDEB_ROOT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment