From 2455c36cb4651d0f04b9486fd8067b2c88239183 Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Jan 21 2017 13:46:51 +0000 Subject: Polish the spec file - related: #1279381 --- diff --git a/golang-googlecode-tools.spec b/golang-googlecode-tools.spec index 42e6a00..764c342 100644 --- a/golang-googlecode-tools.spec +++ b/golang-googlecode-tools.spec @@ -1,22 +1,33 @@ -%if 0%{?fedora} || 0%{?rhel} == 6 +# If any of the following macros should be set otherwise, +# you can wrap any of them with the following conditions: +# - %%if 0%%{centos} == 7 +# - %%if 0%%{?rhel} == 7 +# - %%if 0%%{?fedora} == 23 +# Or just test for particular distribution: +# - %%if 0%%{centos} +# - %%if 0%%{?rhel} +# - %%if 0%%{?fedora} +# +# Be aware, on centos, both %%rhel and %%centos are set. If you want to test +# rhel specific macros, you can use %%if 0%%{?rhel} && 0%%{?centos} == 0 condition. +# (Don't forget to replace double percentage symbol with single one in order to apply a condition) + +# Generate devel rpm %global with_devel 1 +# Build project from bundled dependencies %global with_bundled 0 +# Build with debug info rpm %global with_debug 0 +# Run tests in check section # tests requires golang-docs which is not present on gcc-go archs -%ifarch %{?golang_arches:%{golang_arches}}%{!?golang_arches:%{ix86} x86_64 %{arm}} -%global with_check 0 +%ifarch %{?golang_arches:%{golang_arches}}%{!?golang_arches:%{ix86} x86_64 aarch64 %{arm}} +%global with_check 1 +# Generate unit-test rpm %global with_unit_test 1 %else %global with_check 0 %global with_unit_test 0 %endif -%else -%global with_devel 1 -%global with_bundled 0 -%global with_debug 0 -%global with_check 0 -%global with_unit_test 1 -%endif %global debug_package %{nil} %global provider github @@ -37,14 +48,14 @@ Name: golang-googlecode-tools Version: 0 -Release: 14.1.git%{shortcommit}%{?dist} +Release: 15.1.git%{shortcommit}%{?dist} Summary: Supplementary tools and packages for Go License: BSD URL: https://%{provider_prefix} Source0: https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz # e.g. el6 has ppc64 arch without gcc-go, so EA tag is required -ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}} +ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}} # If go_compiler is not set to 1, there is no virtual provide. Use golang instead. BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} @@ -319,6 +330,8 @@ for cmd in \ stringer do go build -v -a %{import_path}/cmd/$cmd + # skip building in order to test tests + #cp /usr/bin/true $cmd done popd @@ -387,10 +400,12 @@ for file in $(find . -iname "*_test.go"); do cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test-devel.file-list done -cp -r oracle/testdata %{buildroot}/%{gopath}/src/%{import_path}/oracle/. -echo "%%{gopath}/src/%%{import_path}/oracle/testdata" >> unit-test-devel.file-list -cp -r refactor/eg/testdata %{buildroot}/%{gopath}/src/%{import_path}/refactor/eg/. -echo "%%{gopath}/src/%%{import_path}/refactor/eg/testdata" >> unit-test-devel.file-list + +for dir in $(find . -iname testdata); do + mkdir -p %{buildroot}/%{gopath}/src/%{import_path}/$dir + cp -r $dir/* %{buildroot}/%{gopath}/src/%{import_path}/$dir/. + echo "%%{gopath}/src/%%{import_path}/$dir" >> unit-test-devel.file-list +done %endif %if 0%{?with_devel} @@ -412,45 +427,42 @@ export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath}:/usr/inc %gotest %{import_path}/benchmark/parse %gotest %{import_path}/cmd/benchcmp -#%%gotest %%{import_path}/cmd/callgraph -%gotest %{import_path}/cmd/callgraph/testdata/src/pkg +%gotest %{import_path}/cmd/bundle +%gotest %{import_path}/cmd/callgraph +%gotest %{import_path}/cmd/cover %gotest %{import_path}/cmd/digraph %gotest %{import_path}/cmd/fiximports -#%%gotest %%{import_path}/cmd/godoc -#%%gotest %%{import_path}/cmd/stringer +#%gotest %{import_path}/cmd/godoc +%gotest %{import_path}/cmd/guru +%gotest %{import_path}/cmd/stringer %gotest %{import_path}/container/intsets %gotest %{import_path}/go/ast/astutil %gotest %{import_path}/go/buildutil %gotest %{import_path}/go/callgraph/cha %gotest %{import_path}/go/callgraph/rta %gotest %{import_path}/go/callgraph/static -%gotest %{import_path}/go/exact -#%%gotest %{import_path}/go/gccgoimporter -%gotest %{import_path}/go/gcimporter -# fails on ppc -#%%ifnarch %{power64} -#%%gotest %{import_path}/go/importer -#%%endif -#%%gotest %{import_path}/go/loader +#%gotest %{import_path}/go/gcimporter15 +#%gotest %{import_path}/go/loader %gotest %{import_path}/go/pointer -#%%gotest %{import_path}/go/pointer/testdata -#%%gotest %{import_path}/go/ssa -#%%gotest %{import_path}/go/ssa/interp -#%%gotest %{import_path}/go/ssa/interp/testdata +%gotest %{import_path}/go/ssa +#%gotest %{import_path}/go/ssa/interp %gotest %{import_path}/go/ssa/ssautil -# ** Test killed with quit: ran too long (10m0s). -#%%gotest %{import_path}/go/types %gotest %{import_path}/go/types/typeutil -#%%gotest %{import_path}/go/vcs +%gotest %{import_path}/go/vcs %gotest %{import_path}/godoc +#%gotest %{import_path}/godoc/dl +%gotest %{import_path}/godoc/redirect +%gotest %{import_path}/godoc/vfs %gotest %{import_path}/godoc/vfs/mapfs +%gotest %{import_path}/godoc/vfs/zipfs %gotest %{import_path}/imports %gotest %{import_path}/oracle +%gotest %{import_path}/playground/socket %gotest %{import_path}/present %gotest %{import_path}/refactor/eg -# graph_test.go:73: fmt and io are not mutually reachable despite being in the same SCC -#%%gotest %{import_path}/refactor/importgraph +#%gotest %{import_path}/refactor/importgraph %gotest %{import_path}/refactor/rename + %endif #define license tag if not already defined @@ -525,10 +537,13 @@ export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath}:/usr/inc %if 0%{?with_unit_test} && 0%{?with_devel} %files -n %{x_name}-unit-test-devel -f unit-test-devel.file-list %license LICENSE -%doc AUTHORS CONTRIBUTORS PATENTS README %endif %changelog +* Sat Jan 21 2017 Jan Chaloupka - 0-15.1.git9deed8c +- Polish the spec file + related: #1279381 + * Wed Sep 07 2016 jchaloup - 0-14.1.git9deed8c - Bump to upstream 9deed8c6c1c89e0b6d68d727f215de8e851d1064 resolves: #1373868