source: projects/specs/trunk/g/golang-github-google-btree/golang-github-google-btree-vl.spec @ 9978

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

golang-github-google-btree 0-0.1.gitcc6329d

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