File restic-browser.spec of Package restic-browser

#
# spec file for package restic-browser
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           restic-browser
Version:        0.3.3
Release:        0
Summary:	A restic backup GUI for browsing and restoring restic repositories
License:        MIT
URL:            https://github.com/emuell/restic-browser
Source:         %{name}-%{version}.tar.xz
Source1:        node_modules.spec.inc
Source2:        registry.tar.xz
Source3:	restic-browser.desktop
%include %{_sourcedir}/node_modules.spec.inc
BuildRequires:  gcc-c++
BuildRequires:  cargo
BuildRequires:	rust >= 1.78
BuildRequires:	npm >= 18
BuildRequires:  webkit2gtk3-devel
BuildRequires:  libopenssl-devel
BuildRequires:  local-npm-registry
BuildRequires:  libappindicator3-devel
BuildRequires:  librsvg-devel
Requires:       restic
Requires(post):    desktop-file-utils
Requires(postun):  desktop-file-utils

%description
This is not a fullblown restic backup GUI - it only allows you to browse existing
repositories!

- Displays contents (snapshots, files) from local and remote restic repositories.
- Dumps selected files or folders (as a zip archive) to a desired location.
- Restores selected files or folders to a desired location.
- Opens selected files by moving them to TEMP, then opens them with your operating
  system's default
 
%prep
%autosetup -p1 -a2
rm -f package-lock.json
local-npm-registry %{_sourcedir} install

%build
export CARGO_HOME=$PWD/.cargo
npm run tauri build -- --no-bundle

%install
export CARGO_HOME=$PWD/.cargo
install -s -D src-tauri/target/release/Restic-Browser %{buildroot}%{_bindir}/restic-browser
install -m 644 -D %{SOURCE3} %{buildroot}%{_datadir}/applications/restic-browser.desktop
install -m 644 -D src-tauri/icons/32x32.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/restic-browser.png
install -m 644 -D src-tauri/icons/128x128.png %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/restic-browser.png
install -m 644 -D src-tauri/icons/128x128@2x.png %{buildroot}%{_datadir}/icons/hicolor/128x128@2/apps/restic-browser.png

%post
%desktop_database_post

%postun
%desktop_database_postun

%check

%files
%license LICENSE
%doc README.md
%{_bindir}/restic-browser
%{_datadir}/applications/restic-browser.desktop
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/*x*
%dir %{_datadir}/icons/hicolor/*x*/apps
%{_datadir}/icons/hicolor/*x*/apps/restic-browser.png

%changelog

openSUSE Build Service is sponsored by