Blob Blame History Raw
# Generated by go2rpm 1.10.0
%bcond_without check

# https://github.com/pierrec/lz4
%global goipath         github.com/pierrec/lz4
Version:                4.1.21

%gometa -L

%global goaltipaths     github.com/pierrec/lz4/v4

%global common_description %{expand:
Package lz4 implements reading and writing lz4 compressed data (a frame), as
specified in
http://fastcompression.blogspot.com/2013/04/lz4-streaming-format-final.html.

This package is compatible with the LZ4 frame format although the block level
compression and decompression functions are exposed and are fully compatible
with the LZ4 block format definition, they are low level and should not be
used directly.}

%global golicenses      LICENSE
%global godocs          README.md

Name:           golang-github-pierrec-lz4
Release:        %autorelease
Summary:        LZ4 compression and decompression in pure Go

License:        BSD-3-Clause
URL:            %{gourl}
Source:         %{gosource}

%description %{common_description}

%gopkg

%prep
%goprep
%autopatch -p1

%generate_buildrequires
%go_generate_buildrequires

%build
%gobuild -o %{gobuilddir}/bin/golz4c %{goipath}/cmd/lz4c

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

%if %{with check}
%check
# https://github.com/pierrec/lz4/issues/156
for test in "TestWriterLegacy"\
; do
awk -i inplace '/^func.*'"$test"'\(/ { print; print "\tt.Skip(\"disabled failing test\")"; next}1' $(grep -rl $test)
done
%gocheck
%endif

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

%gopkgfiles

%changelog
%autochangelog