source: projects/specs/trunk/g/golang-github-nsf-termbox-go/golang-github-nsf-termbox-go-vl.spec @ 9980

Revision 9980, 4.1 KB checked in by iwaim, 8 years ago (diff)

golang-github-nsf-termbox-go 0-0.1.git362329b

Line 
1%global with_devel 1
2%global with_bundled 0
3%global with_debug 0
4%global with_check 1
5
6%if 0%{?with_debug}
7%global _dwz_low_mem_die_limit 0
8%else
9%global debug_package   %{nil}
10%endif
11
12%define copying() \
13%if 0%{?fedora} >= 21 || 0%{?rhel} >= 7 \
14%license %{*} \
15%else \
16%doc %{*} \
17%endif
18
19%global provider        github
20%global provider_tld    com
21%global project         nsf
22%global repo            termbox-go
23# https://github.com/nsf/termbox-go
24%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
25%global import_path     %{provider_prefix}
26%global commit          362329b0aa6447eadd52edd8d660ec1dff470295
27%global shortcommit     %(c=%{commit}; echo ${c:0:7})
28
29Name:           golang-%{provider}-%{project}-%{repo}
30Version:        0
31Release:        0.1.git%{shortcommit}%{?dist}
32Summary:        a library that provides a minimalistic API which allows the programmer to write text-based user interfaces
33License:        MIT
34URL:            https://%{import_path}
35Source0:        https://%{import_path}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
36
37BuildRequires:  golang
38
39Vendor: Project Vine
40Distribution: Vine Linux
41Packager: iwaim
42
43# If go_arches not defined fall through to implicit golang archs
44%if 0%{?go_arches:1}
45ExclusiveArch:  %{go_arches}
46%else
47ExclusiveArch:  %{ix86} x86_64 %{arm}
48%endif
49
50%description
51%{summary}.
52
53
54
55%if 0%{?with_devel}
56%package devel
57Summary:       %{summary}
58BuildArch:     noarch
59
60%if 0%{?with_check}
61%endif
62
63Provides:      golang(%{import_path}) = %{version}-%{release}
64
65%description devel
66%{summary}.
67
68This package contains library source intended for
69building other packages which use import path with
70%{import_path} prefix.
71%endif
72
73%if 0%{?with_unit_test}
74%package unit-test
75Summary:         Unit tests for %{name} package
76# If go_arches not defined fall through to implicit golang archs
77%if 0%{?go_arches:1}
78ExclusiveArch:  %{go_arches}
79%else
80ExclusiveArch:   %{ix86} x86_64 %{arm}
81%endif
82# If gccgo_arches does not fit or is not defined fall through to golang
83%ifarch 0%{?gccgo_arches}
84BuildRequires:   gcc-go >= %{gccgo_min_vers}
85%else
86BuildRequires:   golang
87%endif
88
89%if 0%{?with_check}
90#Here comes all BuildRequires: PACKAGE the unit tests
91#in %%check section need for running
92%endif
93
94# test subpackage tests code from devel subpackage
95Requires:        %{name}-devel = %{version}-%{release}
96
97%description unit-test
98%{summary}.
99
100This package contains unit tests for project
101providing packages with %{import_path} prefix.
102%endif
103
104%prep
105%setup -q -n %{repo}-%{commit}
106
107%build
108
109%install
110# source codes for building projects
111%if 0%{?with_devel}
112install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
113# find all *.go but no *_test.go files and generate unit-test.file-list
114for file in $(find . -iname "*.go" \! -iname "*_test.go") ; do
115    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
116    cp $file %{buildroot}/%{gopath}/src/%{import_path}/$file
117    echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list
118done
119%endif
120
121# testing files for this project
122%if 0%{?with_unit_test}
123install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
124# find all *_test.go files and generate unit-test.file-list
125for file in $(find . -iname "*_test.go"); do
126    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
127    cp $file %{buildroot}/%{gopath}/src/%{import_path}/$file
128    echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test.file-list
129done
130%endif
131
132%check
133%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel}
134%ifarch 0%{?gccgo_arches}
135function gotest { %{gcc_go_test} "$@"; }
136%else
137%if 0%{?golang_test:1}
138function gotest { %{golang_test} "$@"; }
139%else
140function gotest { go test "$@"; }
141%endif
142%endif
143
144export GOPATH=%{buildroot}/%{gopath}:%{gopath}
145gotest %{import_path}
146%endif
147
148%if 0%{?with_devel}
149%files devel -f devel.file-list
150%copying LICENSE
151%doc README.md AUTHORS _demos
152%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
153%dir %{gopath}/src/%{import_path}
154%endif
155
156%if 0%{?with_unit_test}
157%files unit-test -f unit-test.file-list
158%copying LICENSE
159%doc README.md AUTHORS
160%endif
161
162%changelog
163* Sun Jan 24 2016 IWAI, Masaharu <iwaim.sub@gmail.com> 0-0.1.git362329b
164- initial build for Vine Linux
Note: See TracBrowser for help on using the repository browser.