update Tue Jun 22 06:37:08 PDT 2010
[pkgsrc.git] / x11 / gdm / Makefile
1 # $NetBSD: Makefile,v 1.157 2010/06/13 22:45:37 wiz Exp $
2 #
3
4 DISTNAME=       gdm-2.20.10
5 PKGREVISION=    4
6 CATEGORIES=     x11 gnome
7 MASTER_SITES=   ${MASTER_SITE_GNOME:=sources/gdm/2.20/}
8 EXTRACT_SUFX=   .tar.bz2
9
10 MAINTAINER=     pkgsrc-users@NetBSD.org
11 HOMEPAGE=       http://www.gnome.org/
12 COMMENT=        Gnome Display Manager - a re-implementation of the xdm program
13
14 PKG_DESTDIR_SUPPORT=    user-destdir
15
16 DEPENDS+=       zenity>=2.16.0:../../x11/zenity
17
18 USE_PKGLOCALEDIR=       YES
19 GNU_CONFIGURE=          YES
20 USE_LIBTOOL=            YES
21 USE_TOOLS+=             gmake intltool msgfmt pkg-config
22 BUILD_DEFS+=            VARBASE
23
24 .include "options.mk"
25
26 CONFIGURE_ARGS+=        --localstatedir=${VARBASE:Q}
27 CONFIGURE_ARGS+=        --sysconfdir=${PKG_SYSCONFDIR:Q}
28 CONFIGURE_ARGS+=        --with-dmconfdir=${PKG_SYSCONFDIR:Q}/dm
29 CONFIGURE_ARGS+=        --with-sysconfsubdir=
30 CONFIGURE_ARGS+=        --with-prefetch=yes
31 CONFIGURE_ENV+=         PREFIX=${PREFIX:Q}
32 CONFIGURE_ENV+=         X11BASE=${X11BASE:Q}
33 INSTALL_MAKE_FLAGS+=    ${MAKE_FLAGS}
34 INSTALL_MAKE_FLAGS+=    GDM_CUSTOM_CONF=${EGDIR:Q}/custom.conf
35 INSTALL_MAKE_FLAGS+=    sysconfdir=${EGDIR:Q}
36 MAKE_ENV+=              CHMOD=${CHMOD:Q} CHOWN=${CHOWN:Q}
37
38 OWN_DIRS=               ${PKG_SYSCONFDIR}/Init
39 OWN_DIRS+=              ${PKG_SYSCONFDIR}/PostLogin
40 OWN_DIRS+=              ${PKG_SYSCONFDIR}/PostSession
41 OWN_DIRS+=              ${PKG_SYSCONFDIR}/PreSession
42 OWN_DIRS+=              ${PKG_SYSCONFDIR}/dm
43 OWN_DIRS+=              ${PKG_SYSCONFDIR}/modules
44 OWN_DIRS+=              ${VARBASE}/gdm
45 OWN_DIRS+=              ${VARBASE}/log/gdm
46
47 PKG_SYSCONFSUBDIR=      gdm
48 EGDIR=                  ${PREFIX}/share/examples/gdm
49 CONF_FILES=
50 .for f in custom.conf locale.alias \
51         modules/AccessDwellMouseEvents modules/AccessKeyMouseEvents \
52         modules/factory-AccessDwellMouseEvents \
53         modules/factory-AccessKeyMouseEvents
54 CONF_FILES+=            ${EGDIR}/${f} ${PKG_SYSCONFDIR}/${f}
55 .endfor
56 .for f in Init/Default PostLogin/Default.sample PostSession/Default \
57         PreSession/Default XKeepsCrashing Xsession
58 CONF_FILES_PERMS+=      ${EGDIR}/${f} ${PKG_SYSCONFDIR}/${f} \
59                         ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 0755
60 .endfor
61 RCD_SCRIPTS=            gdm
62
63 .include "../../mk/bsd.prefs.mk"
64
65 SUBST_CLASSES+=         desktop
66 SUBST_MESSAGE.desktop=  Configuring GDM settings.
67 SUBST_STAGE.desktop=    pre-configure
68 SUBST_FILES.desktop=    config/default.desktop.in
69 #SUBST_FILES.desktop+=  config/gnome.desktop.in
70 SUBST_FILES.desktop+=   config/gdm.conf.in
71 SUBST_SED.desktop=      -e 's/^_//g'
72 SUBST_SED.desktop+=     -e 's|^User=gdm$$|User=${GDMOWN}|g'
73 SUBST_SED.desktop+=     -e 's|^Group=gdm$$|Group=${GDMGRP}|g'
74 SUBST_SED.desktop+=     -e 's|^\#GtkTheme=.*$$|GtkTheme=Clearlooks|g'
75 SUBST_SED.desktop+=     -e 's|^\#FirstVT=.*$$|FirstVT=5|g'
76 SUBST_SED.desktop+=     -e 's|^\#VTAllocation=.*$$|VTAllocation=true|g'
77 .if ${OPSYS} == "NetBSD"
78 SUBST_SED.desktop+=     -e 's|^\#Logo=.*$$|Logo=${PREFIX}/share/pixmaps/NetBSD.xpm|g'
79 .endif
80 .if ${OPSYS} == "NetBSD" || ${OPSYS} == "OpenBSD"
81 SUBST_SED.desktop+=     -e 's|^\#RebootCommand=.*$$|RebootCommand=/sbin/shutdown -r now|g'
82 SUBST_SED.desktop+=     -e 's|^\#HaltCommand=.*$$|HaltCommand=/sbin/shutdown -p now|g'
83 .endif
84 SUBST_SED.desktop+=     -e 's|^PreFetchProgram=.*$$|PreFetchProgram=${PREFIX}/libexec/gdmprefetch @${PKG_SYSCONFDIR}/gdmprefetchlist|g'
85
86 SUBST_CLASSES+=         gdmsetup
87 SUBST_MESSAGE.gdmsetup= Patching gdmsetup theme installer to use ${REAL_ROOT_USER}:${REAL_ROOT_GROUP}
88 SUBST_STAGE.gdmsetup=   post-patch
89 SUBST_FILES.gdmsetup=   gui/gdmsetup.c
90 SUBST_SED.gdmsetup=     -e 's/root:root/${REAL_ROOT_USER}:${REAL_ROOT_GROUP}/g'
91
92 .if ${OPSYS} == "SunOS"
93 CFLAGS+=        -DSunOS
94 GDMOWN=         daemon
95 GDMGRP=         other
96 .else
97 GDMOWN=         daemon
98 GDMGRP=         daemon
99 .endif
100
101 # The following forces the X server to start on the 5th virtual terminal.
102 # This is suboptimal but matches the defaults for the xdm configuration,
103 # which should work for most installations.  See the definition of
104 # DEFAULTVT in xsrc/xfree/xc/programs/xdm/config/Imakefile.
105 #
106 # If we do not do this, we hit a very annoying and obscure problem: during
107 # system startup, gdm starts before init spawns gettys.  If the X server
108 # is started before init spawns the gettys (which easily happens on slow
109 # machines), it grabs the first virtual terminal (instead of the first
110 # "free" one).  Later on, when the first getty is started, it grabs the
111 # same terminal X used (the first one).  As a result, only one of them
112 # will receive key presses.  And on slow machines, X will have lost access
113 # to the keyboard.
114 .if (${OPSYS} == "NetBSD" || ${OPSYS} == "OpenBSD") && \
115     (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64")
116 CONFIGURE_ARGS+=        X_SERVER_ARGS="vt05"
117 .endif
118
119 PLIST_VARS+=            dmx
120 .if exists(${X11BASE}/include/X11/extensions/dmxext.h)
121 PLIST.dmx=              yes
122 .endif
123 PRINT_PLIST_AWK+=       /dmx/ { print "$${DMX}" $$0; next }
124
125 PLIST_VARS+=            gdmopen
126 .if exists(/usr/include/linux/vt.h)
127 PLIST.gdmopen=          yes
128 .endif
129 PRINT_PLIST_AWK+=       /gdmopen/ { print "$${GDMOPEN}" $$0; next }
130
131 .include "../../devel/gettext-lib/buildlink3.mk"
132 .include "../../devel/glib2/buildlink3.mk"
133 .include "../../devel/libglade/buildlink3.mk"
134 .include "../../devel/pango/buildlink3.mk"
135 .include "../../devel/popt/buildlink3.mk"
136 .include "../../graphics/hicolor-icon-theme/buildlink3.mk"
137 BUILDLINK_API_DEPENDS.libart+=  libart>=2.3.11
138 .include "../../graphics/libart/buildlink3.mk"
139 .include "../../graphics/libgnomecanvas/buildlink3.mk"
140 .include "../../graphics/librsvg/buildlink3.mk"
141 .include "../../textproc/gnome-doc-utils/buildlink3.mk"
142 .include "../../textproc/libxml2/buildlink3.mk"
143 .include "../../mk/omf-scrollkeeper.mk"
144 .include "../../x11/gtk2/buildlink3.mk"
145
146 post-install:
147         ${INSTALL_DATA} ${FILESDIR}/NetBSD.xpm ${DESTDIR}${PREFIX}/share/pixmaps
148         ${INSTALL_DATA} ${FILESDIR}/custom.desktop \
149                 ${DESTDIR}${PREFIX}/share/gdm/BuiltInSessions
150
151 .include "../../mk/bsd.pkg.mk"