%global debug_package %{nil} Name: stoat Version: %{lua: local f = io.popen("curl -s https://raw.githubusercontent.com/stoatchat/for-desktop/main/package.json | grep '\"version\"' | head -n1 | sed 's/.*\"version\": \"\\([^\"]*\\)\".*/\\1/'") local v = f:read("*a") or "" f:close() v = v:gsub("%s+", "") print(v) } Release: 1%{?dist} Summary: Stoat — official Stoat desktop client Group: Applications/Internet License: AGPL-3.0 URL: https://github.com/stoatchat/for-desktop Source0: https://github.com/stoatchat/for-desktop/releases/download/v%{version}/Stoat-linux-x64-%{version}.zip Requires: gtk3 Requires: libXScrnSaver Requires: libnotify Requires: nss Requires: libuuid %description Stoat is the official Electron-based desktop client for the Stoat chat platform. %prep %autosetup -c -T unzip %{SOURCE0} -d stoat %build # Nothing to build; precompiled Electron app %install mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_datadir}/stoat mkdir -p %{buildroot}%{_datadir}/applications mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps mkdir -p %{buildroot}%{_docdir}/stoat mkdir -p %{buildroot}/usr/share/licenses/stoat # Copy all files from prebuilt binary cp -a stoat/* %{buildroot}%{_datadir}/stoat/ # Ensure main binary is executable chmod 755 %{buildroot}%{_datadir}/stoat/stoat-desktop || true chmod 755 %{buildroot}%{_datadir}/stoat/chrome-sandbox || true # Create a wrapper for /usr/bin/stoat install -Dm755 /dev/stdin %{buildroot}%{_bindir}/stoat << "EOF" #!/bin/sh exec /usr/share/stoat/stoat-desktop "$@" EOF # .desktop file cat > %{buildroot}%{_datadir}/applications/stoat.desktop << "EOF" [Desktop Entry] Name=Stoat Comment=Stoat — official desktop client Exec=/usr/bin/stoat Icon=stoat Terminal=false Type=Application Categories=Network;Chat; StartupWMClass=Stoat EOF # Fetch icon and docs curl -sL https://raw.githubusercontent.com/stoatchat/stoat.chat/5f51327088acddb0f5b20e355b15ae54be0893e2/public/favicon.svg \ -o %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/stoat.svg curl -sL https://raw.githubusercontent.com/stoatchat/for-desktop/main/README.md \ -o %{buildroot}%{_docdir}/stoat/README.md curl -sL https://raw.githubusercontent.com/stoatchat/for-desktop/main/LICENSE \ -o %{buildroot}/usr/share/licenses/stoat/LICENSE %files %license /usr/share/licenses/stoat/LICENSE %doc %{_docdir}/stoat/README.md %{_bindir}/stoat %{_datadir}/stoat/ %{_datadir}/applications/stoat.desktop %{_datadir}/icons/hicolor/scalable/apps/stoat.svg %changelog * Mon Nov 10 2025 Copr Auto Build - Initial version (binary package)