%global debug_package %{nil} %global provider github %global provider_tld com %global project howeyc %global repo gopass # https://github.com/howeyc/gopass %global import_path %{provider}.%{provider_tld}/%{project}/%{repo} %global commit 2c70fa70727c953c51695f800f25d6b44abb368e %global shortcommit %(c=%{commit}; echo ${c:0:7}) %define rel 0.2 Name: golang-%{provider}-%{project}-%{repo} Version: 0 Release: %mkrel %{rel}.git%{shortcommit} Summary: Getpasswd for Go License: ISC URL: https://%{import_path} Source0: https://%{import_path}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz BuildArch: noarch Group: Development/Other %description %{summary} %package devel Summary: %{summary} BuildRequires: golang >= 1.2.1-3 BuildRequires: golang(golang.org/x/crypto/ssh/terminal) Requires: golang(golang.org/x/crypto/ssh/terminal) Provides: golang(%{import_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}-%{commit} %build %install install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ cp -pav *.go %{buildroot}/%{gopath}/src/%{import_path}/ # copy directories for file in ./* ; do if [ -d $file ]; then cp -rpav $file %{buildroot}%{gopath}/src/%{import_path}/ fi done %check %files devel %if 0%{?fedora} %license LICENSE.txt %doc README.md %else %doc README.md LICENSE.txt %endif %dir %{gopath}/src/%{provider}.%{provider_tld}/%{project} %{gopath}/src/%{import_path}