#!/bin/sh
#
# Copyright 2004 Dagmar d'Surreal <rivyqntzne@tznvy.pbz>
# Available under the terms of the GNU GPL.
#

NAME="sabayon"
VERSION="2.28.1"
REVISION="1"

PKG_SOURCEURL='http://ftp.gnome.org/pub/GNOME/sources/$NAME/$VER_MAJ.$VER_MIN/$NAME-$VERSION.tar.bz2'

PKG_PATCH[0]="local-defaults.path"
PKG_PATCH[1]="local-mandatory.path"
PKG_PATCH[2]="sabayon-apply"

. $DLG_ROOT/config
. $DLG_ROOT/SCRIPTS/dropline-functions.sh

cflags
cxxflags
prepare


analyzesource
configure --with-distro=slackware --with-prototype-user=sabayon --enable-console-helper=yes
make
makeinstall
tidydocumentation
analyzebinaries

# We put some sabayon tipical stuff into the doinst.sh
mkdir $PKG_STAGEROOT/install
touch $PKG_STAGEROOT/install/doinst.sh

# Before we close the package we need to add some files to the package 
# so that sabayon will be able to work properly.

spewdo "createdir $PKG_STAGEROOT$PKG_SYSCONFDIR/gconf/2"
for (( i=0; i<=1; i++ )); do
	findpatch filename ${PKG_PATCH[i]}
	spewdo "install -m 755 $filename $PKG_STAGEROOT$PKG_SYSCONFDIR/gconf/2"
done


spewdo "createdir $PKG_STAGEROOT$PKG_SYSCONFDIR/X11/xinit/xinitrc.d"
findpatch filename ${PKG_PATCH[2]}
spewdo "install -m 755 $filename $PKG_STAGEROOT$PKG_SYSCONFDIR/X11/xinit/xinitrc.d"

createroleaccount sabayon 44 44
finalizepackage
packagize
cleanup
