# -*-Mode: rpm-spec -*- %if 0%{!?mkrel:1} %define mkrel(c) %{1}%{?dist} %endif Name: wleave Version: 0.4.0 Release: %mkrel 1 Summary: A Wayland-native logout script written in GTK4 License: MIT URL: https://github.com/AMNatty/wleave Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz Source1: %{name}-%{version}-vendor.tar.xz Source2: config.toml BuildRequires: cargo BuildRequires: make BuildRequires: pkgconfig(scdoc) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(gtk-layer-shell-0) # wlogout hasn't been updated in years, and the PRs aren't even reviewed. # Therefore prefer this maintained fork. # TODO: Mageia 10 RC #Obsoletes: wlogout < 1.2.3 %description A Wayland layer-shell logout prompt! Originally a fork of wlogout, wleave is now natively GTK4 & Libadwaita and has a bunch of added quality-of-life features. %prep %autosetup -a1 -p1 mkdir .cargo cp %{SOURCE2} .cargo %build %__make pushd man for man in %{name}.1 %{name}.5; do scdoc < ${man}.scd > ${man} done popd %install # # Install section adapted from ArchLinux's PKGBUILD script; it's not my fault if this is slightly convoluted. # install -Dm755 target/release/%{name} "%{buildroot}%{_bindir}/%{name}" install -Dm644 -t "%{buildroot}%{_sysconfdir}/%{name}" "style.css" "layout" install -Dm644 "completions/wleave.bash" "%{buildroot}%{_datadir}/bash-completion/completions/wleave" install -Dm644 "completions/_wleave" "%{buildroot}%{_datadir}/zsh/site-functions/_wleave" install -Dm644 "completions/wleave.fish" "%{buildroot}%{_datadir}/fish/vendor_completions.d/wleave.fish" install -Dm644 -t "%{buildroot}%{_datadir}/%{name}/icons" "icons"/* install -Dm644 -t "%{buildroot}%{_mandir}/man1" "man/wleave.1" install -Dm644 -t "%{buildroot}%{_mandir}/man5" "man/wleave.5" %files %{_bindir}/%{name} %{_datadir}/%{name}/ %{_datadir}/bash-completion/ %{_datadir}/fish/ %{_datadir}/zsh/ %dir %{_sysconfdir}/%{name} %license LICENSE %doc README.md %{_mandir}/man1/%{name}.1.* %{_mandir}/man5/%{name}.5.* %config(noreplace) %{_sysconfdir}/%{name}/*