Blob Blame History Raw
%global debug_package   %{nil}
%global provider        golang
%global provider_tld    org
%global repo            oauth2
%global import_path     %{provider}.%{provider_tld}/x/%{repo}
%global commit          b5adcc2dcdf009d0391547edc6ecbaff889f5bb9
%global shortcommit     %(r=%{commit}; echo ${r:0:7})

%global gc_rev             afe77d958c701557ec5dc56f6936fcc194d15520
%global gc_shortrev        %(r=%{gc_rev}; echo ${r:0:12})
%global gc_provider        google
%global gc_provider_sub    code
%global gc_provider_tld    com
%global gc_repo            goauth2
%global gc_import_path     %{gc_provider_sub}.%{gc_provider}.%{gc_provider_tld}/p/%{gc_repo}
%global gc_name            golang-%{gc_provider}%{gc_provider_sub}-%{gc_repo}

%global x_name          golang-%{provider}%{provider_tld}-%{repo}
%global devel_main      %{x_name}-devel

Name:           golang-googlecode-goauth2 
Version:        0
Release:        0.7.hg%{shortcommit}%{?dist}
Summary:        OAuth 2.0 for Go clients
License:        BSD
URL:            http://%{import_path}
Source0:        https://github.com/%{project}/%{repo}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
Source1:	https://%{gc_repo}.%{gc_provider}%{gc_provider_sub}.%{gc_provider_tld}/archive/%{gc_rev}.tar.gz
%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7
BuildArch:      noarch
%else
ExclusiveArch:  %{ix86} x86_64 %{arm}
%endif

%description
%{summary}

%package -n %{x_name}-devel
BuildRequires:    golang >= 1.2.1-3
BuildRequires:    golang(google.golang.org/appengine)
BuildRequires:    golang(google.golang.org/appengine/urlfetch)
BuildRequires:    golang(google.golang.org/cloud/compute/metadata)
BuildRequires:    golang(golang.org/x/net/context)
Requires:       golang >= 1.2.1-3
Requires:       golang(google.golang.org/appengine)
Requires:       golang(google.golang.org/appengine/urlfetch)
Requires:       golang(google.golang.org/cloud/compute/metadata)
Requires:       golang(golang.org/x/net/context)
Summary:        OAuth 2.0 for Go clients
Provides:       golang(%{import_path}) = %{version}-%{release}
Provides:       golang(%{import_path}/clientcredentials) = %{version}-%{release}
Provides:       golang(%{import_path}/facebook) = %{version}-%{release}
Provides:       golang(%{import_path}/github) = %{version}-%{release}
Provides:       golang(%{import_path}/google) = %{version}-%{release}
Provides:       golang(%{import_path}/internal) = %{version}-%{release}
Provides:       golang(%{import_path}/jws) = %{version}-%{release}
Provides:       golang(%{import_path}/jwt) = %{version}-%{release}
Provides:       golang(%{import_path}/linkedin) = %{version}-%{release}
Provides:       golang(%{import_path}/odnoklassniki) = %{version}-%{release}
Provides:       golang(%{import_path}/paypal) = %{version}-%{release}
Provides:       golang(%{import_path}/vk) = %{version}-%{release}

%description -n %{x_name}-devel
%{summary}

This package contains library source intended for building other packages
which use the OAuth 2.0 for Go clients library.


%package -n %{gc_name}-devel
BuildRequires:  golang >= 1.2.1-3
Requires:       golang >= 1.2.1-3
Summary:        OAuth 2.0 for Go clients
Provides:       golang(%{gc_import_path}/appengine/serviceaccount) = %{version}-%{release}
Provides:       golang(%{gc_import_path}/compute/serviceaccount) = %{version}-%{release}
Provides:       golang(%{gc_import_path}/oauth) = %{version}-%{release}
Provides:       golang(%{gc_import_path}/oauth/jwt) = %{version}-%{release}

%description -n %{gc_name}-devel
%{summary}

This package contains library source intended for building other packages
which use the OAuth 2.0 for Go clients library.

%prep
%setup -q -n %{gc_repo}-%{gc_shortrev} -T -b 1
%setup -q -n %{repo}-%{commit}

%build

%install
install -d %{buildroot}/%{gopath}/src/%{import_path}
cp -pav *.go %{buildroot}/%{gopath}/src/%{import_path}/
for d in google github jws jwt internal; do
   cp -pav $d %{buildroot}/%{gopath}/src/%{import_path}/
done

pushd ../%{gc_repo}-%{gc_shortrev}
install -d %{buildroot}/%{gopath}/src/%{gc_import_path}
for d in appengine compute lib oauth; do
   cp -pav $d %{buildroot}/%{gopath}/src/%{gc_import_path}/
done


%check
# test fails in no buildable go sources
#GOPATH={gopath}:{buildroot}/{gopath} go test {import_path}/google
#GOPATH={gopath}:{buildroot}/{gopath} go test {import_path}/jwt
GOPATH=%{gopath}:%{buildroot}/%{gopath} go test %{import_path}/internal

%files -n %{x_name}-devel
%doc AUTHORS CONTRIBUTING.md CONTRIBUTORS LICENSE README.md
%{gopath}/src/%{import_path}

%files -n %{gc_name}-devel
%doc AUTHORS CONTRIBUTING.md CONTRIBUTORS LICENSE README.md
%{gopath}/src/%{gc_import_path}

%changelog
* Tue Jun 02 2015 jchaloup <jchaloup@redhat.com> - 0-0.7.hgb5adcc2
- Bump to upstream b5adcc2dcdf009d0391547edc6ecbaff889f5bb9
  resolves: #1227273

* Sun Mar 08 2015 jchaloup <jchaloup@redhat.com> - 0-0.6.hg267028f
- Add the latest commit of depricated code.google.com/o/goauth2 afe77d958c701557ec5dc56f6936fcc194d15520
  related: #1141822

* Thu Jan 22 2015 jchaloup <jchaloup@redhat.com> - 0-0.5.hgafe77d958c70
- Bump to upstream 267028f9bc2a1177dc5769be38c68c1b4fbe91c4
  related: #1141822

* Tue Nov 18 2014 jchaloup <jchaloup@redhat.com> - 0-0.4.hgafe77d958c70
- Choose the correct architecture
  related: #1141822

* Thu Sep 18 2014 jchaloup <jchaloup@redhat.com> - 0-0.3.hgafe77d958c70
- Initial commit to git

* Mon Sep 15 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.2.hgafe77d958c70
- update to afe77d958c70
- preserve timestamps of copied files

* Mon Aug 04 2014 Adam Miller <maxamillion@fedoraproject.org> - 0-0.1.hg6a3615e294b5
- First package for Fedora.