From d2826344e0ced758e42d9204bc9a2371535276c0 Mon Sep 17 00:00:00 2001 From: Sam Day Date: Sun, 2 Feb 2025 22:24:01 +0100 Subject: [PATCH] treewide: Packaging overhaul Running phrog as a proper greeter session under greetd is a rather complex and delicate endeavour. It also differs in many subtle ways across different distros. So instead of trying to document this stuff, or provide examples, let's just distribute fully-formed prescriptive configs for each distro. For now this means Fedora and Alpine since I have the most familiarity with them (and use them on a regular basis), but I want to pull Debian in eventually, too. On Alpine, the init.d script already has support for easily specifying a separate config file, so we don't need to ship a separate init script. So all a user needs to do here is drop a cfgfile= into their /etc/conf.d/greetd. On Fedora, a distinct phrog.service unit is introduced which conflicts with greetd's default greetd.service. For now, the only difference this service has to the default is a --config arg. Later, when we support Plymouth flicker-free boot, it will also Conflict=plymouth-quit.service to take over that process (just like gdm.service does). This commit also introduces the use of gnome-session to run the phrog shell. This ensures auxiliary services like the gsd-* daemons and an OSK are present. Since gnome-session is in place, we also use that to spawn phrog itself, so a .desktop file is now shipped to handle that. Rather than shipping a phrog-session wrapper script like Phosh does, we just embed the necessary incantation into the greetd-phrog.toml, since this is quite distro-specific a distinct copy of this file is maintained in distro/. The example-config/phrog-session introduced recently is deleted in favour of this new setup. (Another reason why the phrog-session wrapper isn't desirable here is that one cannot/shouldn't run the phrog greeter independently, as it expectsto run under greetd and be supplied a GREETD_SOCK) The README is updated and cleaned up a bit to reflect this work. For now, I'm not interested in trying to explain how to get phrog working on an unsupported distro, since a properly working setup requires too many auxiliary bits (session + desktop files) and relies on too many things that differ wildly across every. frigging. distro. Instead, the README just directs interested folks to get in touch. Signed-off-by: Sam Day --- APKBUILD | 4 +++ README.md | 45 ++++++++++++++++++++++------------ data/mobi.phosh.Phrog.desktop | 6 +++++ data/phrog.session | 3 +++ dist/alpine/greetd-config.toml | 10 ++++++++ dist/fedora/greetd-config.toml | 5 ++++ dist/fedora/phrog.service | 20 +++++++++++++++ example-config/phrog-session | 45 ---------------------------------- example-config/phrog.toml | 8 ------ phrog.spec | 14 +++++++++-- 10 files changed, 90 insertions(+), 70 deletions(-) create mode 100644 data/mobi.phosh.Phrog.desktop create mode 100644 data/phrog.session create mode 100644 dist/alpine/greetd-config.toml create mode 100644 dist/fedora/greetd-config.toml create mode 100644 dist/fedora/phrog.service delete mode 100755 example-config/phrog-session delete mode 100644 example-config/phrog.toml diff --git a/APKBUILD b/APKBUILD index 93d0f62d..25a9ec6e 100644 --- a/APKBUILD +++ b/APKBUILD @@ -39,6 +39,10 @@ build() { package() { install -Dm644 data/mobi.phosh.phrog.gschema.xml -t "$pkgdir"/usr/share/glib-2.0/schemas/ + install -Dm644 data/phrog.session -t "$pkgdir"/usr/share/gnome-session/sessions/ + install -Dm644 data/mobi.phosh.Phrog.desktop -t "$pkgdir"/usr/share/applications/ + install -Dm644 dist/alpine/greetd-config.toml -T "$pkgdir"/etc/greetd/phrog.toml + install -d "$pkgdir"/usr/share/phrog/autostart install -Dm755 target/release/phrog -t "$pkgdir"/usr/bin/ } diff --git a/README.md b/README.md index 5e4f7cc7..315e1e62 100644 --- a/README.md +++ b/README.md @@ -14,31 +14,35 @@ It is the spiritual successor of [phog][].
-## Installation +## Usage -* Alpine (v3.21+): `apk add greetd-phrog` -* Fedora ([COPR][]): `sudo dnf copr enable samcday/phrog && sudo dnf install phrog` -* Other: you must build from source, see the Development section below. +### Alpine/postmarketOS -## Running +``` +apk add greetd-phrog -`phrog` is a [greetd][] "greeter". To use it, make sure your `/etc/greetd/config.toml` looks like this: +# Configure greetd to run phrog: +cat >> /etc/conf.d/greetd < LICENSE.dependencies %install -install -d %{buildroot}%{_datadir}/glib-2.0/schemas/ %{__install} -Dpm 0644 data/mobi.phosh.phrog.gschema.xml %{buildroot}%{_datadir}/glib-2.0/schemas/ +%{__install} -Dpm 0644 data/phrog.session %{buildroot}%{_datadir}/gnome-session/sessions/ +%{__install} -Dpm 0644 data/mobi.phosh.Phrog.desktop %{buildroot}%{_datadir}/applications/ +%{__install} -Dpm 0644 dist/fedora/greetd-config.toml %{buildroot}%{_sysconfdir}/greetd/phrog.toml +%{__install} -Dpm 0644 dist/fedora/phrog.service %{buildroot}%{_unitdir}/ +%{__install} -d %{buildroot}%{_datadir}/phrog/autostart %cargo_install %if %{with check} @@ -49,8 +53,14 @@ install -d %{buildroot}%{_datadir}/glib-2.0/schemas/ %files %license LICENSE %doc README.md -%{_datadir}/glib-2.0/schemas/* %{_bindir}/phrog +%{_datadir}/applications/mobi.phosh.Phrog.desktop +%{_datadir}/glib-2.0/schemas/mobi.phosh.phrog.gschema.xml +%{_datadir}/gnome-session/sessions/phrog.session +%{_datadir}/phrog +%{_datadir}/phrog/autostart +%config(noreplace) %{_sysconfdir}/greetd/phrog.toml +%{_unitdir}/phrog.service %changelog %autochangelog