#!/bin/sh
#
# Copyright 2005 Scott Harmon
# Available under the terms of the GNU GPL.
#

NAME="gdm"
VERSION="2.8.0.5"
REVISION="1"

PKG_SOURCEURL='http://ftp.gnome.org/pub/GNOME/sources/$NAME/$VER_MAJ.$VER_MIN/$NAME-$VERSION.tar.bz2'
PKG_MAKE_FLAGS='-j1'
. $DLG_ROOT/config
. $DLG_ROOT/SCRIPTS/dropline-functions.sh

# Since we decide what to include by what's in patches
# we need these kinda ghost patches.  I will also track which
# number of the array I'm on.
PATCHNUMBER=0

PKG_PATCH[0]='config.patch'
PATCHNUMBER=$(($PATCHNUMBER+1))

configfile /etc/gdm/gdm.conf

cflags
cxxflags
prepare
applypatch 0 1
analyzesource
configure --enable-console-helper=yes --enable-authentication-scheme=pam
make
makeinstall install-strip

#copy some .desktop files in there...
cd $PKG_COREREPOS
mkdir -p $PKG_STAGEROOT/etc/X11/xinit
PKG_PATCH[PATCHNUMBER]=$PKG_COREREPOS/xinitrc.gnome
PATCHNUMBER=$(($PATCHNUMBER+1))
cat xinitrc.gnome > $PKG_STAGEROOT/etc/X11/xinit/xinitrc.gnome
chmod 755 $PKG_STAGEROOT/etc/X11/xinit/xinitrc.gnome
for filename in `ls *.desktop` ; do
	cp $filename $PKG_STAGEROOT/usr/share/xsessions/$filename
	PKG_PATCH[PATCHNUMBER]=$filename
	PATCHNUMBER=$(($PATCHNUMBER+1))
done
chmod 755 $PKG_LOCALSTAGEDIR/*.desktop

#don't forget the gdmsetup symlink
( cd $PKG_STAGEROOT/usr/bin ; ln -sf /usr/bin/consolehelper gdmsetup )

tidydocumentation
analyzebinaries
includescript
finalizepackage
packagize
cleanup
