From e3fd01f50a630880528f6766d70af07073e79033 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Feb 24 2016 00:26:54 +0000 Subject: Add upstream patch for aarch64, Use %%license --- diff --git a/0001-Add-linux_arm64-support.patch b/0001-Add-linux_arm64-support.patch new file mode 100644 index 0000000..1a84614 --- /dev/null +++ b/0001-Add-linux_arm64-support.patch @@ -0,0 +1,79 @@ +From a0fde42296592b3bee4503370464b5789cf83440 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lucas=20K=C3=A4ldstr=C3=B6m?= + +Date: Thu, 28 Jan 2016 07:48:12 +0200 +Subject: [PATCH 1/4] Add linux_arm64 support + +--- + internal/remote/output_interceptor_unix.go | 9 ++++++--- + internal/remote/syscall_dup_linux_arm64.go | 11 +++++++++++ + internal/remote/syscall_dup_unix.go | 10 ++++++++++ + 3 files changed, 27 insertions(+), 3 deletions(-) + create mode 100644 internal/remote/syscall_dup_linux_arm64.go + create mode 100644 internal/remote/syscall_dup_unix.go + +diff --git a/internal/remote/output_interceptor_unix.go b/internal/remote/output_interceptor_unix.go +index 181b227..1235ad0 100644 +--- a/internal/remote/output_interceptor_unix.go ++++ b/internal/remote/output_interceptor_unix.go +@@ -6,7 +6,6 @@ import ( + "errors" + "io/ioutil" + "os" +- "syscall" + ) + + func NewOutputInterceptor() OutputInterceptor { +@@ -31,8 +30,12 @@ func (interceptor *outputInterceptor) StartInterceptingOutput() error { + return err + } + +- syscall.Dup2(int(interceptor.redirectFile.Fd()), 1) +- syscall.Dup2(int(interceptor.redirectFile.Fd()), 2) ++ // Call a function in ./syscall_dup_*.go ++ // If building for everything other than linux_arm64, ++ // use a "normal" syscall.Dup2(oldfd, newfd) call. If building for linux_arm64 (which doesn't have syscall.Dup2) ++ // call syscall.Dup3(oldfd, newfd, 0). They are nearly identical, see: http://linux.die.net/man/2/dup3 ++ syscallDup(int(interceptor.redirectFile.Fd()), 1) ++ syscallDup(int(interceptor.redirectFile.Fd()), 2) + + return nil + } +diff --git a/internal/remote/syscall_dup_linux_arm64.go b/internal/remote/syscall_dup_linux_arm64.go +new file mode 100644 +index 0000000..5c59728 +--- /dev/null ++++ b/internal/remote/syscall_dup_linux_arm64.go +@@ -0,0 +1,11 @@ ++// +build linux,arm64 ++ ++package remote ++ ++import "syscall" ++ ++// linux_arm64 doesn't have syscall.Dup2 which ginkgo uses, so ++// use the nearly identical syscall.Dup3 instead ++func syscallDup(oldfd int, newfd int) (err error) { ++ return syscall.Dup3(oldfd, newfd, 0) ++} +\ No newline at end of file +diff --git a/internal/remote/syscall_dup_unix.go b/internal/remote/syscall_dup_unix.go +new file mode 100644 +index 0000000..b0111d1 +--- /dev/null ++++ b/internal/remote/syscall_dup_unix.go +@@ -0,0 +1,10 @@ ++// +build !linux !arm64 ++// +build !windows ++ ++package remote ++ ++import "syscall" ++ ++func syscallDup(oldfd int, newfd int) (err error) { ++ return syscall.Dup2(oldfd, newfd) ++} +\ No newline at end of file +-- +2.5.0 + diff --git a/golang-github-onsi-ginkgo.spec b/golang-github-onsi-ginkgo.spec index 81efc30..ab50462 100644 --- a/golang-github-onsi-ginkgo.spec +++ b/golang-github-onsi-ginkgo.spec @@ -19,13 +19,6 @@ %global debug_package %{nil} %endif -%define copying() \ -%if 0%{?fedora} >= 21 || 0%{?rhel} >= 7 \ -%license %{*} \ -%else \ -%doc %{*} \ -%endif - %global provider github %global provider_tld com %global project onsi @@ -38,11 +31,13 @@ Name: golang-%{provider}-%{project}-%{repo} Version: 1.1.0 -Release: 6%{?dist} +Release: 7%{?dist} Summary: A Golang BDD Testing Framework License: MIT URL: https://%{provider_prefix} Source0: https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz +# Upstream fix for aarch64 a0fde42 +Patch1: 0001-Add-linux_arm64-support.patch # If go_arches not defined fall through to implicit golang archs %if 0%{?go_arches:1} @@ -101,18 +96,6 @@ building other packages which use import path with %if 0%{?with_unit_test} %package unit-test Summary: Unit tests for %{name} package -# If go_arches not defined fall through to implicit golang archs -%if 0%{?go_arches:1} -ExclusiveArch: %{go_arches} -%else -ExclusiveArch: %{ix86} x86_64 %{arm} -%endif -# If gccgo_arches does not fit or is not defined fall through to golang -%ifarch 0%{?gccgo_arches} -BuildRequires: gcc-go >= %{gccgo_min_vers} -%else -BuildRequires: golang -%endif %if 0%{?with_check} #Here comes all BuildRequires: PACKAGE the unit tests @@ -131,6 +114,7 @@ providing packages with %{import_path} prefix. %prep %setup -q -n %{repo}-%{commit} +%patch1 -p1 -b .arm64 %build @@ -188,7 +172,8 @@ gotest %{import_path}/types %if 0%{?with_devel} %files devel -f devel.file-list -%copying LICENSE +%{!?_licensedir:%global license %%doc} +%license LICENSE %doc CHANGELOG.md README.md %dir %{gopath}/src/%{provider}.%{provider_tld}/%{project} %dir %{gopath}/src/%{import_path} @@ -196,11 +181,16 @@ gotest %{import_path}/types %if 0%{?with_unit_test} %files unit-test -f unit-test.file-list -%copying LICENSE +%{!?_licensedir:%global license %%doc} +%license LICENSE %doc CHANGELOG.md README.md %endif %changelog +* Tue Feb 23 2016 Peter Robinson 1.1.0-7 +- Add patch for aarch64 +- Use %%license + * Mon Feb 22 2016 Fedora Release Engineering - 1.1.0-6 - https://fedoraproject.org/wiki/Changes/golang1.6