Blame golang-github-coreos-go-etcd.spec

975fc25
%if 0%{?fedora} || 0%{?rhel} == 6
975fc25
%global with_devel 1
975fc25
%global with_bundled 0
975fc25
%global with_debug 0
975fc25
# needs etcd running
975fc25
%global with_check 0
975fc25
%global with_unit_test 1
975fc25
%else
975fc25
%global with_devel 0
975fc25
%global with_bundled 0
975fc25
%global with_debug 0
975fc25
%global with_check 0
975fc25
%global with_unit_test 0
975fc25
%endif
975fc25
975fc25
%if 0%{?with_debug}
975fc25
%global _dwz_low_mem_die_limit 0
975fc25
%else
975fc25
%global debug_package   %{nil}
975fc25
%endif
975fc25
975fc25
%define copying() \
975fc25
%if 0%{?fedora} >= 21 || 0%{?rhel} >= 7 \
975fc25
%license %{*} \
975fc25
%else \
975fc25
%doc %{*} \
975fc25
%endif
975fc25
975fc25
%global isgccgoarch 0
975fc25
%if 0%{?gccgo_arches:1}
975fc25
%ifarch %{gccgo_arches}
975fc25
%global isgccgoarch 1
975fc25
%endif
975fc25
%endif
975fc25
e218648
%global provider        github
e218648
%global provider_tld    com
e218648
%global project         coreos
e218648
%global repo            go-etcd
975fc25
# https://github.com/coreos/go-etcd
975fc25
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
975fc25
%global import_path     %{provider_prefix}
975fc25
%global commit          4cceaf7283b76f27c4a732b20730dcdb61053bf5
e218648
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
e218648
975fc25
Name:           golang-%{provider}-%{project}-%{repo}
975fc25
Version:        2.0.0
975fc25
Release:        0.3.git%{shortcommit}%{?dist}
975fc25
Summary:        Go client library for etcd
975fc25
License:        ASL 2.0
975fc25
URL:            https://%{provider_prefix}
975fc25
Source0:        https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
975fc25
Patch0:         change-default-ports.patch
975fc25
975fc25
# If go_arches not defined fall through to implicit golang archs
975fc25
%if 0%{?go_arches:1}
975fc25
ExclusiveArch:  %{go_arches}
975fc25
%else
975fc25
ExclusiveArch:   %{ix86} x86_64 %{arm}
975fc25
%endif
975fc25
# If gccgo_arches does not fit or is not defined fall through to golang
975fc25
%if %{isgccgoarch}
975fc25
BuildRequires:   gcc-go >= %{gccgo_min_vers}
7c03719
%else
975fc25
BuildRequires:   golang
7c03719
%endif
e218648
e218648
%description
e218648
%{summary}
e218648
975fc25
%if 0%{?with_devel}
e218648
%package devel
975fc25
Summary:       %{summary}
975fc25
BuildArch:     noarch
975fc25
975fc25
%if 0%{?with_check}
975fc25
BuildRequires: golang(github.com/ugorji/go/codec)
975fc25
%endif
975fc25
975fc25
Requires:      golang(github.com/ugorji/go/codec)
975fc25
975fc25
Provides:      golang(%{import_path}/etcd) = %{version}-%{release}
e218648
e218648
%description devel
e218648
%{summary}
e218648
975fc25
This package contains library source intended for
975fc25
building other packages which use import path with
975fc25
%{import_path} prefix.
975fc25
%endif
975fc25
975fc25
%if 0%{?with_unit_test} && 0%{?with_devel}
975fc25
%package unit-test
975fc25
Summary:         Unit tests for %{name} package
975fc25
# If go_arches not defined fall through to implicit golang archs
975fc25
%if 0%{?go_arches:1}
975fc25
ExclusiveArch:  %{go_arches}
975fc25
%else
975fc25
ExclusiveArch:   %{ix86} x86_64 %{arm}
975fc25
%endif
975fc25
# If gccgo_arches does not fit or is not defined fall through to golang
975fc25
%if %{isgccgoarch}
975fc25
BuildRequires:   gcc-go >= %{gccgo_min_vers}
975fc25
%else
975fc25
BuildRequires:   golang
975fc25
%endif
975fc25
975fc25
%if 0%{?with_check}
975fc25
#Here comes all BuildRequires: PACKAGE the unit tests
975fc25
#in %%check section need for running
975fc25
%endif
975fc25
975fc25
# test subpackage tests code from devel subpackage
975fc25
Requires:        %{name}-devel = %{version}-%{release}
975fc25
975fc25
%description unit-test
975fc25
%{summary}
975fc25
975fc25
This package contains unit tests for project
975fc25
providing packages with %{import_path} prefix.
975fc25
%endif
e218648
e218648
%prep
e218648
%setup -q -n %{repo}-%{commit}
975fc25
%patch0 -p1
e218648
e218648
%build
e218648
e218648
%install
975fc25
# source codes for building projects
975fc25
%if 0%{?with_devel}
975fc25
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
975fc25
# find all *.go but no *_test.go files and generate devel.file-list
975fc25
for file in $(find . -iname "*.go" \! -iname "*_test.go") ; do
975fc25
    echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
975fc25
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
975fc25
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
975fc25
    echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list
975fc25
done
975fc25
%endif
975fc25
975fc25
# testing files for this project
975fc25
%if 0%{?with_unit_test} && 0%{?with_devel}
975fc25
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
975fc25
# find all *_test.go files and generate unit-test.file-list
975fc25
for file in $(find . -iname "*_test.go"); do
975fc25
    echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
975fc25
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
975fc25
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
975fc25
    echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test.file-list
975fc25
done
975fc25
%endif
975fc25
975fc25
%if 0%{?with_devel}
975fc25
sort -u -o devel.file-list devel.file-list
975fc25
%endif
975fc25
975fc25
%check
975fc25
%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel}
975fc25
%if %{isgccgoarch}
975fc25
function gotest { %{gcc_go_test} "$@"; }
975fc25
%else
975fc25
%if 0%{?golang_test:1}
975fc25
function gotest { %{golang_test} "$@"; }
975fc25
%else
975fc25
function gotest { go test "$@"; }
975fc25
%endif
975fc25
%endif
e218648
975fc25
export GOPATH=%{buildroot}/%{gopath}:%{gopath}
975fc25
gotest %{import_path}/etcd
975fc25
%endif
975fc25
975fc25
%if 0%{?with_devel}
975fc25
%files devel -f devel.file-list
975fc25
%copying LICENSE
975fc25
%doc README.md
e218648
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
e218648
%dir %{gopath}/src/%{import_path}
975fc25
%endif
975fc25
975fc25
%if 0%{?with_unit_test} && 0%{?with_devel}
975fc25
%files unit-test -f unit-test.file-list
975fc25
%copying LICENSE
975fc25
%doc README.md
975fc25
%endif
e218648
e218648
%changelog
975fc25
* Mon Aug 31 2015 jchaloup <jchaloup@redhat.com> - 2.0.0-0.3.git4cceaf7
975fc25
- Bump to upstream 4cceaf7283b76f27c4a732b20730dcdb61053bf5
975fc25
  resolves: #1246214
975fc25
2038484
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0-0.2.git0424b5f
2038484
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
2038484
0824219
* Mon Apr 20 2015 jchaloup <jchaloup@redhat.com> - 2.0.0-0.1.git0424b5f
0824219
- Bump to upstream 0424b5f86ef0ca57a5309c599f74bbb3e97ecd9d
0824219
  related: #1141807
0824219
Eric Paris b1a56f4
* Fri Apr 10 2015 Eric Paris <eparis@redhat.com>
Eric Paris b1a56f4
- Bump to version supporting etcd 2.0
Eric Paris b1a56f4
Eric Paris b1a56f4
* Tue Apr 7 2015 Eric Paris <eparis@redhat.com>
Eric Paris 7edc062
- include etcd dep
Eric Paris 7edc062
072f6d4
* Tue Mar 31 2015 jchaloup <jchaloup@redhat.com> - 0.4.6-0.2.rc1.git2af7a95
072f6d4
- Bump to upstream 2af7a9525b09fb715b215a1fb852dd4814ef52b5
072f6d4
  related: #1141807
072f6d4
cd8aa08
* Wed Feb 18 2015 jchaloup <jchaloup@redhat.com> - 0.4.6-0.1.rc1.git6aa2da5
cd8aa08
- Bump to upstream 6aa2da5a7a905609c93036b9307185a04a5a84a5
cd8aa08
  related: #1141807
cd8aa08
fd53bd3
* Wed Jan 28 2015 jchaloup <jchaloup@redhat.com> - 0.2.0-0.5.rc1.gitb7c233e
fd53bd3
- Bump to upstream b7c233e2ef9be1016c63f66145161b317165ad7e
fd53bd3
  related: #1141807
fd53bd3
7c03719
* Thu Oct 23 2014 jchaloup <jchaloup@redhat.com> - 0.2.0-0.4.rc1.git6fe04d5
7c03719
- Choose the correct architecture
7c03719
  related: #1141807
7c03719
aef93b0
* Thu Oct 23 2014 jchaloup <jchaloup@redhat.com> - 0.2.0-0.3.rc1.git6fe04d5
aef93b0
- Bump to upstream 6fe04d580dfb71c9e34cbce2f4df9eefd1e1241e
aef93b0
  resolves: #1141807
aef93b0
e218648
* Mon Sep 15 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.2.0-0.2.rc1.git23142f6
e218648
 - do not redefine gopath
e218648
 - do not own dirs owned by golang
e218648
 - correct version number, rc tag goes in release
e218648
 - noarch
e218648
e218648
* Sat Sep 06 2014 Eric Paris 
e218648
- Bump to upstream 23142f6773a676cc2cae8dd0cb90b2ea761c853f
e218648
e218648
* Wed Aug 20 2014 Adam Miller <maxamillion@fedoraproject.org> - 0.2.0-0.1-rc1
e218648
- Initial fedora package