From dfa52a0df76c9887473cd8db82855c8ec1d6ed50 Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Apr 11 2016 16:59:58 +0000 Subject: Polish the spec file - resolves: #1326057 --- diff --git a/golang-github-prometheus-procfs.spec b/golang-github-prometheus-procfs.spec index ff28b62..d553eb5 100644 --- a/golang-github-prometheus-procfs.spec +++ b/golang-github-prometheus-procfs.spec @@ -30,25 +30,17 @@ Name: golang-%{provider}-%{project}-%{repo} Version: 0 -Release: 0.13.git%{shortcommit}%{?dist} +Release: 0.14.git%{shortcommit}%{?dist} Summary: Functions to retrieve system, kernel and process metrics from the /proc fs License: ASL 2.0 URL: https://%{provider_prefix} Source0: https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz Patch0: golang-proc-pagesize.patch -# 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 +# 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}} +# 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} %description %{summary} @@ -100,8 +92,10 @@ providing packages with %{import_path} prefix. # source codes for building projects %if 0%{?with_devel} install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ +echo "%%dir %%{gopath}/src/%%{import_path}/." >> devel.file-list # find all *.go but no *_test.go files and generate devel.file-list for file in $(find . -iname "*.go" \! -iname "*_test.go") ; do + echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file) cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list @@ -113,50 +107,58 @@ done install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ # find all *_test.go files and generate unit-test.file-list for file in $(find . -iname "*_test.go"); do + echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file) cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test.file-list done for file in $(find ./fixtures/ -iname "*" -not -type d); do + echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file) cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test.file-list done %endif +%if 0%{?with_devel} +sort -u -o devel.file-list devel.file-list +%endif + %check %if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel} -%ifarch 0%{?gccgo_arches} -function gotest { %{gcc_go_test} "$@"; } -%else -%if 0%{?golang_test:1} -function gotest { %{golang_test} "$@"; } +%if ! 0%{?with_bundled} +export GOPATH=%{buildroot}/%{gopath}:%{gopath} %else -function gotest { go test "$@"; } +export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath} %endif + +%if ! 0%{?gotest:1} +%global gotest go test %endif -export GOPATH=%{buildroot}/%{gopath}:%{gopath} -gotest %{import_path} +%gotest %{import_path} %endif +%{!?_licensedir:%global license %doc} + %if 0%{?with_devel} %files devel -f devel.file-list -%{!?_licensedir:%global license %%doc} %license LICENSE %doc README.md CONTRIBUTING.md AUTHORS.md %dir %{gopath}/src/%{provider}.%{provider_tld}/%{project} -%dir %{gopath}/src/%{import_path} %endif %if 0%{?with_unit_test} %files unit-test -f unit-test.file-list -%{!?_licensedir:%global license %%doc} %license LICENSE %doc README.md CONTRIBUTING.md AUTHORS.md %endif %changelog +* Mon Apr 11 2016 jchaloup - 0-0.14.git406e5b7 +- Polish the spec file + resolves: #1326057 + * Mon Apr 11 2016 Than Ngo - 0-0.13.git406e5b7 - use os.Getpagesize instead syscall.Getpagesize