%global goipath github.com/go-tomb/tomb %global commit d5d1b5820637886def9eef33e03a27a9f166942c %global import_path gopkg.in/v2/tomb %global import_path_sec gopkg.in/tomb.v2 %global v1_commit dd632973f1e7218eb1089048e0798ec9ae7dceb8 %global v1_shortcommit %(c=%{v1_commit}; echo ${c:0:7}) %global v1_import_path gopkg.in/v1/tomb %global v1_import_path_sec gopkg.in/tomb.v1 %global devel_main golang-gopkg-tomb-devel-v2 %gometa Name: golang-github-go-tomb-tomb Version: 0 Release: 5%{?dist} Summary: The tomb package helps with clean goroutine termination in the Go language License: BSD URL: %{gourl} Group: Development/Other Source0: %{gosource} Source1: https://%{goipath}/archive/%{v1_commit}/tomb-%{v1_commit}.tar.gz BuildArch: noarch %description %{summary}. %package devel Summary: Enables Go programs to comfortably encode and decode YAML values BuildRequires: golang(gopkg.in/check.v1) Requires: golang(gopkg.in/check.v1) %description devel %{summary}. This package contains library source intended for building other packages which use import path with %{v1_import_path} prefix. %package devel-v2 Summary: Enables Go programs to comfortably encode and decode YAML values %description devel-v2 %{summary}. This package contains library source intended for building other packages which use import path with %{goipath} prefix. %prep %setup -q -n tomb-%{v1_commit} -T -b 1 %forgesetup %install %goinstall %goinstall -i %{import_path} -o devel.file-list %goinstall -i %{import_path_sec} -o devel.file-list cw=$(pwd) pushd ../tomb-%{v1_commit} %goinstall -i %{v1_import_path} -o ${cw}/v1_devel.file-list %goinstall -i %{v1_import_path_sec} -o ${cw}/v1_devel.file-list # TODO(jchaloup): create rpm macros for this!!! #github.com/go-tomb/tomb -> gopkg.in/v2/tomb pushd %{buildroot}/%{gopath}/src/%{import_path}/ sed -i 's/"github\.com\/go-tomb\/tomb/"gopkg\.in\/v2\/tomb/g' \ $(find . -name '*.go') #'github.com/go-tomb/tomb -> gopkg.in/tomb.v2 cd %{buildroot}/%{gopath}/src/%{import_path_sec}/ sed -i 's/"github\.com\/go-tomb\/tomb/"gopkg\.in\/tomb\.v2/g' \ $(find . -name '*.go') #gopkg.in/v1/tomb -> gopkg.in/tomb.v1 cd %{buildroot}/%{gopath}/src/%{v1_import_path_sec}/ sed -i 's/"gopkg\.in\/v1\/tomb/"gopkg\.in\/tomb\.v1/g' \ $(find . -name '*.go') popd %check %gochecks pushd %{buildroot}/%{gopath}/src/%{import_path}/ %gochecks -i %{import_path} cd %{buildroot}/%{gopath}/src/%{import_path_sec}/ %gochecks popd #define license tag if not already defined %{!?_licensedir:%global license %doc} %files devel -f v1_devel.file-list %license LICENSE %doc README.md %files devel-v2 -f devel.file-list %license LICENSE %doc README.md %changelog * Sun Nov 25 2018 pterjan <pterjan> 0-5.mga7 + Revision: 1334299 - SILNT Add back group - Sync with fedora to get both v1 and v2 - Fix rest running + umeabot <umeabot> - Mageia 7 Mass Rebuild - Mageia 7 Mass Rebuild * Sat Mar 05 2016 pterjan <pterjan> 0-0.2.git14b3d72.mga6 + Revision: 985996 - Make the package compatible with the mass rebuild * Fri Jul 31 2015 joequant <joequant> 0-0.1.git14b3d72.mga6 + Revision: 860000 - imported package golang-github-go-tomb-tomb