# Podmíněně definujeme název balíčku %if 0%{?git_build} Name: auto-wlr-randr-git %else Name: auto-wlr-randr %endif Version: 1.0.0 Release: 1.20250819170221552180.main%{?dist} Summary: Automatic display configuration for Wayland compositors License: GPL-3.0-or-later URL: https://github.com/nikromen/auto-wlr-randr # Zdroj se liší: pro stabilní verzi je to tag, pro git verzi Packit vytvoří archiv sám %if 0%{?git_build} # Pro git buildy Packit vytvoří zdrojový archiv z aktuálního commmitu. # Název archivu bude odpovídat Name a Version, které Packit nastaví. Source0: auto-wlr-randr-1.0.0.tar.gz %else # Pro stabilní buildy použijeme tarball z GitHub releasu Source0: %{url}/archive/refs/tags/auto-wlr-randr-%{version}.tar.gz %endif BuildRequires: rust-packaging >= 21 BuildRequires: gcc BuildRequires: cargo BuildRequires: systemd-rpm-macros BuildRequires: wayland-devel Requires: wlr-randr # Pro git balíček přidáme Provides/Obsoletes, aby mohl nahradit stabilní verzi %if 0%{?git_build} Provides: auto-wlr-randr = %{version}-%{release} Obsoletes: auto-wlr-randr < %{version}-%{release} %endif %description auto-wlr-randr is a daemon that automatically manages display configurations for Wayland compositors implementing the wlr-output-management protocol. It detects connected displays and applies appropriate configuration profiles, making multi-monitor setups seamless in Wayland environments. %if 0%{?git_build} This is a development build from the main branch. %endif %prep %autosetup -n auto-wlr-randr-1.0.0 %build %{cargo_build} %install %{cargo_install} install -Dpm 0755 %{cargo_bin_path}/%{name} %{buildroot}%{_bindir}/%{name} install -Dpm 0755 %{cargo_bin_path}/%{name}ctl %{buildroot}%{_bindir}/%{name}ctl # Install systemd user unit file mkdir -p %{buildroot}%{_userunitdir} mkdir -p %{buildroot}%{_datadir}/auto-wlr-randr # Install example config install -Dpm 0644 config.toml %{buildroot}%{_datadir}/auto-wlr-randr/config.toml.example %check %{cargo_test} %files %license LICENSE %doc README.md %{_bindir}/%{name} %{_bindir}/%{name}ctl # Instalační skripty pro systemd unit file chybí, ale to je mimo rozsah tohoto dotazu # Pokud by byly, musely by být zde: # %{_userunitdir}/%{name}.service %{_datadir}/auto-wlr-randr/config.toml.example %changelog %autochangelog