%global provider_prefix code
%global provider google
%global provider_tld com
%global project p
%global repo gomock
%global commit e033c7513ca3d743bbb64df299bdec29e93fed03
%global import_path %{provider_prefix}.%{provider}.%{provider_tld}/%{project}/%{repo}
%global shortcommit %(c=%{commit}; echo ${c:0:12})
%global debug_package %{nil}
Name: golang-googlecode-gomock
Version: 0
Release: 0.2.hg%{shortcommit}%{?dist}
Summary: Mocking framework for the Go
License: ASL 2.0
URL: http://%{import_path}
Source0: https://%{repo}.googlecode.com/archive/%{commit}.tar.gz
ExclusiveArch: %{ix86} x86_64 %{arm}
%description
GoMock is a mocking framework for the [Go programming language][golang].
It integrates well with Go's built-in `testing` package,
but can be used in other contexts too.
%package devel
BuildRequires: golang >= 1.2.1-3
Requires: golang >= 1.2.1-3
Summary: %{summary}
Provides: golang(%{import_path}) = %{version}-%{release}
Provides: golang(%{import_path}/gomock) = %{version}-%{release}
Provides: golang(%{import_path}/gomock/mock_matcher) = %{version}-%{release}
Provides: golang(%{import_path}/mockgen) = %{version}-%{release}
Provides: golang(%{import_path}/mockgen/model) = %{version}-%{release}
%description devel
GoMock is a mocking framework for the [Go programming language][golang].
It integrates well with Go's built-in `testing` package,
but can be used in other contexts too.
This package contains library source intended for
building other packages which use %{project}/%{repo}.
%prep
%setup -q -n %{repo}-%{shortcommit}
%build
%install
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
for d in gomock mockgen sample; do
cp -pav $d %{buildroot}/%{gopath}/src/%{import_path}/
done
%check
GOPATH=%{buildroot}/%{gopath}:%{gopath} go test %{import_path}/{gomock,sample}
%files devel
%doc LICENSE README.md AUTHORS CONTRIBUTORS
%dir %{gopath}/src/%{import_path}
%dir %{gopath}/src/%{import_path}/gomock
%dir %{gopath}/src/%{import_path}/gomock/mock_matcher
%dir %{gopath}/src/%{import_path}/mockgen
%dir %{gopath}/src/%{import_path}/mockgen/model
%dir %{gopath}/src/%{import_path}/sample
%dir %{gopath}/src/%{import_path}/sample/imp*
%{gopath}/src/%{import_path}/*/*.go
%{gopath}/src/%{import_path}/*/*/*.go
%{gopath}/src/%{import_path}/sample/README.md
%changelog
* Tue Oct 14 2014 jchaloup <jchaloup@redhat.com> - 0-0.2.hge033c7513ca3
- BuildArch to ExclusiveArch
* Thu Sep 25 2014 Jan Chaloupka <jchaloup@redhat.com> - 0-0.1.hge033c7513ca3
- First package for Fedora