diff --git a/.gitignore b/.gitignore index e69de29..ea70b1c 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/hcl-513e04c.tar.gz diff --git a/golang-github-hashicorp-hcl.spec b/golang-github-hashicorp-hcl.spec new file mode 100644 index 0000000..59bbb0f --- /dev/null +++ b/golang-github-hashicorp-hcl.spec @@ -0,0 +1,76 @@ +%global debug_package %{nil} +%global provider github +%global provider_tld com +%global project hashicorp +%global repo hcl +# https://github.com/hashicorp/hcl +%global import_path %{provider}.%{provider_tld}/%{project}/%{repo} +%global commit 513e04c400ee2e81e97f5e011c08fb42c6f69b84 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) + +Name: golang-%{provider}-%{project}-%{repo} +Version: 0 +Release: 0.1.git%{shortcommit}%{?dist} +Summary: HCL is a configuration language +License: MPLv2.0 +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} +BuildRequires: golang >= 1.2.1-3 +BuildRequires: golang(github.com/hashicorp/go-multierror) +Requires: golang(github.com/hashicorp/go-multierror) +Provides: golang(%{import_path}) = %{version}-%{release} +Provides: golang(%{import_path}/hcl) = %{version}-%{release} +Provides: golang(%{import_path}/json) = %{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 +GOPATH=%{buildroot}/%{gopath}:%{gopath} go test %{import_path} +GOPATH=%{buildroot}/%{gopath}:%{gopath} go test %{import_path}/hcl +GOPATH=%{buildroot}/%{gopath}:%{gopath} go test %{import_path}/json + +%files devel +%if 0%{?fedora} +%license LICENSE +%doc README.md +%else +%doc README.md LICENSE +%endif +%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project} +%{gopath}/src/%{import_path} + +%changelog +* Wed Apr 15 2015 jchaloup - 0-0.1.git513e04c +- First package for Fedora + resolves: #1212059 diff --git a/sources b/sources index e69de29..71e0f15 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +f5bf8967313ac94a7ed8ee31f22ebe34 hcl-513e04c.tar.gz