Blob Blame History Raw
%global debug_package   %{nil}
%global provider        github
%global provider_tld    com
%global project         Sirupsen
%global repo            logrus
%global import_path     %{provider}.%{provider_tld}/%{project}/%{repo}

Name:       golang-%{provider}-%{project}-%{repo}
Version:    0.6.2
Release:    1%{?dist}
Summary:    Structured logger for Go
License:    MIT
URL:        https://%{import_path}
Source0:    https://%{import_path}/archive/v%{version}.tar.gz
%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7
BuildArch:  noarch
%else
ExclusiveArch:  %{ix86} x86_64 %{arm}
%endif

%description
%{summary}

%package devel
BuildRequires:  golang >= 1.2.1-3
BuildRequires:  golang(github.com/stretchr/testify/assert)
Requires:   golang >= 1.2.1-3
Requires:   golang(github.com/stretchr/testify/assert)
Summary:    Structured logger for Go
Provides:   golang(%{import_path}) = %{version}-%{release}
Provides:   golang(%{import_path}/hooks/airbrake) = %{version}-%{release}
Provides:   golang(%{import_path}/hooks/papertrail) = %{version}-%{release}
Provides:   golang(%{import_path}/hooks/syslog) = %{version}-%{release}

%description devel
%{summary}

This package contains library source intended for building other packages
which use %{project}/%{repo}.

%prep
%setup -qn %{repo}-%{version}

%build

%install
install -dp %{buildroot}%{gopath}/src/%{import_path}
cp -pav *.go %{buildroot}%{gopath}/src/%{import_path}
for dir in */ ; do
    cp -rpav $dir %{buildroot}%{gopath}/src/%{import_path}/
done

%check
GOPATH=%{buildroot}%{gopath}:%{gopath} go test %{import_path}

%files devel
%doc README.md LICENSE
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
%dir %{gopath}/src/%{import_path}
%{gopath}/src/%{import_path}/*

%changelog
* Fri Jan 02 2015 jchaloup <jchaloup@redhat.com> - 0.6.2-1
- Update to 0.6.2
  related: #1158670

* Sun Nov 30 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.6.0-1
- Update to 0.6.0

* Thu Oct 30 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.5.1-2
- Resolves: rhbz#1158670 - initial package bug
- courtesy Jan Chaloupka <jchaloup@redhat.com>
- update dependencies
- add check

* Wed Oct 29 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.5.1-1
- Initial package