Fridolin Pokorny 062254b
%if 0%{?fedora} || 0%{?rhel} == 6
Fridolin Pokorny 062254b
%global with_devel 1
Fridolin Pokorny 062254b
%global with_bundled 0
Fridolin Pokorny 062254b
%global with_debug 0
Fridolin Pokorny 062254b
%global with_check 1
Fridolin Pokorny 062254b
%global with_unit_test 1
Fridolin Pokorny 062254b
%else
Fridolin Pokorny 062254b
%global with_devel 0
Fridolin Pokorny 062254b
%global with_bundled 0
Fridolin Pokorny 062254b
%global with_debug 0
Fridolin Pokorny 062254b
%global with_check 0
Fridolin Pokorny 062254b
%global with_unit_test 0
Fridolin Pokorny 062254b
%endif
Fridolin Pokorny 062254b
Fridolin Pokorny 062254b
%if 0%{?with_debug}
Fridolin Pokorny 062254b
%global _dwz_low_mem_die_limit 0
Fridolin Pokorny 062254b
%else
96f4640
%global debug_package   %{nil}
Fridolin Pokorny 062254b
%endif
Fridolin Pokorny 062254b
Fridolin Pokorny 062254b
%define copying() \
Fridolin Pokorny 062254b
%if 0%{?fedora} >= 21 || 0%{?rhel} >= 7 \
Fridolin Pokorny 062254b
%license %{*} \
Fridolin Pokorny 062254b
%else \
Fridolin Pokorny 062254b
%doc %{*} \
Fridolin Pokorny 062254b
%endif
Fridolin Pokorny 062254b
96f4640
%global provider        github
96f4640
%global provider_tld    com
96f4640
%global project         racker
96f4640
%global repo            perigee
Fridolin Pokorny 062254b
# https://github.com/racker/perigee
Fridolin Pokorny 062254b
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
Fridolin Pokorny 062254b
%global import_path     %{provider_prefix}
96f4640
%global commit          0c00cb0a026b71034ebc8205263c77dad3577db5
96f4640
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
96f4640
96f4640
Name:           golang-%{provider}-%{project}-%{repo}
96f4640
Version:        0
bd3cfe5
Release:        0.7.git%{shortcommit}%{?dist}
96f4640
Summary:        REST client optimized for use with APIs for request and response bodies
96f4640
License:        ASL 2.0
Fridolin Pokorny 062254b
URL:            https://%{provider_prefix}
Fridolin Pokorny 062254b
Source0:        https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
Fridolin Pokorny 062254b
Fridolin Pokorny 062254b
# If go_arches not defined fall through to implicit golang archs
Fridolin Pokorny 062254b
%if 0%{?go_arches:1}
Fridolin Pokorny 062254b
ExclusiveArch:  %{go_arches}
Fridolin Pokorny 062254b
%else
Fridolin Pokorny 062254b
ExclusiveArch:   %{ix86} x86_64 %{arm}
Fridolin Pokorny 062254b
%endif
Fridolin Pokorny 062254b
# If gccgo_arches does not fit or is not defined fall through to golang
Fridolin Pokorny 062254b
%ifarch 0%{?gccgo_arches}
Fridolin Pokorny 062254b
BuildRequires:   gcc-go >= %{gccgo_min_vers}
Fridolin Pokorny 062254b
%else
Fridolin Pokorny 062254b
BuildRequires:   golang
Fridolin Pokorny 062254b
%endif
96f4640
96f4640
%description
96f4640
Perigee provides a REST client that, while it should be generic enough
96f4640
to use with most any RESTful API, is nonetheless optimized to the needs
96f4640
of the OpenStack APIs. Perigee grew out of the need to refactor out
96f4640
common API access code from the gorax project.
96f4640
96f4640
Several things influenced the name of the project. Numerous elements
96f4640
of the OpenStack ecosystem are named after astronomical artifacts.
96f4640
Additionally, perigee occurs when two orbiting bodies are closest
96f4640
to each other. Perigee seemed appropriate for something aiming to bring
96f4640
OpenStack and other RESTful services closer to the end-user.
96f4640
96f4640
This library is still in the very early stages of development.
96f4640
Fridolin Pokorny 062254b
%if 0%{?with_devel}
96f4640
%package devel
Fridolin Pokorny 062254b
Summary:       %{summary}
Fridolin Pokorny 062254b
BuildArch:     noarch
Fridolin Pokorny 062254b
Fridolin Pokorny 062254b
%if 0%{?with_check}
Fridolin Pokorny 062254b
%endif
Fridolin Pokorny 062254b
Fridolin Pokorny 062254b
Provides:      golang(%{import_path}) = %{version}-%{release}
96f4640
96f4640
%description devel
96f4640
Perigee provides a REST client that, while it should be generic enough
96f4640
to use with most any RESTful API, is nonetheless optimized to the needs
96f4640
of the OpenStack APIs. Perigee grew out of the need to refactor out
96f4640
common API access code from the gorax project.
96f4640
96f4640
Several things influenced the name of the project. Numerous elements 
96f4640
of the OpenStack ecosystem are named after astronomical artifacts. 
96f4640
Additionally, perigee occurs when two orbiting bodies are closest 
96f4640
to each other. Perigee seemed appropriate for something aiming to bring 
96f4640
OpenStack and other RESTful services closer to the end-user.
96f4640
96f4640
This library is still in the very early stages of development.
96f4640
Fridolin Pokorny 062254b
This package contains library source intended for
Fridolin Pokorny 062254b
building other packages which use import path with
Fridolin Pokorny 062254b
%{import_path} prefix.
Fridolin Pokorny 062254b
%endif
Fridolin Pokorny 062254b
Fridolin Pokorny 062254b
%if 0%{?with_unit_test}
Fridolin Pokorny 062254b
%package unit-test
Fridolin Pokorny 062254b
Summary:         Unit tests for %{name} package
Fridolin Pokorny 062254b
# If go_arches not defined fall through to implicit golang archs
Fridolin Pokorny 062254b
%if 0%{?go_arches:1}
Fridolin Pokorny 062254b
ExclusiveArch:  %{go_arches}
Fridolin Pokorny 062254b
%else
Fridolin Pokorny 062254b
ExclusiveArch:   %{ix86} x86_64 %{arm}
Fridolin Pokorny 062254b
%endif
Fridolin Pokorny 062254b
# If gccgo_arches does not fit or is not defined fall through to golang
Fridolin Pokorny 062254b
%ifarch 0%{?gccgo_arches}
Fridolin Pokorny 062254b
BuildRequires:   gcc-go >= %{gccgo_min_vers}
Fridolin Pokorny 062254b
%else
Fridolin Pokorny 062254b
BuildRequires:   golang
Fridolin Pokorny 062254b
%endif
Fridolin Pokorny 062254b
Fridolin Pokorny 062254b
%if 0%{?with_check}
Fridolin Pokorny 062254b
#Here comes all BuildRequires: PACKAGE the unit tests
Fridolin Pokorny 062254b
#in %%check section need for running
Fridolin Pokorny 062254b
%endif
Fridolin Pokorny 062254b
Fridolin Pokorny 062254b
# test subpackage tests code from devel subpackage
Fridolin Pokorny 062254b
Requires:        %{name}-devel = %{version}-%{release}
Fridolin Pokorny 062254b
Fridolin Pokorny 062254b
%description unit-test
Fridolin Pokorny 062254b
%{summary}
Fridolin Pokorny 062254b
Fridolin Pokorny 062254b
This package contains unit tests for project
Fridolin Pokorny 062254b
providing packages with %{import_path} prefix.
Fridolin Pokorny 062254b
%endif
96f4640
96f4640
%prep
96f4640
%setup -q -n %{repo}-%{commit}
96f4640
96f4640
%build
96f4640
96f4640
%install
Fridolin Pokorny 062254b
# source codes for building projects
Fridolin Pokorny 062254b
%if 0%{?with_devel}
96f4640
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
Fridolin Pokorny 062254b
# find all *.go but no *_test.go files and generate devel.file-list
Fridolin Pokorny 062254b
for file in $(find . -iname "*.go" \! -iname "*_test.go") ; do
Fridolin Pokorny 062254b
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
Fridolin Pokorny 062254b
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
Fridolin Pokorny 062254b
    echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list
Fridolin Pokorny 062254b
done
Fridolin Pokorny 062254b
%endif
Fridolin Pokorny 062254b
Fridolin Pokorny 062254b
# testing files for this project
Fridolin Pokorny 062254b
%if 0%{?with_unit_test}
Fridolin Pokorny 062254b
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
Fridolin Pokorny 062254b
# find all *_test.go files and generate unit-test.file-list
Fridolin Pokorny 062254b
for file in $(find . -iname "*_test.go"); do
Fridolin Pokorny 062254b
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
Fridolin Pokorny 062254b
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
Fridolin Pokorny 062254b
    echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test.file-list
Fridolin Pokorny 062254b
done
Fridolin Pokorny 062254b
%endif
96f4640
96f4640
%check
Fridolin Pokorny 062254b
%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel}
Fridolin Pokorny 062254b
%ifarch 0%{?gccgo_arches}
Fridolin Pokorny 062254b
function gotest { %{gcc_go_test} "$@"; }
Fridolin Pokorny 062254b
%else
Fridolin Pokorny 062254b
%if 0%{?golang_test:1}
Fridolin Pokorny 062254b
function gotest { %{golang_test} "$@"; }
Fridolin Pokorny 062254b
%else
Fridolin Pokorny 062254b
function gotest { go test "$@"; }
Fridolin Pokorny 062254b
%endif
Fridolin Pokorny 062254b
%endif
Fridolin Pokorny 062254b
Fridolin Pokorny 062254b
export GOPATH=%{buildroot}/%{gopath}:%{gopath}
Fridolin Pokorny 062254b
gotest %{import_path}
Fridolin Pokorny 062254b
%endif
Fridolin Pokorny 062254b
Fridolin Pokorny 062254b
%if 0%{?with_devel}
Fridolin Pokorny 062254b
%files devel -f devel.file-list
Fridolin Pokorny 062254b
%copying LICENSE
Fridolin Pokorny 062254b
%doc README.md
96f4640
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
Fridolin Pokorny 062254b
%dir %{gopath}/src/%{import_path}
Fridolin Pokorny 062254b
%endif
Fridolin Pokorny 062254b
Fridolin Pokorny 062254b
%if 0%{?with_unit_test}
Fridolin Pokorny 062254b
%files unit-test -f unit-test.file-list
Fridolin Pokorny 062254b
%copying LICENSE
Fridolin Pokorny 062254b
%doc README.md
Fridolin Pokorny 062254b
%endif
96f4640
96f4640
%changelog
bd3cfe5
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.7.git0c00cb0
bd3cfe5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
bd3cfe5
aed40a9
* Thu Jul 21 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.6.git0c00cb0
aed40a9
- https://fedoraproject.org/wiki/Changes/golang1.7
aed40a9
e578d08
* Mon Feb 22 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.5.git0c00cb0
e578d08
- https://fedoraproject.org/wiki/Changes/golang1.6
e578d08
e172bc2
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.4.git0c00cb0
e172bc2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
e172bc2
Fridolin Pokorny 062254b
* Fri Aug 07 2015 Fridolin Pokorny <fpokorny@redhat.com> - 0-0.3.git0c00cb0
Fridolin Pokorny 062254b
- Update spec file to spec-2.0
Fridolin Pokorny 062254b
  resolves: #1250497
Fridolin Pokorny 062254b
1ae4b89
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.2.git0c00cb0
1ae4b89
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
1ae4b89
96f4640
* Thu Oct 16 2014 jchaloup <jchaloup@redhat.com> - 0-0.1.git0c00cb0
96f4640
- First package for Fedora
96f4640
  resolves: #1153726
96f4640