fcdbb83
# If any of the following macros should be set otherwise,
fcdbb83
# you can wrap any of them with the following conditions:
fcdbb83
# - %%if 0%%{centos} == 7
fcdbb83
# - %%if 0%%{?rhel} == 7
fcdbb83
# - %%if 0%%{?fedora} == 23
fcdbb83
# Or just test for particular distribution:
fcdbb83
# - %%if 0%%{centos}
fcdbb83
# - %%if 0%%{?rhel}
fcdbb83
# - %%if 0%%{?fedora}
fcdbb83
#
fcdbb83
# Be aware, on centos, both %%rhel and %%centos are set. If you want to test
fcdbb83
# rhel specific macros, you can use %%if 0%%{?rhel} && 0%%{?centos} == 0 condition.
fcdbb83
# (Don't forget to replace double percentage symbol with single one in order to apply a condition)
fcdbb83
fcdbb83
# Generate devel rpm
e713165
%global with_devel 1
fcdbb83
# Build project from bundled dependencies
e713165
%global with_bundled 0
fcdbb83
# Build with debug info rpm
e713165
%global with_debug 0
fcdbb83
# Run tests in check section
e713165
%global with_check 1
fcdbb83
# Generate unit-test rpm
e713165
%global with_unit_test 1
e713165
e713165
%if 0%{?with_debug}
e713165
%global _dwz_low_mem_die_limit 0
e713165
%else
d774822
%global debug_package   %{nil}
e713165
%endif
e713165
e713165
%global provider        github
7085d54
%global provider_tld    com
e713165
%global project         pborman
e713165
%global repo            uuid
e713165
# https://github.com/pborman/uuid
e713165
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
9ee0129
%global import_path     %{provider_prefix}
fcdbb83
%global commit          b984ec7fa9ff9e428bd0cf0abf429384dfbe3e37
e713165
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
d774822
9ee0129
%global gc_import_path   code.google.com/p/go-uuid/uuid
9ee0129
9ee0129
%global g_name          golang-github-pborman-uuid
9ee0129
d774822
Name:           golang-googlecode-uuid
d774822
Version:        0
e8a035b
Release:        0.16.git%{shortcommit}%{?dist}
d774822
Summary:        Generates and inspects UUIDs based on RFC 4122 and DCE 1.1
d774822
License:        BSD
e713165
URL:            https://%{provider_prefix}
e713165
Source0:        https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
e713165
9ee0129
# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required
fcdbb83
ExclusiveArch:  %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}}
9ee0129
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
9ee0129
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
d774822
d774822
%description
d774822
%{summary}
d774822
e713165
%if 0%{?with_devel}
d774822
%package devel
e713165
Summary:       %{summary}
e713165
BuildArch:     noarch
e713165
e713165
%if 0%{?with_check}
e713165
%endif
e713165
9ee0129
Provides:      golang(%{gc_import_path}) = %{version}-%{release}
d774822
d774822
%description devel
d774822
%{summary}
d774822
e713165
This package contains library source intended for
e713165
building other packages which use import path with
9ee0129
%{gc_import_path} prefix.
9ee0129
9ee0129
%package -n %{g_name}-devel
9ee0129
Summary:       %{summary}
9ee0129
BuildArch:     noarch
9ee0129
9ee0129
%if 0%{?with_check}
9ee0129
%endif
9ee0129
9ee0129
Provides:      golang(%{import_path}) = %{version}-%{release}
9ee0129
9ee0129
%description -n %{g_name}-devel
9ee0129
%{summary}
9ee0129
9ee0129
This package contains library source intended for
9ee0129
building other packages which use import path with
e713165
%{import_path} prefix.
e713165
%endif
d774822
e713165
%if 0%{?with_unit_test}
9ee0129
%package -n %{g_name}-unit-test
e713165
Summary:         Unit tests for %{name} package
d774822
e713165
%if 0%{?with_check}
e713165
#Here comes all BuildRequires: PACKAGE the unit tests
e713165
#in %%check section need for running
e713165
%endif
e713165
e713165
# test subpackage tests code from devel subpackage
9ee0129
Requires:        %{g_name}-devel = %{version}-%{release}
e713165
9ee0129
%description -n %{g_name}-unit-test
e713165
%{summary}
e713165
e713165
This package contains unit tests for project
e713165
providing packages with %{import_path} prefix.
e713165
%endif
e713165
e713165
%prep
e713165
%setup -q -n %{repo}-%{commit}
d774822
d774822
%build
d774822
d774822
%install
e713165
chmod -x *.go
e713165
# source codes for building projects
e713165
%if 0%{?with_devel}
9ee0129
install -d -p %{buildroot}/%{gopath}/src/%{gc_import_path}/
9ee0129
echo "%%dir %%{gopath}/src/%%{gc_import_path}/." >> gc_devel.file-list
9ee0129
# find all *.go but no *_test.go files and generate devel.file-list
9ee0129
for file in $(find . -iname "*.go" \! -iname "*_test.go") ; do
9ee0129
    echo "%%dir %%{gopath}/src/%%{gc_import_path}/$(dirname $file)" >> gc_devel.file-list
9ee0129
    install -d -p %{buildroot}/%{gopath}/src/%{gc_import_path}/$(dirname $file)
9ee0129
    cp -pav $file %{buildroot}/%{gopath}/src/%{gc_import_path}/$file
9ee0129
    echo "%%{gopath}/src/%%{gc_import_path}/$file" >> gc_devel.file-list
9ee0129
done
9ee0129
e713165
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
9ee0129
echo "%%dir %%{gopath}/src/%%{import_path}/." >> devel.file-list
e713165
# find all *.go but no *_test.go files and generate devel.file-list
e713165
for file in $(find . -iname "*.go" \! -iname "*_test.go") ; do
9ee0129
    echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
e713165
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
e713165
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
e713165
    echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list
d774822
done
e713165
%endif
e713165
e713165
# testing files for this project
e713165
%if 0%{?with_unit_test}
e713165
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
e713165
# find all *_test.go files and generate unit-test.file-list
e713165
for file in $(find . -iname "*_test.go"); do
9ee0129
    echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
e713165
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
e713165
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
e713165
    echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test.file-list
e713165
done
e713165
%endif
d774822
9ee0129
%if 0%{?with_devel}
9ee0129
sort -u -o devel.file-list devel.file-list
9ee0129
%endif
9ee0129
d774822
%check
e713165
%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel}
9ee0129
%if ! 0%{?with_bundled}
9ee0129
export GOPATH=%{buildroot}/%{gopath}:%{gopath}
e713165
%else
9ee0129
export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath}
e713165
%endif
9ee0129
9ee0129
%if ! 0%{?gotest:1}
9ee0129
%global gotest go test
e713165
%endif
e713165
9ee0129
%gotest %{import_path}
e713165
%endif
d774822
9ee0129
#define license tag if not already defined
9ee0129
%{!?_licensedir:%global license %doc}
9ee0129
e713165
%if 0%{?with_devel}
9ee0129
%files devel -f gc_devel.file-list
9ee0129
%license LICENSE
e713165
%doc CONTRIBUTORS
9ee0129
%dir %{gopath}/src/code.google.com/p/go-uuid
9ee0129
9ee0129
%files -n %{g_name}-devel -f devel.file-list
9ee0129
%license LICENSE
9ee0129
%doc CONTRIBUTORS
9ee0129
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
e713165
%endif
e713165
e713165
%if 0%{?with_unit_test}
9ee0129
%files -n %{g_name}-unit-test -f unit-test.file-list
9ee0129
%license LICENSE
e713165
%endif
d774822
d774822
%changelog
e8a035b
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.16.gitb984ec7
e8a035b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
e8a035b
b435128
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.15.gitb984ec7
b435128
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
b435128
247975b
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.14.gitb984ec7
247975b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
247975b
da5e61e
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.13.gitb984ec7
da5e61e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
da5e61e
aa512e8
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.12.gitb984ec7
aa512e8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
aa512e8
fcdbb83
* Wed Jan 18 2017 Jan Chaloupka <jchaloup@redhat.com> - 0-0.11.gitb984ec7
fcdbb83
- Bump to upstream b984ec7fa9ff9e428bd0cf0abf429384dfbe3e37
fcdbb83
  related: #1250523
fcdbb83
6961ca7
* Tue Aug 09 2016 jchaloup <jchaloup@redhat.com> - 0-0.10.gitca53cad
6961ca7
- Enable devel and unit-test for epel7
6961ca7
  related: #1250523
6961ca7
e641c28
* Thu Jul 21 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.9.gitca53cad
e641c28
- https://fedoraproject.org/wiki/Changes/golang1.7
e641c28
9ee0129
* Thu Apr 14 2016 jchaloup <jchaloup@redhat.com> - 0-0.8.gitca53cad
9ee0129
- Polish spec file
9ee0129
- Support github.com/pborman/uuid ipprefix as well
9ee0129
  related: #1250523
9ee0129
cc960e4
* Mon Feb 22 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.7.gitca53cad
cc960e4
- https://fedoraproject.org/wiki/Changes/golang1.6
cc960e4
1625d9d
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.6.gitca53cad
1625d9d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
1625d9d
e713165
* Thu Aug 20 2015 jchaloup <jchaloup@redhat.com> - 0-0.5.gitca53cad
e713165
- Update spec file to spec-2.0
e713165
  resolves: #1250523
e713165
c03abab
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.4.hg7dda39b2e7d5
c03abab
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
c03abab
7085d54
* Sun Feb 15 2015 jchaloup <jchaloup@redhat.com> - 0-0.3.hg7dda39b2e7d5
7085d54
- Fix incorrect provides
7085d54
  resolves: #1192652
7085d54
d774822
* Mon Sep 15 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.2.hg7dda39b2e7d5
d774822
- preserve timestamps
d774822
- do not own dirs owned by golang
d774822
d774822
* Mon Aug 04 2014 Adam Miller <maxamillion@fedoraproject.org> - 0-0.1.hg7dda39b2e7d5
d774822
- First package for Fedora.