#!/bin/sh
CWD=`pwd` 
VERSION=2.4.4.2
cd /tmp
tar xjvf $CWD/gdm-$VERSION.tar.bz2
cd gdm-$VERSION
chown -R root.root .
# Quiet the output from the gdm script when /etc/profile is sourced:
#zcat $CWD/gdm.quiet.diff.gz | patch -p1 --verbose --suffix=.orig
# gdm will add -g anyway.  I suggest not fighting it.  ;-)
CFLAGS=-O2 ./configure --prefix=/usr \
            --sysconfdir=/etc/X11 \
            --localstatedir=/var/lib \
            i486-slackware-linux
make
make install
mkdir -p /usr/share/faces
# Simple session files designed to work with Slackware:
mkdir -p /etc/X11/dm/Sessions
for file in $CWD/Sessions/* ; do
  cp $file /etc/X11/dm/Sessions
done
chown -R root.root /etc/X11/dm
chmod 755 /etc/X11/dm/Sessions/*
# Use a version of Xsession that supports our session choices:
( cd /etc/X11/gdm
  zcat $CWD/Xsession.gz > Xsession
)
mkdir -p /usr/doc/gdm-$VERSION
cp -a ABOUT-NLS AUTHORS COPYING INSTALL NEWS README README.install RELEASENOTES TODO \
   /usr/doc/gdm-$VERSION
chmod 644 /usr/doc/gdm-$VERSION/*
chown -R gdm.gdm /var/lib/gdm
chmod 750 /var/lib/gdm
touch /usr/share/faces /var/lib/gdm
cat $CWD/gdm.conf-graphical > /etc/X11/gdm/gdm.conf
mkdir -p /install
cat $CWD/slack-desc > /install/slack-desc
cat << EOF



Don't miss these empty directories:
drwxr-xr-x    2 root     root           48 Jan 25 14:57 /usr/share/faces
drwxr-x---    2 gdm      gdm            48 Jan 25 14:57 /var/lib/gdm




EOF
