%global tag v1.3.1 %global pkg_version 1.3.1 # Zig binaries and Fedora debuginfo generators don't get along; disable it. %global debug_package %{nil} %global _missing_build_ids_terminate_build 0 Name: ly Version: %{pkg_version} Release: 1%{?dist} Summary: A lightweight TUI display manager for Linux and BSD License: WTFPL URL: https://github.com/fairyglade/ly Source0: %{url}/archive/%{tag}/%{name}-%{tag}.tar.gz BuildRequires: zig BuildRequires: systemd-devel BuildRequires: pam-devel BuildRequires: libxcb-devel Requires: pam Requires: xauth Requires: systemd %description Ly is a lightweight TUI display manager. This version is built with Zig and includes all necessary translation files and systemd integration. %prep %autosetup -n %{name}-%{pkg_version} %build export ZIG_GLOBAL_CACHE_DIR=$(pwd)/.zig-cache # We use 'zig build' which should populate 'zig-out' zig build -Doptimize=ReleaseSafe -Dinit_system=systemd --summary all %install # 1. Install the binary install -D -p -m 0755 zig-out/bin/ly %{buildroot}%{_bindir}/ly # 2. Install the configuration file install -D -p -m 0644 res/config.ini %{buildroot}%{_sysconfdir}/ly/config.ini # 3. LOCATE AND INSTALL THE SERVICE FILE # Instead of guessing the path, we find it in the zig-out directory. # This prevents the "No such file or directory" error. SERVICE_PATH=$(find zig-out -name "ly.service" | head -n 1) if [ -z "$SERVICE_PATH" ]; then # Fallback to the source directory if Zig didn't move it SERVICE_PATH="res/ly.service" fi install -D -p -m 0644 "$SERVICE_PATH" %{buildroot}%{_unitdir}/ly.service # 4. Install language files mkdir -p %{buildroot}%{_datadir}/ly cp -r res/lang %{buildroot}%{_datadir}/ly/ %post %systemd_post ly.service %preun %systemd_preun ly.service %postun %systemd_postun_with_restart ly.service %files %license license.md %doc readme.md %{_bindir}/ly %dir %{_sysconfdir}/ly %config(noreplace) %{_sysconfdir}/ly/config.ini %{_unitdir}/ly.service %{_datadir}/ly/ %changelog * Sat Jan 31 2026 Your Name - 1.3.1-1 - Robust service file installation using 'find' - Fixed zig-out pathing for Fedora 43