From cbdc47743ea160fbdae059cdb216e5a0502ebb5a Mon Sep 17 00:00:00 2001 From: mudler Date: Fri, 11 Sep 2015 14:08:18 +0200 Subject: [PATCH] [kde-base/kdm] migration package: nazi/ugly code haead. Shame on me. --- kde-base/kdm/kdm-1000.ebuild | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 kde-base/kdm/kdm-1000.ebuild diff --git a/kde-base/kdm/kdm-1000.ebuild b/kde-base/kdm/kdm-1000.ebuild new file mode 100644 index 000000000..9b43b532e --- /dev/null +++ b/kde-base/kdm/kdm-1000.ebuild @@ -0,0 +1,41 @@ +# Copyright 2004-2015 Sabayon +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +inherit systemd + +DESCRIPTION="Sabayon KDM -> SDDM migration package" +HOMEPAGE="http://www.sabayon.org/" +LICENSE="GPL-2" +SLOT="4" + +KEYWORDS="~amd64 ~x86 ~arm" +IUSE="" +RDEPEND=" + x11-misc/sddm + x11-themes/sabayon-artwork-sddm-default + x11-themes/sabayon-artwork-kde +" + +S="${WORKDIR}/" + +pkg_postinst() { + local systemd="/etc/systemd" + local ud=$(_systemd_get_unitdir) + # Yeah, i know. that's ugly. Shame on me. But KDM doesn't support plasma5, kde4 is dropped. + if grep --quiet "ExecStart=/usr/bin/kdm" "${ROOT}"/"${systemd}"/system/display-manager.service; then + # Trying to make the migration as smooth as possible + einfo "Migrating from kdm to sddm for you" + # Remove previously selected display-manager + rm -rf "${ROOT}"/"${systemd}"/system/display-manager.service + # Forcing sddm, since kdm won't support plasma5 at all + ln -s "${ROOT}"/"${ud}"/sddm.service "${ROOT}"/"${systemd}"/system/display-manager.service + einfo "If you face issues, please file a bug : https://bugs.sabayon.org/" + else + einfo "Seems that you haven't enabled kdm, if you plan to use plasma5, keep in mind that kdm won't work, you have to enable sddm with systemctl:" + einfo "\tsystemctl enable sddm" + einfo "If you face issues, please file a bug : https://bugs.sabayon.org/" + fi +}