Blob Blame History Raw
# Bootstrap needed to avoid circular dep
%bcond_with    bootstrap
# Run tests in check section
%bcond_without check

# https://github.com/anacrolix/missinggo
%global goipath         github.com/anacrolix/missinggo
Version:                2.0.1

%global common_description %{expand:
Stuff that supplements Go's stdlib, or isn't significant enough to be in its
own repo.}

%gometa

Name:           %{goname}
Release:        1%{?dist}
Summary:        Supplementary material for Go's stdlib
# Detected licences
# - Expat License at 'LICENSE'
License:        MIT
URL:            %{gourl}
Source0:        %{gosource}

BuildRequires:  golang(github.com/anacrolix/envpprof)
BuildRequires:  golang(github.com/anacrolix/tagflag)
BuildRequires:  golang(github.com/bradfitz/iter)
BuildRequires:  golang(github.com/docopt/docopt-go)
BuildRequires:  golang(github.com/dustin/go-humanize)
BuildRequires:  golang(github.com/google/btree)
BuildRequires:  golang(github.com/huandu/xstrings)
BuildRequires:  golang(github.com/RoaringBitmap/roaring)
BuildRequires:  golang(github.com/ryszard/goskiplist/skiplist)
# Tests
%if %{with check}
BuildRequires:  golang(github.com/stretchr/testify/assert)
BuildRequires:  golang(github.com/stretchr/testify/require)
%endif

%description
%{common_description}


%package devel
Summary:       %{summary}
BuildArch:     noarch

%description devel
%{common_description}

This package contains library source intended for
building other packages which use import path with
%{goipath} prefix.


%prep
%forgeautosetup

%if %{with bootstrap}
grep --include=\*.go -lrnw . -e "github.com/anacrolix/tagflag" | xargs rm
%endif


%if %{without bootstrap}
%build
%gobuildroot

for cmd in cmd/* ; do
  %gobuild -o _bin/$(basename $cmd) %{goipath}/$cmd
done
%endif


%install
%goinstall

%if %{without bootstrap}
install -m 0755 -vd %{buildroot}%{_bindir}
install -m 0755 -vp _bin/* %{buildroot}%{_bindir}/
%endif


%if %{with check}
%check
%gochecks
%endif


%if %{without bootstrap}
%files
%license LICENSE
%{_bindir}/*
%endif


%files devel -f devel.file-list
%license LICENSE
%doc README.md


%changelog
* Tue Mar 26 18:47:54 CET 2019 Robert-André Mauchin <zebob.m@gmail.com> - 2.0.1-1
- Release 2.0.1 (#1692639)

* Thu Mar 14 2019 Robert-André Mauchin <zebob.m@gmail.com> - 1.1.0-1
- First package for Fedora