diff --git a/0001-restic-uos-add-sw_64-and-mips64el.patch b/0001-restic-uos-add-sw_64-and-mips64el.patch new file mode 100644 index 0000000000000000000000000000000000000000..8cd12ddc83118f88569559a0473fba89fd9108f5 --- /dev/null +++ b/0001-restic-uos-add-sw_64-and-mips64el.patch @@ -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...) diff --git a/restic.spec b/restic.spec index 60bf3aa07646b0fb958af4216031a3c86df8bd38..e9c46c77202a2a0dfb081f6b802ecf0efa68677c 100644 --- a/restic.spec +++ b/restic.spec @@ -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 - 0.16.2-2 +- Add sw_64 and mips64el support + * Wed Jan 03 2024 Paul Thomas 0.16.2-1 - update to version 0.16.2