1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit cmake-utils pam eutils systemd versionator
8 DESCRIPTION="Simple Login Manager"
9 HOMEPAGE="https://sourceforge.net/projects/slim.berlios/"
10 SRC_URI="mirror://sourceforge/project/${PN}.berlios/${P}.tar.gz"
14 KEYWORDS="amd64 arm ~mips ppc ppc64 sparc x86"
15 IUSE="branding pam consolekit"
16 REQUIRED_USE="consolekit? ( pam )"
18 RDEPEND="x11-libs/libXmu
26 consolekit? ( sys-auth/consolekit
33 PDEPEND="branding? ( >=x11-themes/slim-themes-1.2.3a-r3 )"
36 # Our Gentoo-specific config changes
37 "${FILESDIR}"/${P}-config.diff
38 "${FILESDIR}"/${PN}-1.3.5-arm.patch
39 "${FILESDIR}"/${P}-honour-cflags.patch
40 "${FILESDIR}"/${P}-libslim-cmake-fixes.patch
41 "${FILESDIR}"/${PN}-1.3.5-disable-ck-for-systemd.patch
42 "${FILESDIR}"/${P}-strip-systemd-unit-install.patch
43 "${FILESDIR}"/${P}-systemd-session.patch
44 "${FILESDIR}"/${P}-session-chooser.patch
45 "${FILESDIR}"/${P}-fix-slimlock-nopam-v2.patch
46 "${FILESDIR}"/${P}-drop-zlib.patch
47 "${FILESDIR}"/${P}-freetype.patch
48 "${FILESDIR}"/${P}-envcpy-bad-pointer-arithmetic.patch
52 cmake-utils_src_prepare
54 if use elibc_FreeBSD; then
55 sed -i -e 's/"-DHAVE_SHADOW"/"-DNEEDS_BASENAME"/' CMakeLists.txt \
60 sed -i -e 's/ default/ slim-gentoo-simple/' slim.conf || die
66 $(cmake-utils_use pam USE_PAM)
67 $(cmake-utils_use consolekit USE_CONSOLEKIT)
70 cmake-utils_src_configure
74 cmake-utils_src_install
77 pamd_mimic system-local-login slim auth account session
78 pamd_mimic system-local-login slimlock auth
81 systemd_dounit slim.service
83 insinto /usr/share/slim
84 newins "${FILESDIR}/Xsession-r3" Xsession
86 insinto /etc/logrotate.d
87 newins "${FILESDIR}/slim.logrotate" slim
89 dodoc xinitrc.sample ChangeLog README TODO THEMES
93 # massage ${REPLACING_VERSIONS} to come up with whether or not it's a new install
94 # or if it's older than 1.3.2-r7
95 # Note - there should only ever be zero or one version as this package isn't slotted,
96 # so the logic doesn't worry about what happens if there's two, due to the case where
97 # a previous emerge attempt failed in the middle of qmerge.
99 for rv in ${REPLACING_VERSIONS} ; do
100 if version_is_at_least "1.3.2-r7" "${rv}" ; then
104 if version_is_at_least "1.0" "${rv}" ; then
110 if [[ ${rv} == none ]]; then
112 elog "The configuration file is located at /etc/slim.conf."
114 elog "If you wish ${PN} to start automatically, set DISPLAYMANAGER=\"${PN}\" "
115 elog "in /etc/conf.d/xdm and run \"rc-update add xdm default\"."
117 if [[ ${rv} != newer ]]; then
119 elog "By default, ${PN} is set up to do proper X session selection, including ~/.xsession"
120 elog "support, as well as selection between sessions available in"
121 elog "/etc/X11/Sessions/ at login by pressing [F1]."
123 elog "The XSESSION environment variable is still supported as a default"
124 elog "if no session has been specified by the user."
126 elog "If you want to use .xinitrc in the user's home directory for session"
127 elog "management instead, see README and xinitrc.sample in"
128 elog "/usr/share/doc/${PF} and change your login_cmd in /etc/slim.conf"
131 ewarn "Please note that slim supports consolekit directly. Please do not use any "
132 ewarn "old work-arounds (including calls to 'ck-launch-session' in xinitrc scripts)"
133 ewarn "and enable USE=\"consolekit\" instead."
137 elog "You have merged ${PN} without USE=\"pam\", this will cause ${PN} to fall back to"
138 elog "the console when restarting your window manager. If this is not desired, then"
139 elog "please remerge ${PN} with USE=\"pam\""