Blob Blame Raw
%global goipath github.com/go-redis/redis
Version:        2.3.2

%gometa

%global v2_goipath      gopkg.in/redis.v2
%global v2_goipath_name %gorpmname %{v2_goipath}

Name:           %{goname}-v2
Release:        2%{?dist}
Summary:        Redis client for Go
License:        BSD
URL:            %{gourl}
Source0:        %{gosource}

# test fixes and do not assume use of system redis-server for testing
Patch0:         redis-testing-fixes.patch

BuildRequires:  redis
BuildRequires:  golang(gopkg.in/bufio.v1)
BuildRequires:  golang(gopkg.in/check.v1)

%description
%{summary}.


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

%description devel
%{summary}.

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

%package -n %{v2_goipath_name}-devel
Summary:       %{summary}
BuildArch:     noarch

%description -n %{v2_goipath_name}-devel
%{summary}.

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


%prep
%forgeautosetup -p1


%install
%goinstall
%goinstall -i %{v2_goipath} -o v2-devel.file-list


%check
# Run a test Redis server rather than assuming the system
# is running one already (see patch0) - non-default port.
redis-cli -p 8126 SHUTDOWN 2>/dev/null || true
redis-server --port 8126 &
sleep 1.5   # time to startup
redis-cli -p 8126 PING || exit 1
%gochecks
redis-cli -p 8126 SHUTDOWN || exit 1


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

%files -n %{v2_goipath_name}-devel -f v2-devel.file-list
%license LICENSE
%doc README.md


%changelog
* Wed Apr 24 2019 Nathan Scott <nathans@redhat.com> - 2.3.2-2
- Update spec and redis-testing-fixes patch to resolve races

* Fri Mar 22 2019 Nathan Scott <nathans@redhat.com> - 2.3.2-1
- First package for Fedora