# $Id: Portfile,v 1.10 2006/08/01 00:56:58 rhwood Exp $

# TODO: figure out how to make PAM happy without blowing a large hole
#	in the security of the OS or touching PAM

PortSystem 1.0
name		gdm
version		2.14.10
revision	0
description	The Gnome Display Manager is a re-implementation of the well known xdm program.
long_description	The Gnome Display Manager is a re-implementation of the well \
			known xdm program. It displays a X11-based graphical login screen. \
			\
			This port includes a StartupItem installed into /Library/StartupItems \
			that can be used to run gdm automatically by inserting \
			\"DISPLAYSERVER=-X11-\" into /etc/hostconfig.
maintainers	darwinports@opendarwin.org
categories	gnome
platforms	darwin 
homepage	http://www.gnome.org/
master_sites	gnome:sources/gdm/2.14/
checksums	md5 e880558dc3574f804f3abca869992a4f
depends_lib	bin:gnome-session:gnome-session
use_bzip2 	yes

configure.args	--mandir=${prefix}/share/man --disable-scrollkeeper
configure.env   CPPFLAGS="-I${prefix}/include -L${prefix}/lib" \
		LDFLAGS="-lresolv -L${prefix}/lib"

startupitem.create	yes
startupitem.init	XDG_DATA_DIRS=${prefix}/share
startupitem.start	${prefix}/bin/gdm
startupitem.stop	${prefix}/sbin/gdm-stop
startupitem.restart	${prefix}/sbin/gdm-restart

pre-configure {
	reinplace	"s|security/pam|pam/pam|g" ${worksrcpath}/configure
	reinplace	"s|security/pam|pam/pam|g" ${worksrcpath}/daemon/verify-pam.c
	reinplace	"s|security/pam|pam/pam|g" ${worksrcpath}/gui/gdmlogin.c
	reinplace	"s|security/pam|pam/pam|g" ${worksrcpath}/utils/gdmaskpass.c
	reinplace	"s|security/pam|pam/pam|g" ${worksrcpath}/gui/greeter/greeter.c
}

post-configure {
	reinplace	"s|security/pam|pam/pam|g" ${worksrcpath}/config/Makefile
}

pre-activate {
	addgroup gdm
	adduser gdm gid=[existsgroup gdm]
}

post-activate {
	system "scrollkeeper-update"
	file mkdir ${prefix}/var/gdm
	file attributes ${prefix}/var/gdm -owner gdm -group gdm
}
