Blame golang-github-docker-go.spec

1e34e2e
%if 0%{?fedora} || 0%{?rhel} == 6
1e34e2e
%global with_devel 1
1e34e2e
%global with_bundled 0
1e34e2e
%global with_debug 0
1e34e2e
%global with_check 1
1e34e2e
%global with_unit_test 1
1e34e2e
%else
1e34e2e
%global with_devel 0
1e34e2e
%global with_bundled 0
1e34e2e
%global with_debug 0
1e34e2e
%global with_check 0
1e34e2e
%global with_unit_test 0
1e34e2e
%endif
1e34e2e
1e34e2e
%if 0%{?with_debug}
1e34e2e
%global _dwz_low_mem_die_limit 0
1e34e2e
%else
1e34e2e
%global debug_package   %{nil}
1e34e2e
%endif
1e34e2e
1e34e2e
%global provider        github
1e34e2e
%global provider_tld    com
1e34e2e
%global project         docker
1e34e2e
%global repo            go
1e34e2e
# https://github.com/docker/go
1e34e2e
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
1e34e2e
%global import_path     %{provider_prefix}
a17a0f6
%global commit          d30aec9fd63c35133f8f79c3412ad91a3b08be06
1e34e2e
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
1e34e2e
1e34e2e
Name:           golang-%{provider}-%{project}-%{repo}
1e34e2e
Version:        1.5.1
de64551
Release:        0.5.git%{shortcommit}%{?dist}
1e34e2e
Summary:        Go packages with small patches autogenerated
1e34e2e
# Detected licences
1e34e2e
# - BSD (3 clause) at 'LICENSE'
1e34e2e
License:        BSD
1e34e2e
URL:            https://%{provider_prefix}
1e34e2e
Source0:        https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
1e34e2e
1e34e2e
# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required
1e34e2e
ExclusiveArch:  %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
1e34e2e
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
1e34e2e
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
1e34e2e
1e34e2e
%description
1e34e2e
%{summary}
1e34e2e
1e34e2e
%if 0%{?with_devel}
1e34e2e
%package devel
1e34e2e
Summary:       %{summary}
1e34e2e
BuildArch:     noarch
1e34e2e
1e34e2e
%if 0%{?with_check} && ! 0%{?with_bundled}
1e34e2e
%endif
1e34e2e
1e34e2e
Provides:      golang(%{import_path}/canonical/json) = %{version}-%{release}
1e34e2e
1e34e2e
%description devel
1e34e2e
%{summary}
1e34e2e
1e34e2e
This package contains library source intended for
1e34e2e
building other packages which use import path with
1e34e2e
%{import_path} prefix.
1e34e2e
%endif
1e34e2e
1e34e2e
%if 0%{?with_unit_test} && 0%{?with_devel}
1e34e2e
%package unit-test-devel
1e34e2e
Summary:         Unit tests for %{name} package
1e34e2e
%if 0%{?with_check}
1e34e2e
#Here comes all BuildRequires: PACKAGE the unit tests
1e34e2e
#in %%check section need for running
1e34e2e
%endif
1e34e2e
1e34e2e
# test subpackage tests code from devel subpackage
1e34e2e
Requires:        %{name}-devel = %{version}-%{release}
1e34e2e
1e34e2e
%if 0%{?with_check} && ! 0%{?with_bundled}
1e34e2e
%endif
1e34e2e
1e34e2e
%description unit-test-devel
1e34e2e
%{summary}
1e34e2e
1e34e2e
This package contains unit tests for project
1e34e2e
providing packages with %{import_path} prefix.
1e34e2e
%endif
1e34e2e
1e34e2e
%prep
1e34e2e
%setup -q -n %{repo}-%{commit}
1e34e2e
1e34e2e
%build
1e34e2e
1e34e2e
%install
1e34e2e
# source codes for building projects
1e34e2e
%if 0%{?with_devel}
1e34e2e
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
1e34e2e
echo "%%dir %%{gopath}/src/%%{import_path}/." >> devel.file-list
1e34e2e
# find all *.go but no *_test.go files and generate devel.file-list
1e34e2e
for file in $(find . -iname "*.go" \! -iname "*_test.go") ; do
1e34e2e
    echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
1e34e2e
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
1e34e2e
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
1e34e2e
    echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list
1e34e2e
done
1e34e2e
%endif
1e34e2e
1e34e2e
# testing files for this project
1e34e2e
%if 0%{?with_unit_test} && 0%{?with_devel}
1e34e2e
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
1e34e2e
# find all *_test.go files and generate unit-test-devel.file-list
1e34e2e
for file in $(find . -iname "*_test.go"); do
1e34e2e
    echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
1e34e2e
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
1e34e2e
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
1e34e2e
    echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test-devel.file-list
1e34e2e
done
1e34e2e
%endif
1e34e2e
1e34e2e
%if 0%{?with_devel}
1e34e2e
sort -u -o devel.file-list devel.file-list
1e34e2e
%endif
1e34e2e
1e34e2e
%check
1e34e2e
%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel}
1e34e2e
%if ! 0%{?with_bundled}
1e34e2e
export GOPATH=%{buildroot}/%{gopath}:%{gopath}
1e34e2e
%else
1e34e2e
export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath}
1e34e2e
%endif
1e34e2e
1e34e2e
%gotest %{import_path}/canonical/json
1e34e2e
%endif
1e34e2e
1e34e2e
#define license tag if not already defined
1e34e2e
%{!?_licensedir:%global license %doc}
1e34e2e
1e34e2e
%if 0%{?with_devel}
1e34e2e
%files devel -f devel.file-list
1e34e2e
%license LICENSE
1e34e2e
%doc README.md
1e34e2e
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
1e34e2e
%endif
1e34e2e
1e34e2e
%if 0%{?with_unit_test} && 0%{?with_devel}
1e34e2e
%files unit-test-devel -f unit-test-devel.file-list
1e34e2e
%license LICENSE
1e34e2e
%doc README.md
1e34e2e
%endif
1e34e2e
1e34e2e
%changelog
de64551
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.1-0.5.gitd30aec9
de64551
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
de64551
e248a21
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.1-0.4.gitd30aec9
e248a21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
e248a21
d5331cf
* Thu Jul 21 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.1-0.3.gitd30aec9
d5331cf
- https://fedoraproject.org/wiki/Changes/golang1.7
d5331cf
a17a0f6
* Tue Mar 15 2016 jchaloup <jchaloup@redhat.com> - 1.5.1-0.2.gitd30aec9
a17a0f6
- Bump to upstream d30aec9fd63c35133f8f79c3412ad91a3b08be06
a17a0f6
  related: #1313942
a17a0f6
1e34e2e
* Wed Mar 02 2016 jchaloup <jchaloup@redhat.com> - 0-0.1.gitbaf439e
1e34e2e
- First package for Fedora
1e34e2e
  resolves: #1313942