%global debug_package %{nil} %global source_host github.com %global upstream goerlang %global realname dist %global import_path %{source_host}/%{upstream}/%{realname} %global gopath %{_datadir}/gocode %global commit 453dec63ea12c128128f9d91b11a82dd570119a0 %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: golang-github-%{upstream}-%{realname} Version: 0 Release: 0.1.20130219git%{shortcommit}%{?dist} Summary: An implementation of Erlang node License: MIT URL: https://%{import_path} Source0: https://%{import_path}/archive/%{commit}.tar.gz %if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 BuildArch: noarch %else ExclusiveArch: %{ix86} x86_64 %{arm} %endif %description %{summary}. %package devel Requires: golang Summary: %{summary}. Provides: golang(%{import_path}) = %{version}-%{release} %description devel %{summary}. This package contains library source intended for building other packages which use %{import_path}. %prep %setup -q -n %{realname}-%{commit} %build # Empty %install install -d -p %{buildroot}/%{gopath}/src/%{import_path} cp -arv dist.go %{buildroot}/%{gopath}/src/%{import_path} %files devel %doc LICENSE %dir %attr(755,root,root) %{gopath}/ %dir %attr(755,root,root) %{gopath}/src/ %dir %attr(755,root,root) %{gopath}/src/%{source_host}/ %dir %attr(755,root,root) %{gopath}/src/%{source_host}/%{upstream}/ %dir %attr(755,root,root) %{gopath}/src/%{import_path}/ %{gopath}/src/%{import_path}/dist.go %changelog * Sun Oct 27 2013 Peter Lemenkov - 0-0.1.20130219git453dec6 - Initial package