a8f39a5
%global goipath         github.com/go-tomb/tomb
c121316
%global commit          d5d1b5820637886def9eef33e03a27a9f166942c
17fc998
a8f39a5
%global import_path     gopkg.in/v2/tomb
a8f39a5
%global import_path_sec gopkg.in/tomb.v2
17fc998
7e1428d
%global v1_commit          dd632973f1e7218eb1089048e0798ec9ae7dceb8
7e1428d
%global v1_shortcommit     %(c=%{v1_commit}; echo ${c:0:7})
a8f39a5
%global v1_import_path     gopkg.in/v1/tomb
a8f39a5
%global v1_import_path_sec gopkg.in/tomb.v1
7e1428d
a8f39a5
%global devel_main      golang-gopkg-tomb-devel-v2
7e1428d
a8f39a5
%gometa
a8f39a5
a8f39a5
Name:           golang-github-go-tomb-tomb
17fc998
Version:        0
a8f39a5
Release:        15%{?dist}
a8f39a5
Summary:        The tomb package helps with clean goroutine termination in the Go language
17fc998
License:        BSD
a8f39a5
URL:            %{gourl}
a8f39a5
Source0:        %{gosource}
a8f39a5
Source1:        https://%{goipath}/archive/%{v1_commit}/tomb-%{v1_commit}.tar.gz
17fc998
17fc998
%description
a8f39a5
%{summary}.
17fc998
17fc998
%package devel
a8f39a5
Summary:        Enables Go programs to comfortably encode and decode YAML values
a8f39a5
BuildArch:      noarch
851a990
a8f39a5
BuildRequires:  golang(gopkg.in/check.v1)
a8f39a5
Requires:       golang(gopkg.in/check.v1)
17fc998
17fc998
%description devel
a8f39a5
%{summary}.
17fc998
17fc998
This package contains library source intended for
851a990
building other packages which use import path with
a8f39a5
%{v1_import_path} prefix.
7e1428d
a8f39a5
%package devel-v2
a8f39a5
Summary:        Enables Go programs to comfortably encode and decode YAML values
a8f39a5
BuildArch:      noarch
7e1428d
a8f39a5
%description devel-v2
a8f39a5
%{summary}.
7e1428d
7e1428d
This package contains library source intended for
7e1428d
building other packages which use import path with
a8f39a5
%{goipath} prefix.
851a990
851a990
%prep
a8f39a5
%setup -q -n tomb-%{v1_commit} -T -b 1
a8f39a5
%forgesetup
17fc998
17fc998
%install
a8f39a5
%goinstall
a8f39a5
%goinstall -i %{import_path} -o devel.file-list
a8f39a5
%goinstall -i %{import_path_sec} -o devel.file-list
a8f39a5
a8f39a5
cw=$(pwd)
a8f39a5
pushd ../tomb-%{v1_commit}
a8f39a5
%goinstall -i %{v1_import_path} -o ${cw}/v1_devel.file-list
a8f39a5
%goinstall -i %{v1_import_path_sec} -o ${cw}/v1_devel.file-list
a8f39a5
a8f39a5
# TODO(jchaloup): create rpm macros for this!!!
a8f39a5
#github.com/go-tomb/tomb -> gopkg.in/v2/tomb
a8f39a5
pushd %{buildroot}/%{gopath}/src/%{import_path}/
a8f39a5
sed -i 's/"github\.com\/go-tomb\/tomb/"gopkg\.in\/v2\/tomb/g' \
a8f39a5
        $(find . -name '*.go')
a8f39a5
#'github.com/go-tomb/tomb -> gopkg.in/tomb.v2
a8f39a5
cd %{buildroot}/%{gopath}/src/%{import_path_sec}/
a8f39a5
sed -i 's/"github\.com\/go-tomb\/tomb/"gopkg\.in\/tomb\.v2/g' \
a8f39a5
        $(find . -name '*.go')
a8f39a5
#gopkg.in/v1/tomb -> gopkg.in/tomb.v1
a8f39a5
cd %{buildroot}/%{gopath}/src/%{v1_import_path_sec}/
a8f39a5
sed -i 's/"gopkg\.in\/v1\/tomb/"gopkg\.in\/tomb\.v1/g' \
a8f39a5
        $(find . -name '*.go')
7e1428d
popd
7e7ec00
17fc998
%check
a8f39a5
%gochecks
a8f39a5
pushd %{buildroot}/%{gopath}/src/%{import_path}/
a8f39a5
%gochecks -i %{import_path}
a8f39a5
cd %{buildroot}/%{gopath}/src/%{import_path_sec}/
a8f39a5
%gochecks
a8f39a5
popd
17fc998
7e7ec00
#define license tag if not already defined
7e7ec00
%{!?_licensedir:%global license %doc}
7e7ec00
a8f39a5
%files devel -f v1_devel.file-list
7e7ec00
%license LICENSE
851a990
%doc README.md
7e1428d
a8f39a5
%files devel-v2 -f devel.file-list
7e1428d
%license LICENSE
7e1428d
%doc README.md
17fc998
17fc998
%changelog
a8f39a5
* Wed Oct 31 2018 Robert-André Mauchin <zebob.m@gmail.com> - 0.14.20181031gitd5d1b58
a8f39a5
- Update to new Go packaging
a8f39a5
- Bump to commit dd632973f1e7218eb1089048e0798ec9ae7dceb8 and d5d1b5820637886def9eef33e03a27a9f166942c
a8f39a5
70de83b
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.13.gitd5d1b58
70de83b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
70de83b
cde14c1
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.12.gitd5d1b58
cde14c1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
cde14c1
48a09b3
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.11.gitd5d1b58
48a09b3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
48a09b3
05d8891
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.10.gitd5d1b58
05d8891
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
05d8891
c121316
* Mon Mar 27 2017 Jan Chaloupka <jchaloup@redhat.com> - 0-0.9.gitd5d1b58
c121316
- Bump to upstream d5d1b5820637886def9eef33e03a27a9f166942c
c121316
  related: #1249041
c121316
  resolves: #1435616
c121316
6dabde5
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.8.git14b3d72
6dabde5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
6dabde5
4a1f062
* Thu Jul 21 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.7.git14b3d72
4a1f062
- https://fedoraproject.org/wiki/Changes/golang1.7
4a1f062
7e1428d
* Fri Apr 15 2016 jchaloup <jchaloup@redhat.com> - 0-0.6.git14b3d72
7e1428d
- Extend with gopkg.in/tomb.v1
7e1428d
  related: #1249041
7e1428d
ca7a01b
* Mon Feb 22 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.5.git14b3d72
ca7a01b
- https://fedoraproject.org/wiki/Changes/golang1.6
ca7a01b
15892cb
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.4.git14b3d72
15892cb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
15892cb
7e7ec00
* Sat Sep 12 2015 jchaloup <jchaloup@redhat.com> - 0-0.3.git14b3d72
7e7ec00
- Update to spec-2.1
7e7ec00
  related: #1249041
7e7ec00
851a990
* Fri Jul 31 2015 jchaloup <jchaloup@redhat.com> - 0-0.2.git14b3d72
851a990
- Update spec file to spec-2.0
851a990
  resolves: #1249041
851a990
17fc998
* Mon Jun 15 2015 Marek Skalick√Ĺ <mskalick@redhat.com> - 0-0.1.git14b3d72
17fc998
- First package for Fedora
17fc998
  resolves: #1232221