Fridolin Pokorny fae31ae
%if 0%{?fedora} || 0%{?rhel} == 6
Fridolin Pokorny fae31ae
%global with_devel 1
Fridolin Pokorny fae31ae
%global with_bundled 0
Fridolin Pokorny fae31ae
%global with_debug 0
Fridolin Pokorny fae31ae
%global with_check 1
Fridolin Pokorny fae31ae
%global with_unit_test 1
Fridolin Pokorny fae31ae
%else
Fridolin Pokorny fae31ae
%global with_devel 0
Fridolin Pokorny fae31ae
%global with_bundled 0
Fridolin Pokorny fae31ae
%global with_debug 0
Fridolin Pokorny fae31ae
%global with_check 0
Fridolin Pokorny fae31ae
%global with_unit_test 0
Fridolin Pokorny fae31ae
%endif
Fridolin Pokorny fae31ae
Fridolin Pokorny fae31ae
%if 0%{?with_debug}
Fridolin Pokorny fae31ae
%global _dwz_low_mem_die_limit 0
Fridolin Pokorny fae31ae
%else
c03de3c
%global debug_package   %{nil}
Fridolin Pokorny fae31ae
%endif
Fridolin Pokorny fae31ae
Fridolin Pokorny fae31ae
%define copying() \
Fridolin Pokorny fae31ae
%if 0%{?fedora} >= 21 || 0%{?rhel} >= 7 \
Fridolin Pokorny fae31ae
%license %{*} \
Fridolin Pokorny fae31ae
%else \
Fridolin Pokorny fae31ae
%doc %{*} \
Fridolin Pokorny fae31ae
%endif
Fridolin Pokorny fae31ae
c03de3c
%global provider        github
c03de3c
%global provider_tld    com
c03de3c
%global project         syndtr
c03de3c
%global repo            goleveldb
Fridolin Pokorny fae31ae
# https://github.com/syndtr/goleveldb
Fridolin Pokorny fae31ae
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
Fridolin Pokorny fae31ae
%global import_path     %{provider_prefix}
3429cc8
%global commit          012f65f74744ed62a80abac6e9a8c86e71c2b6fa
c03de3c
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
c03de3c
c03de3c
Name:           golang-%{provider}-%{project}-%{repo}
c03de3c
Version:        0
ca9c0c2
Release:        0.11.git%{shortcommit}%{?dist}
c03de3c
Summary:        LevelDB key/value database in Go
c03de3c
License:        BSD
Fridolin Pokorny fae31ae
URL:            https://%{provider_prefix}
Fridolin Pokorny fae31ae
Source0:        https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
Fridolin Pokorny fae31ae
Fridolin Pokorny fae31ae
# If go_arches not defined fall through to implicit golang archs
Fridolin Pokorny fae31ae
%if 0%{?go_arches:1}
Fridolin Pokorny fae31ae
ExclusiveArch:  %{go_arches}
Fridolin Pokorny fae31ae
%else
Fridolin Pokorny fae31ae
ExclusiveArch:   %{ix86} x86_64 %{arm}
Fridolin Pokorny fae31ae
%endif
Fridolin Pokorny fae31ae
# If gccgo_arches does not fit or is not defined fall through to golang
Fridolin Pokorny fae31ae
%ifarch 0%{?gccgo_arches}
Fridolin Pokorny fae31ae
BuildRequires:   gcc-go >= %{gccgo_min_vers}
c03de3c
%else
Fridolin Pokorny fae31ae
BuildRequires:   golang
c03de3c
%endif
c03de3c
c03de3c
%description
c03de3c
%{summary}
c03de3c
Fridolin Pokorny fae31ae
%if 0%{?with_devel}
c03de3c
%package devel
Fridolin Pokorny fae31ae
Summary:       %{summary}
Fridolin Pokorny fae31ae
BuildArch:     noarch
Fridolin Pokorny fae31ae
Fridolin Pokorny fae31ae
%if 0%{?with_check}
Fridolin Pokorny fae31ae
BuildRequires: golang(github.com/onsi/ginkgo)
Fridolin Pokorny fae31ae
BuildRequires: golang(github.com/onsi/ginkgo/config)
Fridolin Pokorny fae31ae
BuildRequires: golang(github.com/onsi/gomega)
Fridolin Pokorny fae31ae
BuildRequires: golang(github.com/syndtr/gosnappy/snappy)
Fridolin Pokorny fae31ae
%endif
Fridolin Pokorny fae31ae
Fridolin Pokorny fae31ae
Requires:      golang(github.com/onsi/ginkgo)
Fridolin Pokorny fae31ae
Requires:      golang(github.com/onsi/ginkgo/config)
Fridolin Pokorny fae31ae
Requires:      golang(github.com/onsi/gomega)
Fridolin Pokorny fae31ae
Requires:      golang(github.com/syndtr/gosnappy/snappy)
Fridolin Pokorny fae31ae
Fridolin Pokorny fae31ae
Provides:      golang(%{import_path}/leveldb) = %{version}-%{release}
Fridolin Pokorny fae31ae
Provides:      golang(%{import_path}/leveldb/cache) = %{version}-%{release}
Fridolin Pokorny fae31ae
Provides:      golang(%{import_path}/leveldb/comparer) = %{version}-%{release}
Fridolin Pokorny fae31ae
Provides:      golang(%{import_path}/leveldb/errors) = %{version}-%{release}
Fridolin Pokorny fae31ae
Provides:      golang(%{import_path}/leveldb/filter) = %{version}-%{release}
Fridolin Pokorny fae31ae
Provides:      golang(%{import_path}/leveldb/iterator) = %{version}-%{release}
Fridolin Pokorny fae31ae
Provides:      golang(%{import_path}/leveldb/journal) = %{version}-%{release}
Fridolin Pokorny fae31ae
Provides:      golang(%{import_path}/leveldb/memdb) = %{version}-%{release}
Fridolin Pokorny fae31ae
Provides:      golang(%{import_path}/leveldb/opt) = %{version}-%{release}
Fridolin Pokorny fae31ae
Provides:      golang(%{import_path}/leveldb/storage) = %{version}-%{release}
Fridolin Pokorny fae31ae
Provides:      golang(%{import_path}/leveldb/table) = %{version}-%{release}
Fridolin Pokorny fae31ae
Provides:      golang(%{import_path}/leveldb/testutil) = %{version}-%{release}
Fridolin Pokorny fae31ae
Provides:      golang(%{import_path}/leveldb/util) = %{version}-%{release}
c03de3c
c03de3c
%description devel
c03de3c
%{summary}
c03de3c
Fridolin Pokorny fae31ae
This package contains library source intended for
Fridolin Pokorny fae31ae
building other packages which use import path with
Fridolin Pokorny fae31ae
%{import_path} prefix.
Fridolin Pokorny fae31ae
%endif
Fridolin Pokorny fae31ae
Fridolin Pokorny fae31ae
%if 0%{?with_unit_test}
Fridolin Pokorny fae31ae
%package unit-test
Fridolin Pokorny fae31ae
Summary:         Unit tests for %{name} package
Fridolin Pokorny fae31ae
# If go_arches not defined fall through to implicit golang archs
Fridolin Pokorny fae31ae
%if 0%{?go_arches:1}
Fridolin Pokorny fae31ae
ExclusiveArch:  %{go_arches}
Fridolin Pokorny fae31ae
%else
Fridolin Pokorny fae31ae
ExclusiveArch:   %{ix86} x86_64 %{arm}
Fridolin Pokorny fae31ae
%endif
Fridolin Pokorny fae31ae
# If gccgo_arches does not fit or is not defined fall through to golang
Fridolin Pokorny fae31ae
%ifarch 0%{?gccgo_arches}
Fridolin Pokorny fae31ae
BuildRequires:   gcc-go >= %{gccgo_min_vers}
Fridolin Pokorny fae31ae
%else
Fridolin Pokorny fae31ae
BuildRequires:   golang
Fridolin Pokorny fae31ae
%endif
Fridolin Pokorny fae31ae
Fridolin Pokorny fae31ae
%if 0%{?with_check}
Fridolin Pokorny fae31ae
#Here comes all BuildRequires: PACKAGE the unit tests
Fridolin Pokorny fae31ae
#in %%check section need for running
Fridolin Pokorny fae31ae
%endif
Fridolin Pokorny fae31ae
Fridolin Pokorny fae31ae
# test subpackage tests code from devel subpackage
Fridolin Pokorny fae31ae
Requires:        %{name}-devel = %{version}-%{release}
Fridolin Pokorny fae31ae
Fridolin Pokorny fae31ae
%description unit-test
Fridolin Pokorny fae31ae
%{summary}
Fridolin Pokorny fae31ae
Fridolin Pokorny fae31ae
This package contains unit tests for project
Fridolin Pokorny fae31ae
providing packages with %{import_path} prefix.
Fridolin Pokorny fae31ae
%endif
c03de3c
c03de3c
%prep
c03de3c
%setup -q -n %{repo}-%{commit}
c03de3c
c03de3c
%build
c03de3c
c03de3c
%install
Fridolin Pokorny fae31ae
# source codes for building projects
Fridolin Pokorny fae31ae
%if 0%{?with_devel}
c03de3c
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
Fridolin Pokorny fae31ae
# find all *.go but no *_test.go files and generate devel.file-list
Fridolin Pokorny fae31ae
for file in $(find . -iname "*.go" \! -iname "*_test.go") ; do
Fridolin Pokorny fae31ae
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
Fridolin Pokorny fae31ae
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
Fridolin Pokorny fae31ae
    echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list
Fridolin Pokorny fae31ae
done
Fridolin Pokorny fae31ae
%endif
Fridolin Pokorny fae31ae
Fridolin Pokorny fae31ae
# testing files for this project
Fridolin Pokorny fae31ae
%if 0%{?with_unit_test}
Fridolin Pokorny fae31ae
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
Fridolin Pokorny fae31ae
# find all *_test.go files and generate unit-test.file-list
Fridolin Pokorny fae31ae
for file in $(find . -iname "*_test.go"); do
Fridolin Pokorny fae31ae
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
Fridolin Pokorny fae31ae
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
Fridolin Pokorny fae31ae
    echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test.file-list
Fridolin Pokorny fae31ae
done
Fridolin Pokorny fae31ae
%endif
c03de3c
c03de3c
%check
Fridolin Pokorny fae31ae
%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel}
Fridolin Pokorny fae31ae
%ifarch 0%{?gccgo_arches}
Fridolin Pokorny fae31ae
function gotest { %{gcc_go_test} "$@"; }
Fridolin Pokorny fae31ae
%else
Fridolin Pokorny fae31ae
%if 0%{?golang_test:1}
Fridolin Pokorny fae31ae
function gotest { %{golang_test} "$@"; }
Fridolin Pokorny fae31ae
%else
Fridolin Pokorny fae31ae
function gotest { go test "$@"; }
Fridolin Pokorny fae31ae
%endif
Fridolin Pokorny fae31ae
%endif
Fridolin Pokorny fae31ae
Fridolin Pokorny fae31ae
export GOPATH=%{buildroot}/%{gopath}:%{gopath}
Fridolin Pokorny faa63df
# Failed in Koji - timeout
Fridolin Pokorny faa63df
#gotest %{import_path}/leveldb
Fridolin Pokorny fae31ae
gotest %{import_path}/leveldb/cache
Fridolin Pokorny fae31ae
gotest %{import_path}/leveldb/filter
Fridolin Pokorny fae31ae
gotest %{import_path}/leveldb/iterator
Fridolin Pokorny fae31ae
gotest %{import_path}/leveldb/journal
Fridolin Pokorny fae31ae
gotest %{import_path}/leveldb/memdb
Fridolin Pokorny fae31ae
gotest %{import_path}/leveldb/storage
Fridolin Pokorny fae31ae
gotest %{import_path}/leveldb/table
Fridolin Pokorny fae31ae
gotest %{import_path}/leveldb/util
Fridolin Pokorny fae31ae
%endif
Fridolin Pokorny fae31ae
Fridolin Pokorny fae31ae
%if 0%{?with_devel}
Fridolin Pokorny fae31ae
%files devel -f devel.file-list
Fridolin Pokorny fae31ae
%copying LICENSE
Fridolin Pokorny fae31ae
%doc README.md
c03de3c
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
Fridolin Pokorny fae31ae
%dir %{gopath}/src/%{import_path}
Fridolin Pokorny fae31ae
%endif
Fridolin Pokorny fae31ae
Fridolin Pokorny fae31ae
%if 0%{?with_unit_test}
Fridolin Pokorny fae31ae
%files unit-test -f unit-test.file-list
Fridolin Pokorny fae31ae
%copying LICENSE
Fridolin Pokorny fae31ae
%doc README.md
Fridolin Pokorny fae31ae
%endif
c03de3c
c03de3c
%changelog
ca9c0c2
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.11.git012f65f
ca9c0c2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
ca9c0c2
61638a5
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.10.git012f65f
61638a5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
61638a5
4d0cfeb
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.9.git012f65f
4d0cfeb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
4d0cfeb
65fa137
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.8.git012f65f
65fa137
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
65fa137
a1b02de
* Thu Jul 21 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.7.git012f65f
a1b02de
- https://fedoraproject.org/wiki/Changes/golang1.7
a1b02de
14c42b0
* Mon Feb 22 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.6.git012f65f
14c42b0
- https://fedoraproject.org/wiki/Changes/golang1.6
14c42b0
134afae
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.5.git012f65f
134afae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
134afae
Fridolin Pokorny fae31ae
* Mon Aug 10 2015 Fridolin Pokorny <fpokorny@redhat.com> - 0-0.1.git012f65f
Fridolin Pokorny fae31ae
- Update spec file to spec-2.0
Fridolin Pokorny faa63df
- Disable leveldb test
Fridolin Pokorny fae31ae
  related: #1220163
Fridolin Pokorny fae31ae
ea850ac
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.3.git012f65f
ea850ac
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
ea850ac
3429cc8
* Sun May 10 2015 jchaloup <jchaloup@redhat.com> - 0-0.2.git012f65f
3429cc8
- Bump to upstream 012f65f74744ed62a80abac6e9a8c86e71c2b6fa
3429cc8
  resolves: #1220163
3429cc8
c03de3c
* Sat Feb 07 2015 jchaloup <jchaloup@redhat.com> - 0-0.1.gite9e2c8f
c03de3c
- First package for Fedora
c03de3c
  resolves: #1190418