File kopia.spec of Package kopia
#
# spec file for package kopia
#
# Copyright (c) 2023 SUSE LLC
#
# 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/
#
%global provider github
%global provider_tld com
%global project kopia
%global repo kopia
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
%global import_path %{provider_prefix}
Name: kopia
Version: 0.14.1
Release: 0
Summary: Cross-platform backup tool written in Go
License: Apache-2.0
Group: Productivity/Archiving/Backup
URL: https://kopia.io
Source: %{name}-%{version}.tar.gz
Source1: vendor.tar.gz
BuildRequires: golang(API) = 1.20
BuildRequires: golang-packaging
BuildRequires: xz
Requires: glibc
Requires: liblua5_3-5
%{go_nostrip}
%{go_provides}
%description
Cross-platform backup tool with fast, incremental backups,
client-side end-to-end encryption, compression and data deduplication.
%prep
%setup -q -a 1
%setup -q -T -D
%build
%{goprep} %{provider_prefix}
export GOFLAGS="$GOFLAGS -buildmode=pie -mod=vendor"
export VERSION=%{version}
export COMMIT=%{commit}
export CGO_ENABLED=0
go build \
-ldflags="-s -w -X \"github.com/kopia/kopia/repo.BuildVersion=v%{version}\" -X \"github.com/kopia/kopia/repo.BuildInfo=$COMMIT\"" \
-o %{name} ;
%install
install -D -m 0755 %{name} "%{buildroot}/%{_bindir}/%{name}"
%files
%license LICENSE
%doc README.md
%{_bindir}/%{name}
%changelog