summaryrefslogtreecommitdiff
path: root/x11/gdm/Makefile
blob: 629fda8b742c4e158b76b2b15075dcb7d96b5d0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# $NetBSD: Makefile,v 1.40 2003/08/30 22:51:38 jlam Exp $

DISTNAME=	gdm-2.2.0
PKGREVISION=	4
CATEGORIES=	x11 gnome
MASTER_SITES=	${MASTER_SITE_GNOME:=sources/gdm/2.2/} \
		${MASTER_SITE_LOCAL}
DISTFILES=	${DISTNAME}${EXTRACT_SUFX} Daemon.README Daemon.png

MAINTAINER=	mjl@NetBSD.org
HOMEPAGE=	http://www.gnome.org/
COMMENT=	Gnome Display Manager - a re-implementation of the xdm program

EXTRACT_ONLY=	${DISTNAME}${EXTRACT_SUFX}

USE_BUILDLINK2=		YES

USE_PKGINSTALL=		YES
DEINSTALL_EXTRA_TMPL+=	${.CURDIR}/DEINSTALL
INSTALL_EXTRA_TMPL+=	${.CURDIR}/INSTALL

USE_PKGLOCALEDIR=	YES
GNU_CONFIGURE=		YES
USE_X11BASE=		YES

LOCALSTATEDIR=	/var/gnome

EVAL_PREFIX+=	KDEBASEDIR=kdebase
CONFIGURE_ARGS+= --localstatedir=${LOCALSTATEDIR}
CONFIGURE_ENV+=	LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} \
		GDMOWN=${GDMOWN} GDMGRP=${GDMGRP}

MAKE_ENV+=	GDMOWN=${GDMOWN} GDMGRP=${GDMGRP}
MAKE_ENV+=	CHMOD=${CHMOD} CHOWN=${CHOWN}
PLIST_SUBST+=	GDMOWN=${GDMOWN} GDMGRP=${GDMGRP} \
		INSTALL="${INSTALL}" LOCALSTATEDIR="${LOCALSTATEDIR}"

GDMCFGDIR=	${PREFIX}/etc/gdm
GDMCFGFILES=	Default:Init.default/Default \
		PostSession:PostSession.default/Default \
		PreSession:PreSession.default/Default \
		Gnome:Sessions.default/Gnome \
		KDE:Sessions.default/KDE \
		Xsession:Sessions.default/Xsession \
		gdm.conf:gdm.conf.default \
		locale.alias:locale.alias.default \
		gnomerc:../gnomerc.default

FILES_SUBST+=	GDMCFGDIR=${GDMCFGDIR:Q}
FILES_SUBST+=	GDMCFGFILES=${GDMCFGFILES:C/.*://g:Q}

.include "../../mk/bsd.prefs.mk"

.if ${OPSYS} == "SunOS"
CFLAGS+= -DSunOS
GDMOWN=		daemon
GDMGRP=		other
.else
GDMOWN=		daemon
GDMGRP=		daemon
.endif

.if defined(USE_PAM)
DEPENDS+=	PAM-[0-9]*:../../security/PAM
.else

post-patch:
	cd ${WRKSRC} &&					\
	${CP} configure configure.old &&		\
	${SED} -e 's:security/pam_appl.h:nopam:g'	\
		< configure.old > configure
.endif

post-build:
	cd ${WRKSRC}/config;						\
	for f in Default PostSession PreSession; do			\
		${SED} -e 's#/usr/bin/X11#${X11BASE}/bin#g' $$f >$$f.new; \
		${MV} $$f.new $$f;					\
		${CHMOD} +x $$f;					\
	done
	cd ${WRKSRC}/config;						\
	${RM} -f KDE Xsession;						\
	${ECHO} '#! ${SH}' >KDE;					\
	${ECHO} "export KDEDIR=${KDEBASEDIR}" >>KDE;			\
	${ECHO} 'exec $${KDEDIR}/bin/startkde $$@' >>KDE;		\
	${ECHO} '#! ${SH}' >Xsession;					\
	${ECHO} 'exec ${X11BASE}/lib/X11/xdm/Xsession $$@' >>Xsession;	\
	${CHMOD} +x KDE Xsession
	${SED} "s|@PREFIX@|${PREFIX}|g" ${FILESDIR}/gdm > ${WRKDIR}/gdm

post-install:
	${CHMOD} +x ${WRKSRC}/config/gnomerc
.for FILE in ${GDMCFGFILES}
	@cd ${WRKSRC}/config; \
	SOURCE=${FILE:C/:.*//}; \
	TARGET=${GDMCFGDIR}/${FILE:C/.*://:S/.default//}; \
	if [ ! -f $$TARGET ]; then \
	  ${ECHO} "installing $$SOURCE as $$TARGET"; \
	  if [ -x $$SOURCE ]; then \
	    ${INSTALL_SCRIPT} $$SOURCE $$TARGET; \
	  else \
	    ${INSTALL_DATA} $$SOURCE $$TARGET; \
	  fi; \
	fi; \
	TARGET=${GDMCFGDIR}/${FILE:C/.*://}; \
	${INSTALL_DATA_DIR} `dirname $$TARGET`; \
	${ECHO} "installing $$SOURCE as $$TARGET"; \
	if [ -x $$SOURCE ]; then \
	  ${INSTALL_SCRIPT} $$SOURCE $$TARGET; \
	else \
	  ${INSTALL_DATA} $$SOURCE $$TARGET; \
	fi
.endfor
	${INSTALL_DATA_DIR} ${PREFIX}/share/doc/gdm
	${INSTALL_DATA} ${DISTDIR}/Daemon.README ${PREFIX}/share/doc/gdm
	${INSTALL_DATA} ${DISTDIR}/Daemon.png ${PREFIX}/share/pixmaps
	${LN} -fs Gnome ${GDMCFGDIR}/Sessions/Default
	${INSTALL_SCRIPT} ${WRKDIR}/gdm ${PREFIX}/etc/rc.d/

.include "../../devel/gettext-lib/buildlink2.mk"
.include "../../devel/libglade/buildlink2.mk"
.include "../../x11/gnome-libs/buildlink2.mk"

.include "../../mk/bsd.pkg.mk"