diff --git a/golang-github-rackspace-gophercloud.spec b/golang-github-rackspace-gophercloud.spec index 0552f97..953320b 100644 --- a/golang-github-rackspace-gophercloud.spec +++ b/golang-github-rackspace-gophercloud.spec @@ -1,19 +1,30 @@ -%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 # Two following test passes but it is about 50% of all. # Some tests fails, some fails on build failure # Besides, BuildRequires is not complete as there is a cyclic deps with smashwilson/gophercloud %global with_check 0 +# Generate unit-test rpm %global with_unit_test 1 -%else -%global with_devel 0 -%global with_bundled 0 -%global with_debug 0 -%global with_check 0 -%global with_unit_test 0 -%endif %if 0%{?with_debug} %global _dwz_low_mem_die_limit 0 @@ -21,13 +32,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 rackspace @@ -40,24 +44,16 @@ Name: golang-%{provider}-%{project}-%{repo} Version: 1.0.0 -Release: 11%{?dist} +Release: 12%{?dist} Summary: The Go SDK for Openstack http://gophercloud.io License: ASL 2.0 URL: https://%{provider_prefix} Source0: https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz -# 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 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} %description Gophercloud currently lets you authenticate with OpenStack providers to create @@ -238,18 +234,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 @@ -275,6 +259,7 @@ 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 install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file) @@ -294,167 +279,175 @@ for file in $(find . -iname "*_test.go"); do 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}/acceptance/openstack -gotest %{import_path}/acceptance/openstack/blockstorage/v1 -gotest %{import_path}/acceptance/openstack/compute/v2 -gotest %{import_path}/acceptance/openstack/identity/v2 -gotest %{import_path}/acceptance/openstack/identity/v3 -gotest %{import_path}/acceptance/openstack/networking/v2 -gotest %{import_path}/acceptance/openstack/networking/v2/extensions -gotest %{import_path}/acceptance/openstack/networking/v2/extensions/fwaas -gotest %{import_path}/acceptance/openstack/networking/v2/extensions/lbaas -gotest %{import_path}/acceptance/openstack/objectstorage/v1 -gotest %{import_path}/acceptance/openstack/orchestration/v1 -gotest %{import_path}/acceptance/rackspace -gotest %{import_path}/acceptance/rackspace/blockstorage/v1 -gotest %{import_path}/acceptance/rackspace/cdn/v1 -gotest %{import_path}/acceptance/rackspace/compute/v2 -gotest %{import_path}/acceptance/rackspace/identity/v2 -gotest %{import_path}/acceptance/rackspace/lb/v1 -gotest %{import_path}/acceptance/rackspace/networking/v2 -gotest %{import_path}/acceptance/rackspace/objectstorage/v1 -gotest %{import_path}/acceptance/rackspace/orchestration/v1 -gotest %{import_path}/acceptance/rackspace/rackconnect/v3 -gotest %{import_path}/openstack -gotest %{import_path}/openstack/blockstorage/v1/apiversions -gotest %{import_path}/openstack/blockstorage/v1/snapshots -gotest %{import_path}/openstack/blockstorage/v1/volumes -gotest %{import_path}/openstack/blockstorage/v1/volumetypes -gotest %{import_path}/openstack/cdn/v1/base -gotest %{import_path}/openstack/cdn/v1/flavors -gotest %{import_path}/openstack/cdn/v1/serviceassets -gotest %{import_path}/openstack/cdn/v1/services -gotest %{import_path}/openstack/common/extensions -gotest %{import_path}/openstack/compute/v2/extensions -gotest %{import_path}/openstack/compute/v2/extensions/bootfromvolume -gotest %{import_path}/openstack/compute/v2/extensions/defsecrules -gotest %{import_path}/openstack/compute/v2/extensions/diskconfig -gotest %{import_path}/openstack/compute/v2/extensions/floatingip -gotest %{import_path}/openstack/compute/v2/extensions/keypairs -gotest %{import_path}/openstack/compute/v2/extensions/secgroups -gotest %{import_path}/openstack/compute/v2/extensions/servergroups -gotest %{import_path}/openstack/compute/v2/extensions/startstop -gotest %{import_path}/openstack/compute/v2/extensions/tenantnetworks -gotest %{import_path}/openstack/compute/v2/extensions/volumeattach -gotest %{import_path}/openstack/compute/v2/flavors -gotest %{import_path}/openstack/compute/v2/images -gotest %{import_path}/openstack/compute/v2/servers -gotest %{import_path}/openstack/identity/v2/extensions -gotest %{import_path}/openstack/identity/v2/extensions/admin/roles -gotest %{import_path}/openstack/identity/v2/tenants -gotest %{import_path}/openstack/identity/v2/tokens -gotest %{import_path}/openstack/identity/v2/users -gotest %{import_path}/openstack/identity/v3/endpoints -gotest %{import_path}/openstack/identity/v3/services -gotest %{import_path}/openstack/identity/v3/tokens -gotest %{import_path}/openstack/networking/v2/apiversions -gotest %{import_path}/openstack/networking/v2/extensions -gotest %{import_path}/openstack/networking/v2/extensions/external -gotest %{import_path}/openstack/networking/v2/extensions/fwaas/firewalls -gotest %{import_path}/openstack/networking/v2/extensions/fwaas/policies -gotest %{import_path}/openstack/networking/v2/extensions/fwaas/rules -gotest %{import_path}/openstack/networking/v2/extensions/layer3/floatingips -gotest %{import_path}/openstack/networking/v2/extensions/layer3/routers -gotest %{import_path}/openstack/networking/v2/extensions/lbaas/members -gotest %{import_path}/openstack/networking/v2/extensions/lbaas/monitors -gotest %{import_path}/openstack/networking/v2/extensions/lbaas/pools -gotest %{import_path}/openstack/networking/v2/extensions/lbaas/vips -gotest %{import_path}/openstack/networking/v2/extensions/provider -gotest %{import_path}/openstack/networking/v2/extensions/security/groups -gotest %{import_path}/openstack/networking/v2/extensions/security/rules -gotest %{import_path}/openstack/networking/v2/networks -gotest %{import_path}/openstack/networking/v2/ports -gotest %{import_path}/openstack/networking/v2/subnets -gotest %{import_path}/openstack/objectstorage/v1/accounts -gotest %{import_path}/openstack/objectstorage/v1/containers -gotest %{import_path}/openstack/objectstorage/v1/objects -gotest %{import_path}/openstack/orchestration/v1/apiversions -gotest %{import_path}/openstack/orchestration/v1/buildinfo -gotest %{import_path}/openstack/orchestration/v1/stackevents -gotest %{import_path}/openstack/orchestration/v1/stackresources -gotest %{import_path}/openstack/orchestration/v1/stacks -gotest %{import_path}/openstack/orchestration/v1/stacktemplates -gotest %{import_path}/openstack/utils -gotest %{import_path}/pagination -gotest %{import_path}/rackspace -gotest %{import_path}/rackspace/blockstorage/v1/snapshots -gotest %{import_path}/rackspace/blockstorage/v1/volumes -gotest %{import_path}/rackspace/blockstorage/v1/volumetypes -gotest %{import_path}/rackspace/cdn/v1/base -gotest %{import_path}/rackspace/cdn/v1/flavors -gotest %{import_path}/rackspace/cdn/v1/serviceassets -gotest %{import_path}/rackspace/cdn/v1/services -gotest %{import_path}/rackspace/compute/v2/bootfromvolume -gotest %{import_path}/rackspace/compute/v2/flavors -gotest %{import_path}/rackspace/compute/v2/images -gotest %{import_path}/rackspace/compute/v2/keypairs -gotest %{import_path}/rackspace/compute/v2/networks -gotest %{import_path}/rackspace/compute/v2/servers -gotest %{import_path}/rackspace/compute/v2/virtualinterfaces -gotest %{import_path}/rackspace/compute/v2/volumeattach -gotest %{import_path}/rackspace/identity/v2/extensions -gotest %{import_path}/rackspace/identity/v2/roles -gotest %{import_path}/rackspace/identity/v2/tenants -gotest %{import_path}/rackspace/identity/v2/tokens -gotest %{import_path}/rackspace/identity/v2/users -gotest %{import_path}/rackspace/lb/v1/acl -gotest %{import_path}/rackspace/lb/v1/lbs -gotest %{import_path}/rackspace/lb/v1/monitors -gotest %{import_path}/rackspace/lb/v1/nodes -gotest %{import_path}/rackspace/lb/v1/sessions -gotest %{import_path}/rackspace/lb/v1/ssl -gotest %{import_path}/rackspace/lb/v1/throttle -gotest %{import_path}/rackspace/lb/v1/vips -gotest %{import_path}/rackspace/networking/v2/networks -gotest %{import_path}/rackspace/networking/v2/ports -gotest %{import_path}/rackspace/networking/v2/security/groups -gotest %{import_path}/rackspace/networking/v2/security/rules -gotest %{import_path}/rackspace/networking/v2/subnets -gotest %{import_path}/rackspace/objectstorage/v1/accounts -gotest %{import_path}/rackspace/objectstorage/v1/bulk -gotest %{import_path}/rackspace/objectstorage/v1/cdncontainers -gotest %{import_path}/rackspace/objectstorage/v1/cdnobjects -gotest %{import_path}/rackspace/objectstorage/v1/containers -gotest %{import_path}/rackspace/objectstorage/v1/objects -gotest %{import_path}/rackspace/orchestration/v1/buildinfo -gotest %{import_path}/rackspace/orchestration/v1/stackevents -gotest %{import_path}/rackspace/orchestration/v1/stackresources -gotest %{import_path}/rackspace/orchestration/v1/stacks -gotest %{import_path}/rackspace/orchestration/v1/stacktemplates -gotest %{import_path}/rackspace/rackconnect/v3/cloudnetworks -gotest %{import_path}/rackspace/rackconnect/v3/lbpools -gotest %{import_path}/rackspace/rackconnect/v3/publicips +%gotest %{import_path} +%gotest %{import_path}/acceptance/openstack +%gotest %{import_path}/acceptance/openstack/blockstorage/v1 +%gotest %{import_path}/acceptance/openstack/compute/v2 +%gotest %{import_path}/acceptance/openstack/identity/v2 +%gotest %{import_path}/acceptance/openstack/identity/v3 +%gotest %{import_path}/acceptance/openstack/networking/v2 +%gotest %{import_path}/acceptance/openstack/networking/v2/extensions +%gotest %{import_path}/acceptance/openstack/networking/v2/extensions/fwaas +%gotest %{import_path}/acceptance/openstack/networking/v2/extensions/lbaas +%gotest %{import_path}/acceptance/openstack/objectstorage/v1 +%gotest %{import_path}/acceptance/openstack/orchestration/v1 +%gotest %{import_path}/acceptance/rackspace +%gotest %{import_path}/acceptance/rackspace/blockstorage/v1 +%gotest %{import_path}/acceptance/rackspace/cdn/v1 +%gotest %{import_path}/acceptance/rackspace/compute/v2 +%gotest %{import_path}/acceptance/rackspace/identity/v2 +%gotest %{import_path}/acceptance/rackspace/lb/v1 +%gotest %{import_path}/acceptance/rackspace/networking/v2 +%gotest %{import_path}/acceptance/rackspace/objectstorage/v1 +%gotest %{import_path}/acceptance/rackspace/orchestration/v1 +%gotest %{import_path}/acceptance/rackspace/rackconnect/v3 +%gotest %{import_path}/openstack +%gotest %{import_path}/openstack/blockstorage/v1/apiversions +%gotest %{import_path}/openstack/blockstorage/v1/snapshots +%gotest %{import_path}/openstack/blockstorage/v1/volumes +%gotest %{import_path}/openstack/blockstorage/v1/volumetypes +%gotest %{import_path}/openstack/cdn/v1/base +%gotest %{import_path}/openstack/cdn/v1/flavors +%gotest %{import_path}/openstack/cdn/v1/serviceassets +%gotest %{import_path}/openstack/cdn/v1/services +%gotest %{import_path}/openstack/common/extensions +%gotest %{import_path}/openstack/compute/v2/extensions +%gotest %{import_path}/openstack/compute/v2/extensions/bootfromvolume +%gotest %{import_path}/openstack/compute/v2/extensions/defsecrules +%gotest %{import_path}/openstack/compute/v2/extensions/diskconfig +%gotest %{import_path}/openstack/compute/v2/extensions/floatingip +%gotest %{import_path}/openstack/compute/v2/extensions/keypairs +%gotest %{import_path}/openstack/compute/v2/extensions/secgroups +%gotest %{import_path}/openstack/compute/v2/extensions/servergroups +%gotest %{import_path}/openstack/compute/v2/extensions/startstop +%gotest %{import_path}/openstack/compute/v2/extensions/tenantnetworks +%gotest %{import_path}/openstack/compute/v2/extensions/volumeattach +%gotest %{import_path}/openstack/compute/v2/flavors +%gotest %{import_path}/openstack/compute/v2/images +%gotest %{import_path}/openstack/compute/v2/servers +%gotest %{import_path}/openstack/identity/v2/extensions +%gotest %{import_path}/openstack/identity/v2/extensions/admin/roles +%gotest %{import_path}/openstack/identity/v2/tenants +%gotest %{import_path}/openstack/identity/v2/tokens +%gotest %{import_path}/openstack/identity/v2/users +%gotest %{import_path}/openstack/identity/v3/endpoints +%gotest %{import_path}/openstack/identity/v3/services +%gotest %{import_path}/openstack/identity/v3/tokens +%gotest %{import_path}/openstack/networking/v2/apiversions +%gotest %{import_path}/openstack/networking/v2/extensions +%gotest %{import_path}/openstack/networking/v2/extensions/external +%gotest %{import_path}/openstack/networking/v2/extensions/fwaas/firewalls +%gotest %{import_path}/openstack/networking/v2/extensions/fwaas/policies +%gotest %{import_path}/openstack/networking/v2/extensions/fwaas/rules +%gotest %{import_path}/openstack/networking/v2/extensions/layer3/floatingips +%gotest %{import_path}/openstack/networking/v2/extensions/layer3/routers +%gotest %{import_path}/openstack/networking/v2/extensions/lbaas/members +%gotest %{import_path}/openstack/networking/v2/extensions/lbaas/monitors +%gotest %{import_path}/openstack/networking/v2/extensions/lbaas/pools +%gotest %{import_path}/openstack/networking/v2/extensions/lbaas/vips +%gotest %{import_path}/openstack/networking/v2/extensions/provider +%gotest %{import_path}/openstack/networking/v2/extensions/security/groups +%gotest %{import_path}/openstack/networking/v2/extensions/security/rules +%gotest %{import_path}/openstack/networking/v2/networks +%gotest %{import_path}/openstack/networking/v2/ports +%gotest %{import_path}/openstack/networking/v2/subnets +%gotest %{import_path}/openstack/objectstorage/v1/accounts +%gotest %{import_path}/openstack/objectstorage/v1/containers +%gotest %{import_path}/openstack/objectstorage/v1/objects +%gotest %{import_path}/openstack/orchestration/v1/apiversions +%gotest %{import_path}/openstack/orchestration/v1/buildinfo +%gotest %{import_path}/openstack/orchestration/v1/stackevents +%gotest %{import_path}/openstack/orchestration/v1/stackresources +%gotest %{import_path}/openstack/orchestration/v1/stacks +%gotest %{import_path}/openstack/orchestration/v1/stacktemplates +%gotest %{import_path}/openstack/utils +%gotest %{import_path}/pagination +%gotest %{import_path}/rackspace +%gotest %{import_path}/rackspace/blockstorage/v1/snapshots +%gotest %{import_path}/rackspace/blockstorage/v1/volumes +%gotest %{import_path}/rackspace/blockstorage/v1/volumetypes +%gotest %{import_path}/rackspace/cdn/v1/base +%gotest %{import_path}/rackspace/cdn/v1/flavors +%gotest %{import_path}/rackspace/cdn/v1/serviceassets +%gotest %{import_path}/rackspace/cdn/v1/services +%gotest %{import_path}/rackspace/compute/v2/bootfromvolume +%gotest %{import_path}/rackspace/compute/v2/flavors +%gotest %{import_path}/rackspace/compute/v2/images +%gotest %{import_path}/rackspace/compute/v2/keypairs +%gotest %{import_path}/rackspace/compute/v2/networks +%gotest %{import_path}/rackspace/compute/v2/servers +%gotest %{import_path}/rackspace/compute/v2/virtualinterfaces +%gotest %{import_path}/rackspace/compute/v2/volumeattach +%gotest %{import_path}/rackspace/identity/v2/extensions +%gotest %{import_path}/rackspace/identity/v2/roles +%gotest %{import_path}/rackspace/identity/v2/tenants +%gotest %{import_path}/rackspace/identity/v2/tokens +%gotest %{import_path}/rackspace/identity/v2/users +%gotest %{import_path}/rackspace/lb/v1/acl +%gotest %{import_path}/rackspace/lb/v1/lbs +%gotest %{import_path}/rackspace/lb/v1/monitors +%gotest %{import_path}/rackspace/lb/v1/nodes +%gotest %{import_path}/rackspace/lb/v1/sessions +%gotest %{import_path}/rackspace/lb/v1/ssl +%gotest %{import_path}/rackspace/lb/v1/throttle +%gotest %{import_path}/rackspace/lb/v1/vips +%gotest %{import_path}/rackspace/networking/v2/networks +%gotest %{import_path}/rackspace/networking/v2/ports +%gotest %{import_path}/rackspace/networking/v2/security/groups +%gotest %{import_path}/rackspace/networking/v2/security/rules +%gotest %{import_path}/rackspace/networking/v2/subnets +%gotest %{import_path}/rackspace/objectstorage/v1/accounts +%gotest %{import_path}/rackspace/objectstorage/v1/bulk +%gotest %{import_path}/rackspace/objectstorage/v1/cdncontainers +%gotest %{import_path}/rackspace/objectstorage/v1/cdnobjects +%gotest %{import_path}/rackspace/objectstorage/v1/containers +%gotest %{import_path}/rackspace/objectstorage/v1/objects +%gotest %{import_path}/rackspace/orchestration/v1/buildinfo +%gotest %{import_path}/rackspace/orchestration/v1/stackevents +%gotest %{import_path}/rackspace/orchestration/v1/stackresources +%gotest %{import_path}/rackspace/orchestration/v1/stacks +%gotest %{import_path}/rackspace/orchestration/v1/stacktemplates +%gotest %{import_path}/rackspace/rackconnect/v3/cloudnetworks +%gotest %{import_path}/rackspace/rackconnect/v3/lbpools +%gotest %{import_path}/rackspace/rackconnect/v3/publicips %endif +#define license tag if not already defined +%{!?_licensedir:%global license %doc} + %if 0%{?with_devel} %files devel -f devel.file-list -%copying LICENSE +%license LICENSE %doc README.md CONTRIBUTING.md UPGRADING.md CONTRIBUTORS.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 -%copying LICENSE -%doc README.md CONTRIBUTING.md UPGRADING.md CONTRIBUTORS.md +%license LICENSE %endif %changelog +* Wed Jan 18 2017 Jan Chaloupka +- Polish the spec file + related: #1214774 + * Thu Jul 21 2016 Fedora Release Engineering - 1.0.0-11 - https://fedoraproject.org/wiki/Changes/golang1.7