Blame golang-github-grpc-grpc-go.spec

980ca62
%if 0%{?fedora} || 0%{?rhel} == 6
980ca62
%global with_devel 1
980ca62
%global with_bundled 0
980ca62
%global with_debug 0
980ca62
%global with_check 1
980ca62
%global with_unit_test 1
980ca62
%else
980ca62
%global with_devel 0
980ca62
%global with_bundled 0
980ca62
%global with_debug 0
980ca62
%global with_check 0
980ca62
%global with_unit_test 0
980ca62
%endif
980ca62
980ca62
%if 0%{?with_debug}
980ca62
%global _dwz_low_mem_die_limit 0
980ca62
%else
980ca62
%global debug_package   %{nil}
980ca62
%endif
980ca62
980ca62
%global provider        github
980ca62
%global provider_tld    com
980ca62
%global project         grpc
980ca62
%global repo            grpc-go
980ca62
# https://github.com/grpc/grpc-go
980ca62
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
980ca62
%global import_path     google.golang.org/grpc
b22c1b7
%global commit          b062a3c003c22bfef58fa99d689e6a892b408f9d
980ca62
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
980ca62
980ca62
Name:           golang-%{provider}-%{project}-%{repo}
980ca62
Version:        0
b22c1b7
Release:        0.7.git%{shortcommit}%{?dist}
980ca62
Summary:        The Go language implementation of gRPC. HTTP/2 based RPC
980ca62
License:        BSD
980ca62
URL:            https://%{provider_prefix}
980ca62
Source0:        https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
980ca62
4293aa9
# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required
4293aa9
ExclusiveArch:  %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
4293aa9
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
4293aa9
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
980ca62
980ca62
%description
980ca62
%{summary}
980ca62
980ca62
%if 0%{?with_devel}
980ca62
%package devel
980ca62
Summary:       %{summary}
980ca62
BuildArch:     noarch
980ca62
980ca62
%if 0%{?with_check}
980ca62
BuildRequires: golang(github.com/golang/glog)
980ca62
BuildRequires: golang(github.com/golang/protobuf/proto)
980ca62
BuildRequires: golang(golang.org/x/net/context)
4839301
BuildRequires: golang(golang.org/x/net/http2)
4839301
BuildRequires: golang(golang.org/x/net/http2/hpack)
980ca62
BuildRequires: golang(golang.org/x/net/trace)
980ca62
BuildRequires: golang(golang.org/x/oauth2)
980ca62
BuildRequires: golang(golang.org/x/oauth2/google)
980ca62
BuildRequires: golang(golang.org/x/oauth2/jwt)
980ca62
%endif
980ca62
980ca62
Requires:      golang(github.com/golang/glog)
980ca62
Requires:      golang(github.com/golang/protobuf/proto)
980ca62
Requires:      golang(golang.org/x/net/context)
4839301
Requires:      golang(golang.org/x/net/http2)
4839301
Requires:      golang(golang.org/x/net/http2/hpack)
980ca62
Requires:      golang(golang.org/x/net/trace)
980ca62
Requires:      golang(golang.org/x/oauth2)
980ca62
Requires:      golang(golang.org/x/oauth2/google)
980ca62
Requires:      golang(golang.org/x/oauth2/jwt)
980ca62
980ca62
Provides:      golang(%{import_path}) = %{version}-%{release}
980ca62
Provides:      golang(%{import_path}/benchmark) = %{version}-%{release}
980ca62
Provides:      golang(%{import_path}/benchmark/grpc_testing) = %{version}-%{release}
980ca62
Provides:      golang(%{import_path}/benchmark/stats) = %{version}-%{release}
980ca62
Provides:      golang(%{import_path}/codes) = %{version}-%{release}
980ca62
Provides:      golang(%{import_path}/credentials) = %{version}-%{release}
980ca62
Provides:      golang(%{import_path}/credentials/oauth) = %{version}-%{release}
4839301
Provides:      golang(%{import_path}/examples/helloworld/helloworld) = %{version}-%{release}
4839301
Provides:      golang(%{import_path}/examples/route_guide/routeguide) = %{version}-%{release}
980ca62
Provides:      golang(%{import_path}/grpclog) = %{version}-%{release}
980ca62
Provides:      golang(%{import_path}/grpclog/glogger) = %{version}-%{release}
980ca62
Provides:      golang(%{import_path}/health) = %{version}-%{release}
b22c1b7
Provides:      golang(%{import_path}/health/grpc_health_v1) = %{version}-%{release}
4839301
Provides:      golang(%{import_path}/interop) = %{version}-%{release}
980ca62
Provides:      golang(%{import_path}/interop/grpc_testing) = %{version}-%{release}
980ca62
Provides:      golang(%{import_path}/metadata) = %{version}-%{release}
4839301
Provides:      golang(%{import_path}/naming) = %{version}-%{release}
4839301
Provides:      golang(%{import_path}/peer) = %{version}-%{release}
b22c1b7
Provides:      golang(%{import_path}/stress/grpc_testing) = %{version}-%{release}
980ca62
Provides:      golang(%{import_path}/test/codec_perf) = %{version}-%{release}
980ca62
Provides:      golang(%{import_path}/test/grpc_testing) = %{version}-%{release}
980ca62
Provides:      golang(%{import_path}/transport) = %{version}-%{release}
980ca62
980ca62
%description devel
980ca62
%{summary}
980ca62
980ca62
This package contains library source intended for
980ca62
building other packages which use import path with
980ca62
%{import_path} prefix.
980ca62
%endif
980ca62
4293aa9
%if 0%{?with_unit_test} && 0%{?with_devel}
980ca62
%package unit-test
980ca62
Summary:         Unit tests for %{name} package
4293aa9
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
4293aa9
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
980ca62
980ca62
%if 0%{?with_check}
980ca62
#Here comes all BuildRequires: PACKAGE the unit tests
980ca62
#in %%check section need for running
980ca62
%endif
980ca62
980ca62
# test subpackage tests code from devel subpackage
980ca62
Requires:        %{name}-devel = %{version}-%{release}
980ca62
980ca62
%description unit-test
980ca62
%{summary}
980ca62
980ca62
This package contains unit tests for project
980ca62
providing packages with %{import_path} prefix.
980ca62
%endif
980ca62
980ca62
%prep
980ca62
%setup -q -n %{repo}-%{commit}
980ca62
980ca62
%build
980ca62
980ca62
%install
980ca62
# source codes for building projects
980ca62
%if 0%{?with_devel}
980ca62
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
4293aa9
echo "%%dir %%{gopath}/src/%%{import_path}/." >> devel.file-list
980ca62
# find all *.go but no *_test.go files and generate unit-test.file-list
980ca62
for file in $(find . -iname "*.go" \! -iname "*_test.go") ; do
4293aa9
    echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
980ca62
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
980ca62
    cp $file %{buildroot}/%{gopath}/src/%{import_path}/$file
980ca62
    echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list
980ca62
done
980ca62
%endif
980ca62
980ca62
# testing files for this project
4293aa9
%if 0%{?with_unit_test} && 0%{?with_devel}
980ca62
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
980ca62
chmod -x %{buildroot}%{gopath}/src/%{import_path}/interop/grpc_testing/test.pb.go
980ca62
for ext in .pem .key .proto _test.go; do
980ca62
    # find all files with $ext prefix and generate unit-test.file-list
980ca62
    for file in $(find . -iname "*${ext}"); do
4293aa9
        echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
980ca62
        install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
980ca62
        cp $file %{buildroot}/%{gopath}/src/%{import_path}/$file
980ca62
        echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test.file-list
980ca62
    done
980ca62
done
980ca62
%endif
980ca62
4293aa9
%if 0%{?with_devel}
4293aa9
sort -u -o devel.file-list devel.file-list
4293aa9
%endif
4293aa9
980ca62
%check
980ca62
%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel}
4293aa9
%if ! 0%{?with_bundled}
4293aa9
export GOPATH=%{buildroot}/%{gopath}:%{gopath}
980ca62
%else
4293aa9
export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath}
980ca62
%endif
4293aa9
4293aa9
%if ! 0%{?gotest:1}
4293aa9
%global gotest go test
980ca62
%endif
980ca62
4293aa9
%gotest %{import_path}
4293aa9
%gotest %{import_path}/benchmark
4293aa9
%gotest %{import_path}/metadata
4293aa9
%gotest %{import_path}/test
4293aa9
%gotest %{import_path}/transport
980ca62
%endif
980ca62
4293aa9
#define license tag if not already defined
4293aa9
%{!?_licensedir:%global license %doc}
4293aa9
980ca62
%if 0%{?with_devel}
980ca62
%files devel -f devel.file-list
4293aa9
%license LICENSE
4839301
%doc README.md CONTRIBUTING.md
980ca62
%dir %{gopath}/src/google.golang.org
980ca62
%endif
980ca62
4293aa9
%if 0%{?with_unit_test} && 0%{?with_devel}
980ca62
%files unit-test -f unit-test.file-list
4293aa9
%license LICENSE
4839301
%doc README.md CONTRIBUTING.md
980ca62
%endif
980ca62
980ca62
%changelog
b22c1b7
* Sun May 15 2016 jchaloup <jchaloup@redhat.com> - 0-0.7.gitb062a3c
b22c1b7
- Bump to upstream b062a3c003c22bfef58fa99d689e6a892b408f9d
b22c1b7
  related: #1250461
b22c1b7
c20712a
* Tue Mar 22 2016 jchaloup <jchaloup@redhat.com> - 0-0.6.gitb88c12e
c20712a
- Bump to upstream b88c12e7caf74af3928de99a864aaa9916fa5aad
c20712a
  related: #1250461
c20712a
146f7c0
* Mon Feb 22 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.5.gite29d659
146f7c0
- https://fedoraproject.org/wiki/Changes/golang1.6
146f7c0
4839301
* Thu Feb 18 2016 jchaloup <jchaloup@redhat.com> - 0-0.4.gite29d659
4839301
- Bump to upstream e29d659177655e589850ba7d3d83f7ce12ef23dd
4839301
  related: #1250461
4839301
d999af4
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.3.gitd286668
d999af4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
d999af4
4293aa9
* Sat Sep 12 2015 jchaloup <jchaloup@redhat.com> - 0-0.2.gitd286668
4293aa9
- Update to spec-2.1
4293aa9
  resolves: #1250461
4293aa9
980ca62
* Tue Jul 28 2015 jchaloup <jchaloup@redhat.com> - 0-0.1.gitd286668
980ca62
- First package for Fedora
980ca62
  resolves: #1246205
4293aa9