# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 inherit autotools #inherit autotools flag-o-matic DESCRIPTION="Lightweight, secure and login like console display manager for X" HOMEPAGE="https://github.com/crakem/xlogin" SRC_URI="https://github.com/crakem/xlogin/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" #SRC_URI="https://github.com/crakem/xlogin/archive/refs/tags/v0.43.0/${P}.tar.gz" LICENSE="GPL-3+" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="pam systemd" #RDEPEND="pam? ( >=sys-libs/pam-1.5.1 ) RDEPEND=" pam? ( sys-libs/pam ) !pam? ( virtual/libcrypt ) sys-apps/util-linux x11-apps/xauth" DEPEND="pam? ( sys-libs/pam )" BDEPEND="" src_configure() { #append-ldflags -Wl,-z,relro,-z,now econf \ --sysconfdir=/etc/${PN} \ --bindir=/bin \ $(use_with pam) } src_install() { emake DESTDIR="${D}" install dostrip "{D}"/bin/xlogin fperms 0750 /bin/xlogin } pkg_preinst() { if use pam;then mkdir -p ${D}/etc/pam.d cp ${ROOT}/etc/pam.d/login ${D}/etc/pam.d/xlogin fi if use systemd;then servicedir=${D}/etc/systemd/system/getty\@tty7.service.d mkdir -p ${servicedir} mv ${D}/etc/xlogin/xlogin.conf ${servicedir}/. else #change vt7 line in /etc/inittab (incluir linea debajor de c6, con c7) if ! grep "^c7" /etc/inittab >/dev/null; then #do nothing if has c7 if grep "agetty.*tty6" /etc/inittab >/dev/null; then #agetty sed '/^c6/{p;s/c6\(.*\)$/c7\1 -R -l \/bin\/xlogin/}' ${ROOT}/etc/inittab > ${D}/etc/inittab else #mingetty sed '/^c6/{p;s/c6\(.*\)$/c7\1 -l \/bin\/xlogin/}' ${ROOT}/etc/inittab > ${D}/etc/inittab fi fi fi #ebuild don't preserve tar file prop chmod +x ${D}/etc/xlogin/Xsession } pkg_postrm() { if use pam;then rm ${ROOT}/etc/pam.d/xlogin fi }