Blame golang-github-klauspost-crc32.spec

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