| |
@@ -0,0 +1,107 @@
|
| |
+ # Build project from bundled dependencies
|
| |
+ %global with_bundled 0
|
| |
+ # Build with debug info rpm
|
| |
+ %global with_debug 0
|
| |
+ # Run tests in check section
|
| |
+ %global with_check 1
|
| |
+ # Generate unit-test rpm
|
| |
+ %global with_unit_test 1
|
| |
+
|
| |
+ %if 0%{?with_debug}
|
| |
+ %global _dwz_low_mem_die_limit 0
|
| |
+ %else
|
| |
+ %global debug_package %{nil}
|
| |
+ %endif
|
| |
+
|
| |
+ %global provider github
|
| |
+ %global provider_tld com
|
| |
+ %global project lucasb-eyer
|
| |
+ %global repo go-colorful
|
| |
+ %global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
|
| |
+ %global import_path %{provider_prefix}
|
| |
+ %global commit 345fbb3dbcdb252d9985ee899a84963c0fa24c82
|
| |
+ %global shortcommit %(c=%{commit}; echo ${c:0:7})
|
| |
+
|
| |
+
|
| |
+ Name: golang-%{provider}-%{project}-colorful
|
| |
+ Version: 1.0
|
| |
+ Release: 1%{?dist}
|
| |
+ Summary: A library for playing with colors in Go
|
| |
+ License: MIT
|
| |
+ URL: https://%{provider_prefix}
|
| |
+ Source0: https://github.com/%{project}/%{repo}/archive/v%{version}/%{repo}-%{version}.tar.gz
|
| |
+
|
| |
+ # e.g. el6 has ppc64 arch without gcc-go, so EA tag is required
|
| |
+ ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}}
|
| |
+ # If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
|
| |
+ BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
|
| |
+
|
| |
+ %description
|
| |
+ %{summary}
|
| |
+
|
| |
+ %package devel
|
| |
+ Summary: %{summary}
|
| |
+ BuildArch: noarch
|
| |
+
|
| |
+ BuildRequires: golang(gopkg.in/DATA-DOG/go-sqlmock.v1)
|
| |
+
|
| |
+ Provides: golang-%{provider}-%{project}-go-colorful-devel = %{version}-%{release}
|
| |
+ Obsoletes: golang-%{provider}-%{project}-go-colorful-devel < 1.0-1
|
| |
+
|
| |
+ Provides: golang(%{provider_prefix}) = %{version}-%{release}
|
| |
+
|
| |
+
|
| |
+ %description devel
|
| |
+ %{summary}
|
| |
+
|
| |
+ This package contains library source intended for building other packages
|
| |
+ which use import path with %{provider_prefix} prefix.
|
| |
+
|
| |
+
|
| |
+ %prep
|
| |
+ %setup -q -n %{repo}-%{version}
|
| |
+
|
| |
+
|
| |
+ %install
|
| |
+ install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
|
| |
+ echo "%%dir %%{gopath}/src/%%{import_path}/." > devel.file-list
|
| |
+ # find all *.go but no *_test.go files and generate devel.file-list
|
| |
+ for file in $(find . \( -iname "*.go" -or -iname "*.s" \) \! -iname "*_test.go") ; do
|
| |
+ file="${file##./}"
|
| |
+ dirprefix="$(dirname "${file}")"
|
| |
+ install -d -p "%{buildroot}/%{gopath}/src/%{import_path}/${dirprefix}" >&2
|
| |
+ cp -pav "${file}" "%{buildroot}/%{gopath}/src/%{import_path}/${file}" >&2
|
| |
+ echo "%%{gopath}/src/%%{import_path}/${file}"
|
| |
+
|
| |
+ while [ "$dirprefix" != "." ]; do
|
| |
+ echo "%%dir %%{gopath}/src/%%{import_path}/$dirprefix"
|
| |
+ dirprefix=$(dirname $dirprefix)
|
| |
+ done
|
| |
+ done | sort -u >>devel.file-list
|
| |
+
|
| |
+ %check
|
| |
+ %if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel}
|
| |
+ %if ! 0%{?with_bundled}
|
| |
+ export GOPATH=%{buildroot}/%{gopath}:%{gopath}
|
| |
+ %else
|
| |
+ # No dependency directories so far
|
| |
+
|
| |
+ export GOPATH=%{buildroot}/%{gopath}:%{gopath}
|
| |
+ %endif
|
| |
+
|
| |
+ %if ! 0%{?gotest:1}
|
| |
+ %global gotest go test
|
| |
+ %endif
|
| |
+
|
| |
+ %gotest %{import_path}
|
| |
+ %endif
|
| |
+
|
| |
+
|
| |
+ %files devel -f devel.file-list
|
| |
+ %doc README.md
|
| |
+ %license LICENSE
|
| |
+
|
| |
+
|
| |
+ %changelog
|
| |
+ * Tue Aug 14 2018 Michal Minář <miminar@redhat.com> - 1.0-1
|
| |
+ - Initial epel7 release.
|
| |
NVR: golang-github-lucasb-eyer-colorful-1.0-1