%global debug_package %{nil} %global provider github %global provider_tld com %global project go-mgo %global repo mgo # https://github.com/go-mgo/mgo %global import_path %{provider}.%{provider_tld}/%{project}/%{repo} %global commit 3569c88678d88179dcbd68d02ab081cbca3cd4d0 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global gopkg_import_path gopkg.in/mgo.v2 %global gopkg_import_path_sec gopkg.in/v2/mgo Name: golang-%{provider}-%{project}-%{repo} Version: 0 Release: 0.1.git%{shortcommit}%{?dist} Summary: The MongoDB driver for Go License: BSD URL: https://%{import_path} Source0: 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 Summary: %{summary} %if 0%{?fedora} >= 22 BuildRequires: supervisor BuildRequires: mongodb %endif BuildRequires: golang >= 1.2.1-3 BuildRequires: golang(gopkg.in/check.v1) BuildRequires: golang(gopkg.in/tomb.v2) Requires: mongodb Requires: golang(gopkg.in/check.v1) Requires: golang(gopkg.in/tomb.v2) Provides: golang(%{gopkg_import_path}) = %{version}-%{release} Provides: golang(%{gopkg_import_path}/bson) = %{version}-%{release} Provides: golang(%{gopkg_import_path}/dbtest) = %{version}-%{release} Provides: golang(%{gopkg_import_path}/internal/sasl) = %{version}-%{release} Provides: golang(%{gopkg_import_path}/internal/scram) = %{version}-%{release} Provides: golang(%{gopkg_import_path}/testserver) = %{version}-%{release} Provides: golang(%{gopkg_import_path}/txn) = %{version}-%{release} Provides: golang(%{gopkg_import_path_sec}) = %{version}-%{release} Provides: golang(%{gopkg_import_path_sec}/bson) = %{version}-%{release} Provides: golang(%{gopkg_import_path_sec}/dbtest) = %{version}-%{release} Provides: golang(%{gopkg_import_path_sec}/internal/sasl) = %{version}-%{release} Provides: golang(%{gopkg_import_path_sec}/internal/scram) = %{version}-%{release} Provides: golang(%{gopkg_import_path_sec}/testserver) = %{version}-%{release} Provides: golang(%{gopkg_import_path_sec}/txn) = %{version}-%{release} %description devel %{summary} This package contains library source intended for building other packages which use %{project}/%{repo}. %prep %setup -q -n %{repo}-%{commit} %build %install install -d -p %{buildroot}/%{gopath}/src/%{gopkg_import_path}/ cp -pav *.go %{buildroot}/%{gopath}/src/%{gopkg_import_path}/ install -d -p %{buildroot}/%{gopath}/src/%{gopkg_import_path_sec}/ cp -pav *.go %{buildroot}/%{gopath}/src/%{gopkg_import_path_sec}/ # copy directories for file in ./* ; do if [ -d $file ]; then cp -rpav $file %{buildroot}%{gopath}/src/%{gopkg_import_path}/ cp -rpav $file %{buildroot}%{gopath}/src/%{gopkg_import_path_sec}/ fi done %check %if 0%{?fedora} >= 22 make startdb go test -gocheck.v make stopdb %endif %files devel %if 0%{?fedora} %license LICENSE %doc README.md %else %doc README.md LICENSE %endif %{gopath}/src/%{gopkg_import_path} %{gopath}/src/%{gopkg_import_path_sec} %changelog * Mon Jun 15 2015 Marek Skalicky - 0-0.1.git3569c88 - First package for Fedora