gnome-base/gdm: Drop old
[gentoo.git] / gnome-base / gdm / gdm-3.16.4.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="5"
6 GCONF_DEBUG="yes"
7 GNOME2_LA_PUNT="yes"
8
9 inherit autotools eutils gnome2 pam readme.gentoo systemd user versionator
10
11 DESCRIPTION="GNOME Display Manager for managing graphical display servers and user logins"
12 HOMEPAGE="https://wiki.gnome.org/Projects/GDM"
13
14 SRC_URI="${SRC_URI}
15         branding? ( http://www.mail-archive.com/tango-artists@lists.freedesktop.org/msg00043/tango-gentoo-v1.1.tar.gz )
16 "
17
18 LICENSE="
19         GPL-2+
20         branding? ( CC-Sampling-Plus-1.0 )
21 "
22
23 SLOT="0"
24
25 IUSE="accessibility audit branding fprint +introspection ipv6 plymouth selinux smartcard +systemd tcpd test wayland xinerama"
26 REQUIRED_USE="wayland? ( systemd )"
27
28 KEYWORDS="~alpha amd64 ~arm ~ia64 ~ppc ~ppc64 ~sh ~sparc x86"
29
30 # NOTE: x11-base/xorg-server dep is for X_SERVER_PATH etc, bug #295686
31 # nspr used by smartcard extension
32 # dconf, dbus and g-s-d are needed at install time for dconf update
33 # We need either systemd or >=openrc-0.12 to restart gdm properly, bug #463784
34 COMMON_DEPEND="
35         app-text/iso-codes
36         >=dev-libs/glib-2.36:2[dbus]
37         >=x11-libs/gtk+-2.91.1:3
38         >=gnome-base/dconf-0.20
39         >=gnome-base/gnome-settings-daemon-3.1.4
40         gnome-base/gsettings-desktop-schemas
41         >=media-libs/fontconfig-2.5.0
42         >=media-libs/libcanberra-0.4[gtk3]
43         sys-apps/dbus
44         >=sys-apps/accountsservice-0.6.12
45
46         x11-apps/sessreg
47         x11-base/xorg-server
48         x11-libs/libXi
49         x11-libs/libXau
50         x11-libs/libX11
51         x11-libs/libXdmcp
52         x11-libs/libXext
53         x11-libs/libXft
54         >=x11-misc/xdg-utils-1.0.2-r3
55
56         virtual/pam
57         systemd? ( >=sys-apps/systemd-186:0=[pam] )
58         !systemd? (
59                 >=x11-base/xorg-server-1.14.3-r1
60                 >=sys-auth/consolekit-0.4.5_p20120320-r2
61                 !<sys-apps/openrc-0.12
62         )
63         sys-auth/pambase[systemd?]
64
65         audit? ( sys-process/audit )
66         introspection? ( >=dev-libs/gobject-introspection-0.9.12:= )
67         plymouth? ( sys-boot/plymouth )
68         selinux? ( sys-libs/libselinux )
69         tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
70         xinerama? ( x11-libs/libXinerama )
71 "
72 # XXX: These deps are from session and desktop files in data/ directory
73 # fprintd is used via dbus by gdm-fingerprint-extension
74 # gnome-session-3.6 needed to avoid freezing with orca
75 RDEPEND="${COMMON_DEPEND}
76         >=gnome-base/gnome-session-3.6
77         >=gnome-base/gnome-shell-3.1.90
78         gnome-extra/polkit-gnome:0
79         x11-apps/xhost
80         x11-themes/gnome-icon-theme-symbolic
81
82         accessibility? (
83                 >=app-accessibility/orca-3.10
84                 gnome-extra/mousetweaks )
85         fprint? (
86                 sys-auth/fprintd
87                 sys-auth/pam_fprint )
88
89         !gnome-extra/fast-user-switch-applet
90 "
91 DEPEND="${COMMON_DEPEND}
92         app-text/docbook-xml-dtd:4.1.2
93         dev-util/gdbus-codegen
94         >=dev-util/intltool-0.40.0
95         dev-util/itstool
96         virtual/pkgconfig
97         x11-proto/inputproto
98         x11-proto/randrproto
99         test? ( >=dev-libs/check-0.9.4 )
100         xinerama? ( x11-proto/xineramaproto )
101 "
102
103 DOC_CONTENTS="
104         To make GDM start at boot, run:\n
105         # systemctl enable gdm.service\n
106         \n
107         For passwordless login to unlock your keyring, you need to install
108         sys-auth/pambase with USE=gnome-keyring and set an empty password
109         on your keyring. Use app-crypt/seahorse for that.\n
110         \n
111         You may need to install app-crypt/coolkey and sys-auth/pam_pkcs11
112         for smartcard support
113 "
114
115 pkg_setup() {
116         enewgroup gdm
117         enewgroup video # Just in case it hasn't been created yet
118         enewuser gdm -1 -1 /var/lib/gdm gdm,video
119
120         # For compatibility with certain versions of nvidia-drivers, etc., need to
121         # ensure that gdm user is in the video group
122         if ! egetent group video | grep -q gdm; then
123                 # FIXME XXX: is this at all portable, ldap-safe, etc.?
124                 # XXX: egetent does not have a 1-argument form, so we can't use it to
125                 # get the list of gdm's groups
126                 local g=$(groups gdm)
127                 elog "Adding user gdm to video group"
128                 usermod -G video,${g// /,} gdm || die "Adding user gdm to video group failed"
129         fi
130 }
131
132 src_prepare() {
133         # make custom session work, bug #216984, upstream bug #737578
134         epatch "${FILESDIR}/${PN}-3.2.1.1-custom-session.patch"
135
136         # ssh-agent handling must be done at xinitrc.d, bug #220603
137         epatch "${FILESDIR}/${PN}-2.32.0-xinitrc-ssh-agent.patch"
138
139         # Gentoo does not have a fingerprint-auth pam stack
140         epatch "${FILESDIR}/${PN}-3.8.4-fingerprint-auth.patch"
141
142         # Show logo when branding is enabled
143         use branding && epatch "${FILESDIR}/${PN}-3.8.4-logo.patch"
144
145         eautoreconf
146
147         gnome2_src_prepare
148 }
149
150 src_configure() {
151         local myconf
152         # PAM is the only auth scheme supported
153         # even though configure lists shadow and crypt
154         # they don't have any corresponding code.
155         # --with-at-spi-registryd-directory= needs to be passed explicitly because
156         # of https://bugzilla.gnome.org/show_bug.cgi?id=607643#c4
157         # Xevie is obsolete, bug #482304
158         # --with-initial-vt=7 conflicts with plymouth, bug #453392
159         ! use plymouth && myconf="${myconf} --with-initial-vt=7"
160
161         gnome2_src_configure \
162                 --with-run-dir=/run/gdm \
163                 --localstatedir="${EPREFIX}"/var \
164                 --disable-static \
165                 --with-xdmcp=yes \
166                 --enable-authentication-scheme=pam \
167                 --with-default-pam-config=exherbo \
168                 --with-at-spi-registryd-directory="${EPREFIX}"/usr/libexec \
169                 --with-consolekit-directory="${EPREFIX}"/usr/lib/ConsoleKit \
170                 --without-xevie \
171                 $(use_with audit libaudit) \
172                 $(use_enable ipv6) \
173                 $(use_with plymouth) \
174                 $(use_with selinux) \
175                 $(use_with systemd) \
176                 $(use_with !systemd console-kit) \
177                 $(use_enable systemd systemd-journal) \
178                 $(systemd_with_unitdir) \
179                 $(use_with tcpd tcp-wrappers) \
180                 $(use_enable wayland wayland-support) \
181                 $(use_with xinerama) \
182                 ${myconf}
183 }
184
185 src_install() {
186         gnome2_src_install
187
188         if ! use accessibility ; then
189                 rm "${ED}"/usr/share/gdm/greeter/autostart/orca-autostart.desktop || die
190         fi
191
192         exeinto /etc/X11/xinit/xinitrc.d
193         newexe "${FILESDIR}/49-keychain-r1" 49-keychain
194         newexe "${FILESDIR}/50-ssh-agent-r1" 50-ssh-agent
195
196         # gdm user's home directory
197         keepdir /var/lib/gdm
198         fowners gdm:gdm /var/lib/gdm
199
200         # install XDG_DATA_DIRS gdm changes
201         echo 'XDG_DATA_DIRS="/usr/share/gdm"' > 99xdg-gdm
202         doenvd 99xdg-gdm
203
204         use branding && newicon "${WORKDIR}/tango-gentoo-v1.1/scalable/gentoo.svg" gentoo-gdm.svg
205
206         readme.gentoo_create_doc
207 }
208
209 pkg_postinst() {
210         local d ret
211
212         gnome2_pkg_postinst
213
214         # bug #436456; gdm crashes if /var/lib/gdm subdirs are not owned by gdm:gdm
215         ret=0
216         ebegin "Fixing "${EROOT}"var/lib/gdm ownership"
217         chown gdm:gdm "${EROOT}var/lib/gdm" || ret=1
218         for d in "${EROOT}var/lib/gdm/"{.cache,.config,.local}; do
219                 [[ ! -e "${d}" ]] || chown -R gdm:gdm "${d}" || ret=1
220         done
221         eend ${ret}
222
223         readme.gentoo_print_elog
224
225         if ! version_is_at_least 3.16.0 ${REPLACING_VERSIONS}; then
226                 ewarn "GDM will now use a new TTY per logged user as explained at:"
227                 ewarn "https://wiki.gentoo.org/wiki/Project:GNOME/GNOME3-Troubleshooting#GDM_.3E.3D_3.16_opens_one_graphical_session_per_user"
228         fi
229 }