Blob Blame History Raw
# Generated by go2rpm 1
%ifnarch %{ix86} %{arm}
%bcond_without check
%endif

# https://github.com/mongodb/mongo-go-driver
%global goipath         go.mongodb.org/mongo-driver
%global forgeurl        https://github.com/mongodb/mongo-go-driver
Version:                1.1.0

%gometa

%global common_description %{expand:
The Go driver for MongoDB.}

%global golicenses      LICENSE
%global godocs          examples CONTRIBUTING.md README.md

Name:           %{goname}
Release:        1%{?dist}
Summary:        Go driver for MongoDB

# Upstream license specification: Apache-2.0
License:        ASL 2.0
URL:            %{gourl}
Source0:        %{gosource}

BuildRequires:  golang(github.com/go-stack/stack)
BuildRequires:  golang(github.com/gobuffalo/packr/v2)
BuildRequires:  golang(github.com/golang/snappy)
BuildRequires:  golang(github.com/kr/pretty)
BuildRequires:  golang(github.com/montanaflynn/stats)
BuildRequires:  golang(github.com/pelletier/go-toml)
BuildRequires:  golang(github.com/stretchr/testify/require)
BuildRequires:  golang(github.com/xdg/scram)
BuildRequires:  golang(github.com/xdg/stringprep)
BuildRequires:  golang(golang.org/x/sync/semaphore)
BuildRequires:  golang(golang.org/x/tools/go/packages)
BuildRequires:  golang(golang.org/x/tools/imports)

%if %{with check}
# Tests
BuildRequires:  golang(github.com/google/go-cmp/cmp)
BuildRequires:  golang(github.com/stretchr/testify/assert)
BuildRequires:  golang(github.com/tidwall/pretty)
BuildRequires:  golang(golang.org/x/net/context)
%endif

%description
%{common_description}

%gopkg

%prep
%goprep

%build
for cmd in cmd/* ; do
  %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd
done

%install
%gopkginstall
install -m 0755 -vd                     %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/

%if %{with check}
%check
# Disabled tests need a mongo client or network access
%gocheck -d mongo \
         -d mongo/gridfs \
         -d x/mongo/driver/integration \
         -d x/mongo/driver/topology
%endif

%files
%license LICENSE
%doc examples CONTRIBUTING.md README.md
%{_bindir}/*

%gopkgfiles

%changelog
* Wed Aug 21 11:36:00 CEST 2019 Robert-André Mauchin <zebob.m@gmail.com> - 1.1.0-1
- Initial package