# -*-Mode: rpm-spec -*- %if 0%{!?mkrel:1} %define mkrel(c) %{1}%{?dist} %endif Name: wleave Version: 0.7.1 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 Patch0: wleave-fix-desktop.diff Patch1: wleave-fix-scd.diff BuildRequires: cargo BuildRequires: make BuildRequires: pkgconfig(scdoc) BuildRequires: pkgconfig(gtk4) BuildRequires: pkgconfig(gtk4-layer-shell-0) BuildRequires: pkgconfig(libadwaita-1) BuildRequires: pkgconfig(librsvg-2.0) %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 %{name}.json.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 -Dm644 sh.natty.Wleave.desktop "%{buildroot}%{_datadir}/applications/sh.natty.Wleave.desktop" install -Dm755 target/release/%{name} "%{buildroot}%{_bindir}/%{name}" install -Dm644 -t "%{buildroot}%{_sysconfdir}/%{name}" "style.css" "layout.json" 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}/icons" "icons"/* install -Dm644 -t "%{buildroot}%{_mandir}/man1" "man/wleave.1" install -Dm644 -t "%{buildroot}%{_mandir}/man5" "man/wleave.5" install -Dm644 -t "%{buildroot}%{_mandir}/man5" "man/wleave.json.5" %files %{_bindir}/%{name} %{_datadir}/applications/ %{_datadir}/icons %{_datadir}/bash-completion/ %{_datadir}/fish/ %{_datadir}/zsh/ %dir %{_sysconfdir}/%{name} %license LICENSE %doc README.md %{_mandir}/man1/%{name}.1.* %{_mandir}/man5/%{name}.5.* %{_mandir}/man5/%{name}.json.5.* %config(noreplace) %{_sysconfdir}/%{name}/*