!6 [sync] PR-4: Add sw_64 and mips64el support

From: @openeuler-sync-bot 
Reviewed-by: @xingwei-liu 
Signed-off-by: @xingwei-liu
This commit is contained in:
openeuler-ci-bot 2025-03-11 06:39:36 +00:00 committed by Gitee
commit bb1865e93e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 27 additions and 1 deletions

View File

@ -0,0 +1,12 @@
diff -Naur a/build.go b/build.go
--- a/build.go 2023-10-30 02:50:07.000000000 +0800
+++ b/build.go 2024-12-10 19:36:17.460157795 +0800
@@ -127,7 +127,7 @@
a := []string{"build", "-trimpath"}
if enablePIE {
- a = append(a, "-buildmode=pie")
+ a = append(a, "-buildmode=exe")
}
a = append(a, args...)

View File

@ -3,7 +3,7 @@
Name: restic
Version: 0.16.2
Release: 1
Release: 2
Summary: Backup program with deduplication and encryption
License: BSD-2-Clause
Group: Productivity/Archiving/Backup
@ -16,6 +16,8 @@ BuildRequires: bash-completion
BuildRequires: zsh
BuildRequires: golang >= 1.18
Patch0001: 0001-restic-uos-add-sw_64-and-mips64el.patch
%description
restic is a backup program. It supports verification, encryption,
snapshots and deduplication.
@ -42,6 +44,9 @@ Zsh command line completion support for %{name}.
%prep
%setup -q -a 3
%ifarch sw_64 mips64el
%patch1 -p1
%endif
%build
# Set up GOPATH.
@ -52,9 +57,15 @@ cp -rT $PWD $HOME/go/src/%{import_path}
# Build restic. We don't use build.go because it builds statically, uses go
# modules, and also restricts the Go version in cases where it's not actually
# necessary. We disable go modules because restic still provides a vendor/.
%ifarch sw_64 mips64el
GO111MODULE=off go build -o %{name} -buildmode=exe \
-ldflags "-s -w -X main.version=%{version}" \
%{import_path}/cmd/restic
%else
GO111MODULE=off go build -o %{name} -buildmode=pie \
-ldflags "-s -w -X main.version=%{version}" \
%{import_path}/cmd/restic
%endif
%install
install -D -m0755 %{name} %{buildroot}%{_bindir}/%{name}
@ -78,6 +89,9 @@ install -Dm0644 doc/zsh-completion.zsh %{buildroot}%{_sysconfdir}/zsh_completion
%config %{_sysconfdir}/zsh_completion.d/%{name}
%changelog
* Fri Feb 28 2025 zhangshaoning <zhangshaoning@uniontech.com> - 0.16.2-2
- Add sw_64 and mips64el support
* Wed Jan 03 2024 Paul Thomas <paulthomas100199@gmail.com> 0.16.2-1
- update to version 0.16.2