Name: ly Version: 1.3.1 Release: 1%{?dist} Summary: A lightweight TUI display manager for Linux and BSD License: WTFPL URL: https://github.com/fairyglade/ly Source0: https://github.com/fairyglade/ly/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz # These point to your local files within the 'selinux' directory of your repo Source1: selinux/ly.te Source2: selinux/ly.fc Source3: selinux/Makefile BuildRequires: zig >= 0.15.0 BuildRequires: pam-devel BuildRequires: libxcb-devel BuildRequires: systemd-rpm-macros BuildRequires: gcc BuildRequires: make Requires: pam Requires: libxcb Requires: xorg-x11-server-Xorg Requires: xorg-x11-xauth Requires: systemd # SELinux configuration %if 0%{?fedora} || 0%{?rhel} >= 8 %global with_selinux 1 %global selinuxtype targeted %global modulename ly BuildRequires: selinux-policy-devel %endif %description Ly is a lightweight TUI (ncurses-like) display manager for Linux and BSD. %if 0%{?with_selinux} %package selinux Summary: SELinux policy module for ly display manager BuildArch: noarch Requires: %{name} = %{version}-%{release} Requires: selinux-policy-%{selinuxtype} %description selinux This package contains the SELinux policy module for the ly display manager. %endif %prep %autosetup -n %{name}-%{version} %build # Build the main binary using zig zig build -Doptimize=ReleaseSafe -Dinit_system=systemd %if 0%{?with_selinux} # Create a dedicated build directory for SELinux and copy local sources mkdir -p selinux-build cp %{SOURCE1} %{SOURCE2} %{SOURCE3} selinux-build/ cd selinux-build # Build the policy module make all bzip2 -9 %{modulename}.pp cd .. %endif %install # Install the main application DESTDIR=%{buildroot} zig build install -Doptimize=ReleaseSafe -Dinit_system=systemd --prefix /usr # Create necessary directories mkdir -p %{buildroot}%{_unitdir} mkdir -p %{buildroot}%{_sysconfdir}/pam.d # Install systemd service cat > %{buildroot}%{_unitdir}/ly@.service << 'EOF' [Unit] Description=Ly display manager on %I After=systemd-user-sessions.service plymouth-quit-wait.service After=getty@%i.service Before=getty@%i.service Conflicts=getty@%i.service [Service] Type=idle ExecStart=/usr/bin/ly StandardInput=tty TTYPath=/dev/%I TTYReset=yes TTYVHangup=yes [Install] WantedBy=graphical.target Alias=display-manager.service EOF # Install PAM configuration cat > %{buildroot}%{_sysconfdir}/pam.d/ly << 'EOF' #%PAM-1.0 auth include system-auth auth optional pam_gnome_keyring.so account include system-auth password include system-auth session include system-auth session optional pam_gnome_keyring.so auto_start EOF %if 0%{?with_selinux} # Install the compiled SELinux policy install -D -m 644 selinux-build/%{modulename}.pp.bz2 %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.bz2 %endif %post %systemd_post ly@tty2.service %if 0%{?with_selinux} %post selinux %selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.bz2 if /usr/sbin/selinuxenabled ; then /sbin/restorecon -R %{_bindir}/ly %{_sysconfdir}/ly /var/log/ly.log &> /dev/null || : fi %endif %preun %systemd_preun ly@tty2.service %postun %systemd_postun_with_restart ly@tty2.service %if 0%{?with_selinux} %postun selinux if [ $1 -eq 0 ]; then %selinux_modules_uninstall -s %{selinuxtype} %{modulename} if /usr/sbin/selinuxenabled ; then /sbin/restorecon -R %{_bindir}/ly %{_sysconfdir}/ly &> /dev/null || : fi fi %endif %files %license license.md %doc readme.md %{_bindir}/ly %config(noreplace) %{_sysconfdir}/ly/config.ini %config(noreplace) %{_sysconfdir}/pam.d/ly %{_unitdir}/ly@.service %dir %{_sysconfdir}/ly %dir %{_datadir}/ly %{_datadir}/ly/* %if 0%{?with_selinux} %files selinux %{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.bz2 %ghost %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{modulename} %endif %changelog * Tue Feb 03 2026 Package Maintainer - 1.3.1-1 - Migrated to Multiple Source method for reliable Copr builds - Removed dependency on .copr/Makefile - Fixed directory structure for SELinux building