Blob Blame Raw
# Run tests in check section
%bcond_without check

# https://github.com/euank/go-kmsg-parser
%global goipath         github.com/euank/go-kmsg-parser
Version:                2.0.1

%gometa

Name:           %{goname}
Release:        1%{?dist}
Summary:        A simpler parser for the /dev/kmsg format 
# Detected licences
# - *No copyright* Apache License (v2.0) at 'LICENSE'
License:        ASL 2.0
URL:            %{gourl}
Source0:        %{gosource}

BuildRequires:  golang(github.com/stretchr/testify/assert)

%description
This package contains a library to allow parsing the /dev/kmsg device in 
Linux. This device provides a read-write interface to the Linux Kernel's ring 
buffer.


%package -n godmesg
Summary:       %{summary}

%description -n godmesg
A simple cli-tool that functions similarly to dmesg --ctime --follow. 
This code serves both as a usage example and as a simple way to verify it works
how you'd expect on a given system.


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

%description devel
This package contains a library to allow parsing the /dev/kmsg device in 
Linux. This device provides a read-write interface to the Linux Kernel's ring 
buffer.

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


%prep
%forgeautosetup -p1


%build
%gobuildroot
%gobuild -o _bin/godmesg %{goipath}/cmd/godmesg


%install
%goinstall
install -Dpm 0755 _bin/godmesg %{buildroot}%{_bindir}/godmesg


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


%files -n godmesg
%license LICENSE
%{_bindir}/godmesg


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


%changelog
* Sun Mar 17 2019 Robert-André Mauchin <zebob.m@gmail.com> - 2.0.1-1
- First package for Fedora