diff --git a/.gitignore b/.gitignore index b8fdbb3..8f9cb67 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /units-2efee85.tar.gz +/units-2efee857e7cfd4f3d0138cc3cbb1b4966962b93a.tar.gz diff --git a/golang-github-alecthomas-units.spec b/golang-github-alecthomas-units.spec index bdaa1bd..705f16e 100644 --- a/golang-github-alecthomas-units.spec +++ b/golang-github-alecthomas-units.spec @@ -1,97 +1,58 @@ -%global debug_package %{nil} - -%global provider github -%global provider_tld com -%global project alecthomas -%global repo units # https://github.com/alecthomas/units -%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo} -%global import_path %{provider_prefix} -%global commit 2efee857e7cfd4f3d0138cc3cbb1b4966962b93a -%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%global goipath github.com/alecthomas/units +%global commit 2efee857e7cfd4f3d0138cc3cbb1b4966962b93a + +%gometa -Name: golang-%{provider}-%{project}-%{repo} +Name: %{goname} Version: 0 -Release: 0.3.git%{shortcommit}%{?dist} -Summary: Units - Helpful unit multipliers and functions for Go +Release: 0.4%{?dist} +Summary: Helpful unit multipliers and functions for Go +# Detected licences +# - Expat License at 'COPYING' License: MIT -URL: https://%{provider_prefix} -Source0: %{url}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz +URL: %{gourl} +Source0: %{gosource} -# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required -ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}} -# If go_compiler is not set to 1, there is no virtual provide. Use golang instead. -BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} +BuildRequires: golang(github.com/stretchr/testify/assert) %description -%{summary}. +%{summary} + %package devel -Summary: %{summary} -BuildArch: noarch -Provides: golang(%{import_path}) = %{version}-%{release} -BuildRequires: golang(github.com/stretchr/testify/assert) +Summary: %{summary} +BuildArch: noarch %description devel -%{summary}. +%{summary} This package contains library source intended for building other packages which use import path with -%{import_path} prefix. - -%package unit-test-devel -Summary: Unit tests for %{name} package -BuildArch: noarch -# test subpackage tests code from devel subpackage -Requires: %{name}-devel = %{version}-%{release} - -%description unit-test-devel -%{summary}. - -This package contains unit tests for project -providing packages with %{import_path} prefix. +%{goipath} prefix. %prep -%setup -q -n %{repo}-%{commit} +%forgeautosetup -%build %install -# source codes for building projects -install -d -p %{buildroot}%{gopath}/src/%{import_path}/ -echo "%%dir %%{gopath}/src/%%{import_path}/." >> devel.file-list -# find all *.go but no *_test.go files and generate devel.file-list -for file in $(find . -iname "*.go" \! -iname "*_test.go") ; do - echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list - install -d -p %{buildroot}%{gopath}/src/%{import_path}/$(dirname $file) - cp -pav $file %{buildroot}%{gopath}/src/%{import_path}/$file - echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list -done - -# testing files for this project -install -m644 bytes_test.go %{buildroot}%{gopath}/src/%{import_path}/ - -sort -u -o devel.file-list devel.file-list +%goinstall -%check -export GOPATH=%{buildroot}%{gopath}:%{gopath} -%if ! 0%{?gotest:1} -%global gotest go test -%endif +%check +%gochecks -%gotest %{import_path} %files devel -f devel.file-list -%doc README.md %license COPYING -%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project} +%doc README.md -%files unit-test-devel -%{gopath}/src/%{import_path}/bytes_test.go %changelog +* Sun Nov 11 2018 Robert-André Mauchin - 0-0.4.20181111git2efee85 +- Update to new Go packaging + * Fri Jul 13 2018 Fedora Release Engineering - 0-0.3.git2efee85 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild @@ -100,3 +61,4 @@ export GOPATH=%{buildroot}%{gopath}:%{gopath} * Fri Aug 11 2017 mosquito - 0-0.1.git2efee85 - Initial package + diff --git a/sources b/sources index d6bc302..088e995 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (units-2efee85.tar.gz) = 855f15eeb83bdc16981694f522aa1e200a3857ed11ae87fca9b0cc70734eac76f5082bc3ed92f843b818da14b58dc921dbb1aed4ea35de056c087a64b7e25fe4 +SHA512 (units-2efee857e7cfd4f3d0138cc3cbb1b4966962b93a.tar.gz) = 855f15eeb83bdc16981694f522aa1e200a3857ed11ae87fca9b0cc70734eac76f5082bc3ed92f843b818da14b58dc921dbb1aed4ea35de056c087a64b7e25fe4