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

b82dd69
# If any of the following macros should be set otherwise,
b82dd69
# you can wrap any of them with the following conditions:
b82dd69
# - %%if 0%%{centos} == 7
b82dd69
# - %%if 0%%{?rhel} == 7
b82dd69
# - %%if 0%%{?fedora} == 23
b82dd69
# Or just test for particular distribution:
b82dd69
# - %%if 0%%{centos}
b82dd69
# - %%if 0%%{?rhel}
b82dd69
# - %%if 0%%{?fedora}
b82dd69
#
b82dd69
# Be aware, on centos, both %%rhel and %%centos are set. If you want to test
b82dd69
# rhel specific macros, you can use %%if 0%%{?rhel} && 0%%{?centos} == 0 condition.
b82dd69
# (Don't forget to replace double percentage symbol with single one in order to apply a condition)
b82dd69
b82dd69
# Generate devel rpm
980ca62
%global with_devel 1
b82dd69
# Build project from bundled dependencies
980ca62
%global with_bundled 0
b82dd69
# Build with debug info rpm
980ca62
%global with_debug 0
b82dd69
# Run tests in check section
b82dd69
# Cyclic deps among grpc, cloud and oauth2
b82dd69
%global with_check 0
b82dd69
# Generate unit-test rpm
980ca62
%global with_unit_test 1
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
5fa8603
%global commit          777daa17ff9b5daef1cfdf915088a2ada3332bf0
980ca62
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
980ca62
980ca62
Name:           golang-%{provider}-%{project}-%{repo}
34df6c1
Version:        1.0.0
d15c61e
Release:        0.5.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
b82dd69
ExclusiveArch:  %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{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)
c2a081a
BuildRequires: golang(github.com/golang/protobuf/protoc-gen-go/descriptor)
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)
c2a081a
Requires:      golang(github.com/golang/protobuf/protoc-gen-go/descriptor)
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}
f4f5644
Provides:      golang(%{import_path}/examples/helloworld/helloworld) = %{version}-%{release}
f4f5644
Provides:      golang(%{import_path}/examples/route_guide/routeguide) = %{version}-%{release}
980ca62
Provides:      golang(%{import_path}/credentials/oauth) = %{version}-%{release}
5fa8603
Provides:      golang(%{import_path}/grpclb) = %{version}-%{release}
5fa8603
Provides:      golang(%{import_path}/grpclb/grpc_lb_v1) = %{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}
c2a081a
Provides:      golang(%{import_path}/reflection) = %{version}-%{release}
c2a081a
Provides:      golang(%{import_path}/reflection/grpc_reflection_v1alpha) = %{version}-%{release}
c2a081a
Provides:      golang(%{import_path}/reflection/grpc_testing) = %{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
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
34df6c1
#%gotest %{import_path}
4293aa9
%gotest %{import_path}/benchmark
4293aa9
%gotest %{import_path}/metadata
1703c25
# Leaked goroutine
1703c25
#%%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
d15c61e
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-0.5.git777daa1
d15c61e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
d15c61e
5fa8603
* Thu Mar 16 2017 Jan Chaloupka <jchaloup@redhat.com> - 1.0.0-0.4.git777daa1
5fa8603
- Bump to upstream 777daa17ff9b5daef1cfdf915088a2ada3332bf0
5fa8603
  related: #1250461
5fa8603
cf2d0f4
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-0.3.git231b4cf
cf2d0f4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
cf2d0f4
b82dd69
* Thu Dec 15 2016 Jan Chaloupka <jchaloup@redhat.com> - 1.0.0-0.2.git231b4cf
b82dd69
- Polish the spec file
b82dd69
  related: #1250461
b82dd69
34df6c1
* Thu Sep 15 2016 jchaloup <jchaloup@redhat.com> - 1.0.0-0.1.git231b4cf
34df6c1
- Bump to upstream 231b4cfea0e79843053a33f5fe90bd4d84b23cd3
34df6c1
  related: #1250461
34df6c1
f4f5644
* Mon Aug 08 2016 jchaloup <jchaloup@redhat.com> - 0-0.11.git02fca89
f4f5644
- Give back example provides, they are actually used by golang-github-cockroachdb-cmux-unit-test-devel
f4f5644
  related: #1250461
f4f5644
c2a081a
* Wed Aug 03 2016 jchaloup <jchaloup@redhat.com> - 0-0.10.git02fca89
c2a081a
- Bump to upstream 02fca896ff5f50c6bbbee0860345a49344b37a03
c2a081a
  related: #1250461
c2a081a
1703c25
* Mon Aug 01 2016 jchaloup <jchaloup@redhat.com> - 0-0.9.gite78224b
1703c25
- Bump to upstream e78224b060cf3215247b7be455f80ea22e469b66
1703c25
  related: #1250461
1703c25
52201b7
* Thu Jul 21 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.8.gitb062a3c
52201b7
- https://fedoraproject.org/wiki/Changes/golang1.7
52201b7
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