add: kopia (#9450) (#9464)

* add: kopia

* validate installed desktop file

* use `%{evr}` macro

* add missing period in description

(cherry picked from commit 07e3950633)

Co-authored-by: metcya <134973769+metcya@users.noreply.github.com>
This commit is contained in:
Raboneko
2026-01-23 20:24:36 -08:00
committed by GitHub
parent b94dd7d3c4
commit 7fa14d38c2
6 changed files with 123 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
project pkg {
rpm {
spec = "kopia.spec"
}
}
@@ -0,0 +1,13 @@
diff --git a/app/package.json b/app/package.json
index bd3a699a..df05befa 100644
--- a/app/package.json
+++ b/app/package.json
@@ -45,7 +45,7 @@
],
"directories": {
"buildResources": "assets",
- "output": "../dist/kopia-ui"
+ "output": "./dist"
},
"nsis": {
"oneClick": false,
+7
View File
@@ -0,0 +1,7 @@
[Desktop Entry]
Type=Application
Terminal=false
Name=KopiaUI
Comment=Fast and secure open-source backup/restore tool
Exec=kopia-ui
Icon=kopia
+13
View File
@@ -0,0 +1,13 @@
<component>
<name>KopiaUI</name>
<summary>
A backup/restore tool that allows you to create encrypted snapshots
</summary>
<categories>
<category>System</category>
<category>Network</category>
</categories>
<provides>
<binary>kopia-ui</binary>
</provides>
</component>
+84
View File
@@ -0,0 +1,84 @@
%global appid io.kopia.ui
%global appstream_component desktop-application
Name: kopia
%electronmeta -D
Version: 0.22.3
Release: 1%{?dist}
Summary: A backup/restore tool that allows you to create encrypted snapshots
License: Apache-2.0 AND CC0-1.0 AND %{electron_license}
URL: https://kopia.io/
Source0: https://github.com/kopia/kopia/archive/v%{version}.tar.gz
Source1: io.kopia.ui.desktop
Source2: io.kopia.ui.metainfo.xml
Patch0: fix-electron-output-dir.patch
ExclusiveArch: %{golang_arches_future}
Packager: metcya <metcya@gmail.com>
BuildRequires: go-rpm-macros
BuildRequires: terra-appstream-helper
%global gui_name %{name}-ui
%package -n %{gui_name}
Summary: GUI for %{name}
Requires: %{name} = %{evr}
ExclusiveArch: %{electron_arches}
%description
Kopia is a fast and secure open-source backup/restore tool that allows you to
create encrypted snapshots of your data and save the snapshots to remote or
cloud storage of your choice, to network-attached storage or server, or locally
on your machine. Kopia does not 'image' your whole machine. Rather, Kopia
allows you to backup/restore any and all files/directories that you deem are
important or critical.
%description -n %{gui_name}
A graphical user interface for %{name}.
%prep
%autosetup -p1
%build
%global gomodulesmode GO111MODULE=on
%gobuild -o %{name} .
pushd app
%npm_build -B
popd
%install
install -Dm 755 %{name} -t %{buildroot}%{_bindir}
pushd app
%electron_install -b %{gui_name} -d %{gui_name} -s %{gui_name} -I ../icons
popd
# the offical package for kopia-ui includes a bundled copy of the kopia binary
# but we'll just symlink it
mkdir -p %{buildroot}%{_libdir}/%{gui_name}/resources/server
%{__ln_s} %{_bindir}/%{name} %{buildroot}%{_libdir}/%{gui_name}/resources/server/%{name}
%desktop_file_install %{S:1}
%terra_appstream -o %{S:2}
%check
%desktop_file_validate %{buildroot}%{_appsdir}/%{appid}.desktop
%files
%license README.md
%doc LICENSE
%{_bindir}/%{name}
%files -n %{gui_name}
%{_bindir}/%{gui_name}
%{_libdir}/%{gui_name}/
%{_appsdir}/%{appid}.desktop
%{_metainfodir}/%{appid}.metainfo.xml
%{_hicolordir}/*/apps/kopia.png
%changelog
* Thu Jan 22 2026 metcya <metcya@gmail.com> - 0.22.3-1
- Initial package
+1
View File
@@ -0,0 +1 @@
rpm.version(gh("kopia/kopia"));