%global debug_package %{nil}
%global provider github
%global provider_tld com
%global project glacjay
%global repo goini
%global import_path %{provider}.%{provider_tld}/%{project}/%{repo}
%global commit 5261baf26f41eeffae5fd27be784302e389b7699
%global shortcommit %(c=%{commit}; echo ${c:0:7})
# github.com/rakyll/goini has no license.
# But it is forked from github.com/glacjay/goini and unchanged.
# Lets provide these source codes as well.
%global rcommit 907cca0f578a5316fb864ec6992dc3d9730ec58c
%global rscommit %(c=%{rcommit}; echo ${c:0:7})
%global rimport_path %{provider}.%{provider_tld}/rakyll/goini
Name: golang-%{provider}-%{project}-%{repo}
Version: 0
Release: 0.1.git%{shortcommit}%{?dist}
Summary: INI file parser in go
License: MIT
URL: https://%{import_path}
Source0: https://%{import_path}/archive/%{rcommit}/%{repo}-%{rscommit}.tar.gz
Source1: https://%{import_path}/archive/%{commit}/%{repo}-%{shortcommit}.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
Requires: golang >= 1.2.1-3
Summary: %{summary}
Provides: golang(%{import_path}) = %{version}-%{release}
Provides: golang(%{rimport_path}) = %{version}-%{release}
%description devel
%{summary}
This package contains library source intended for
building other packages which use %{project}/%{repo}.
%prep
%setup -q -n %{repo}-%{rcommit}
%setup -q -n %{repo}-%{commit} -T -b 1
%build
%install
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
cp -pav *.go %{buildroot}/%{gopath}/src/%{import_path}/
cp -pav example.ini empty.ini %{buildroot}/%{gopath}/src/%{import_path}/
pushd ../%{repo}-%{rcommit}
install -d -p %{buildroot}/%{gopath}/src/%{rimport_path}/
cp -pav *.go %{buildroot}/%{gopath}/src/%{rimport_path}/
%check
#--- FAIL: TestString (0.00 seconds)
# ini_test.go:167: Dict cannot be stringified as expected.
%files devel
%doc LICENSE.txt
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
%{gopath}/src/%{import_path}
%dir %{gopath}/src/%{provider}.%{provider_tld}/rakyll
%{gopath}/src/%{rimport_path}
%changelog
* Tue Jan 13 2015 jchaloup <jchaloup@redhat.com> - 0-0.1.git5261baf
- First package for Fedora
resolves: #1177486