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
License: AGPL-3.0
URL: https://github.com/stoatchat/for-desktop
Source0: https://codeload.github.com/stoatchat/for-desktop/tar.gz/refs/heads/main
BuildRequires: nodejs >= 18
BuildRequires: pnpm
BuildRequires: git
BuildRequires: desktop-file-utils
Requires: gtk3
Requires: libXScrnSaver
Requires: libnotify
%description
Stoat is the official Electron-based desktop client for the Stoat chat platform.
%prep
rm -rf stoat
git clone --depth 1 --recursive https://github.com/stoatchat/for-desktop.git stoat
cd stoat
git -c submodule."assets".update=checkout submodule update --init assets
# Generate AppStream XML in the source tree
cat > stoat.metainfo.xml << "EOF"
stoat.desktop
Stoat
Stoat — official Stoat desktop client
AGPL-3.0
AGPL-3.0
https://github.com/stoatchat/for-desktop
stoat
stoat
Network
Chat
EOF
%build
cd %{_builddir}/stoat
pnpm i --frozen-lockfile
pnpm package
%install
# Directories
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_datadir}/stoat
mkdir -p %{buildroot}%{_datadir}/applications
mkdir -p %{buildroot}%{_docdir}/stoat
mkdir -p %{buildroot}/usr/share/licenses/stoat/
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
mkdir -p %{buildroot}%{_datadir}/metainfo
install -Dm644 %{_builddir}/stoat/stoat.metainfo.xml %{buildroot}%{_datadir}/metainfo/stoat.metainfo.xml
# Copy all Stoat binaries/resources to /usr/share/stoat
cp -a %{_builddir}/stoat/out/Stoat-linux-x64/* %{buildroot}%{_datadir}/stoat/
chmod 755 %{buildroot}%{_datadir}/stoat/stoat-desktop
chmod 755 %{buildroot}%{_datadir}/stoat/chrome-sandbox
# Create wrapper in /usr/bin/stoat (overwrite if exists)
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=/usr/share/icons/hicolor/scalable/apps/stoat.svg
Terminal=false
Type=Application
Categories=Network;Chat;
StartupWMClass=Stoat
EOF
# Fetch README.md and LICENSE
curl -sL https://raw.githubusercontent.com/stoatchat/for-desktop/main/README.md \
-o %{buildroot}/usr/share/doc/stoat/README.md
curl -sL https://raw.githubusercontent.com/stoatchat/for-desktop/main/LICENSE \
-o %{buildroot}/usr/share/licenses/stoat/LICENSE
# Fetch SVG icon for .desktop
curl -sL https://raw.githubusercontent.com/stoatchat/stoat.chat/5f51327088acddb0f5b20e355b15ae54be0893e2/public/favicon.svg \
-o %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/stoat.svg
%files
%license /usr/share/licenses/stoat/LICENSE
%doc %{_docdir}/stoat/README.md
%{_bindir}/stoat
%{_datadir}/applications/stoat.desktop
%{_datadir}/stoat/*
%{_datadir}/icons/hicolor/scalable/apps/stoat.svg
%{_datadir}/metainfo/stoat.metainfo.xml
%changelog
* Mon Nov 10 2025 Copr Auto Build
- Automated build from latest upstream master