# Generated by go2rpm
%bcond_without check

# https://github.com/go-pipe/pipe
%global goipath         gopkg.in/pipe.v2
%global forgeurl        https://github.com/go-pipe/pipe
%global commit          3c2ca4d525447ec8b2f606a6974f9c9f40831f26

%gometa

%global common_description %{expand:
Package Pipe implements unix-like pipelines for Go.}

%global golicenses      LICENSE
%global godocs          README.md

Name:           %{goname}
Version:        0
Release:        %autorelease
Summary:        Unix-like pipelines for Go

# Upstream license specification: BSD-2-Clause
License:        BSD
URL:            %{gourl}
Source0:        %{gosource}
# https://github.com/go-pipe/pipe/pull/7
Patch0:          pipe-fix-test.patch

# Remove in F43
Provides: golang-gopkg-pipe-2 = %{version}-%{release}
Obsoletes: golang-gopkg-pipe-2  < 0-0.14.20180419git3c2ca4d

%global godevelheader %{expand:
Provides: golang-gopkg-pipe-2-devel = %{version}-%{release}
Obsoletes: golang-gopkg-pipe-2-devel < 0-0.14.20180419git3c2ca4d}

# For tests.
BuildRequires:  golang(gopkg.in/check.v1)

%description
%{common_description}

%gopkg

%prep
%goprep
%patch 0 -p1

%install
%gopkginstall

%if %{with check}
%check
# Check fails on ppc64le, even with patch, so disable for now:
# gopkg.in/pipe.v2
# ----------------------------------------------------------------------
# FAIL: pipe_test.go:166: S.TestLineTermination
# pipe_test.go:177:
#     c.Assert(err, ErrorMatches, `io: read/write on closed pipe`)
# ... value = nil
# ... regex string = "io: read/write on closed pipe"
# ... Error value is nil
# OOPS: 55 passed, 1 FAILED
%gocheck -d .
%endif

%gopkgfiles

%changelog
%autochangelog