commit:     211c116fa68caf140df10fbae290eddfe5835cfc
Author:     Remigiusz Micielski <rmicielski <AT> purelymail <DOT> com>
AuthorDate: Wed Sep 13 08:32:36 2023 +0000
Commit:     David Roman <davidroman96 <AT> gmail <DOT> com>
CommitDate: Wed Sep 13 08:32:36 2023 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=211c116f

gui-apps/lemurs: fix shutdown and reboot on non-systemd systems

Signed-off-by: Remigiusz Micielski <rmicielski <AT> purelymail.com>

 gui-apps/lemurs/lemurs-0.3.1-r1.ebuild | 145 +++++++++++++++++++++++++++++++++
 1 file changed, 145 insertions(+)

diff --git a/gui-apps/lemurs/lemurs-0.3.1-r1.ebuild 
b/gui-apps/lemurs/lemurs-0.3.1-r1.ebuild
new file mode 100644
index 0000000000..d659cf07ba
--- /dev/null
+++ b/gui-apps/lemurs/lemurs-0.3.1-r1.ebuild
@@ -0,0 +1,145 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+CRATES="
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]+wasi-snapshot-preview1
+       [email protected]
+       [email protected]
+       [email protected]
+"
+
+inherit cargo pam systemd
+
+DESCRIPTION="A TUI Display/Login Manager"
+HOMEPAGE="https://github.com/coastalwhite/lemurs";
+SRC_URI="https://github.com/coastalwhite/lemurs/archive/refs/tags/v${PV}.tar.gz
 -> ${P}.tar.gz \
+${CARGO_CRATE_URIS}"
+
+LICENSE="Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD MIT Unicode-DFS-2016"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="systemd"
+
+DEPEND=""
+RDEPEND="${DEPEND}
+                               sys-libs/pam
+                               systemd? ( sys-apps/systemd:= )
+                               !systemd? ( sys-apps/kbd )
+"
+BDEPEND=""
+
+QA_FLAGS_IGNORED="usr/bin/lemurs"
+
+src_prepare() {
+       eapply_user
+       # Run lemurs on tty7 so it doesn't conflict with agetty
+       # And replace systemd's reboot and shutdown commands
+       if ! use systemd ; then
+               sed -i 's/tty = 2/tty = 7/' "${S}"/extra/config.toml || die 
"Sed on config.toml failed"
+
+               sed -i 's/shutdown_cmd = "systemctl poweroff -l"/shutdown_cmd = 
"poweroff"/' \
+               "${S}"/extra/config.toml || die "Sed on config.toml failed"
+
+               sed -i 's/reboot_cmd = "systemctl reboot -l"/reboot_cmd = 
"reboot"/' \
+               "${S}"/extra/config.toml || die "Sed on config.toml failed"
+       fi
+}
+
+src_install() {
+       dodir /etc/lemurs
+       keepdir /etc/lemurs/{wayland,wms}
+
+       exeinto /etc/lemurs
+       doexe "${S}"/extra/xsetup.sh
+
+       insinto /etc/lemurs
+       doins "${S}"/extra/config.toml
+
+       dodoc "${S}"/README.md
+
+       # Lemur's default PAM doesn't make elogind do its job
+       # i.e. doesn't make /run/user/*
+       newpamd "${FILESDIR}"/lemurs.pam lemurs
+
+       newinitd "${FILESDIR}"/lemurs.initd lemurs
+       systemd_dounit "${S}"/extra/lemurs.service
+
+       dobin target/$(usex debug debug release)/lemurs
+}
+
+pkg_postinst() {
+       elog "Before starting lemurs you have to configure all your WMs/DEs 
manually,"
+       elog "see: https://github.com/coastalwhite/lemurs#usage";
+       elog "and disable your previous display manager."
+       elog
+       if use systemd ; then
+               elog "To start lemurs:"
+               elog "  systemctl start lemurs"
+               elog "To boot it with the system:"
+               elog "  systemctl enable lemurs"
+               ewarn "This package has not yet been tested on a systemd 
system,"
+               ewarn "so it may not function properly."
+               ewarn "If possible, please email the package maintainer to 
confirm that it works (or not):"
+               ewarn
+               ewarn "Remigiusz Micielski <[email protected]>"
+               ewarn
+       else
+               elog "To start lemurs:"
+               elog "  rc-service lemurs start"
+               elog "To boot it with the system:"
+               elog "  rc-update add lemurs"
+       fi
+}

Reply via email to