diff --git a/.gitignore b/.gitignore index cc0385e..ddb70fb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /golang-github-fortytw2-leaktest-1.0.0.tar.gz /golang-github-fortytw2-leaktest-1.1.0.tar.gz /golang-github-fortytw2-leaktest-1.3.0.tar.gz +/leaktest-1.3.0.tar.gz diff --git a/golang-github-fortytw2-leaktest.spec b/golang-github-fortytw2-leaktest.spec index 3921355..50f6b9e 100644 --- a/golang-github-fortytw2-leaktest.spec +++ b/golang-github-fortytw2-leaktest.spec @@ -1,163 +1,52 @@ -# Generate devel rpm -%global with_devel 1 -# Build project from bundled dependencies -%global with_bundled 0 -# Build with debug info rpm -%global with_debug 0 -# Run tests in check section -%global with_check 1 -# Generate unit-test rpm -%global with_unit_test 1 - -%if 0%{?with_debug} -%global _dwz_low_mem_die_limit 0 -%else -%global debug_package %{nil} -%endif - +# Generated by go2rpm +%bcond_without check -%global provider github -%global provider_tld com -%global project fortytw2 -%global repo leaktest # https://github.com/fortytw2/leaktest -%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo} -%global import_path %{provider_prefix} -%global commit 9a23578d06a26ec1b47bfc8965bf5e7011df8bd6 -%global shortcommit %(c=%{commit}; echo ${c:0:7}) -%global git_tag v1.3.0 - -Name: golang-%{provider}-%{project}-%{repo} -Version: 1.3.0 -Release: 1%{?dist} -Summary: Goroutine Leak Detector -License: BSD -URL: https://%{provider_prefix} -Source0: https://%{provider_prefix}/archive/%{git_tag}/%{name}-%{version}.tar.gz -# Increase timeout for s390x -Patch0001: increase-timeout.patch - -# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required -ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{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} - - - -%description -Refactored, tested variant of the goroutine leak detector found in -both net/http tests and the cockroachdb source tree. - -%if 0%{?with_devel} -%package devel -Summary: %{summary} -BuildArch: noarch +%global goipath github.com/fortytw2/leaktest +Version: 1.3.0 +%gometa -Provides: golang(%{import_path}) = %{version}-%{release} +%global common_description %{expand: +Goroutine Leak Detector.} -%description devel -Refactored, tested variant of the goroutine leak detector found in -both net/http tests and the cockroachdb source tree. - -This package contains library source intended for -building other packages which use import path with -%{import_path} prefix. -%endif +%global golicenses LICENSE +%global godocs README.md -%if 0%{?with_unit_test} && 0%{?with_devel} -%package unit-test-devel -Summary: Unit tests for %{name} package +Name: %{goname} +Release: 1%{?dist} +Summary: Goroutine Leak Detector -# test subpackage tests code from devel subpackage -Requires: %{name}-devel = %{version}-%{release} +# Upstream license specification: BSD-3-Clause +License: BSD +URL: %{gourl} +Source0: %{gosource} +# Increase timeout for s390x +Patch0: increase-timeout.patch -%description unit-test-devel -Refactored, tested variant of the goroutine leak detector found in -both net/http tests and the cockroachdb source tree. +%description +%{common_description} -This package contains unit tests for project -providing packages with %{import_path} prefix. -%endif +%gopkg %prep -%autosetup -n %{repo}-%{version} -p1 - -%build +%goprep +%patch0 -p1 %install -# source codes for building projects -%if 0%{?with_devel} -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" -or -iname "*.s" \) \! -iname "*_test.go") ; do - dirprefix=$(dirname $file) - install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$dirprefix - cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file - echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list - - while [ "$dirprefix" != "." ]; do - echo "%%dir %%{gopath}/src/%%{import_path}/$dirprefix" >> devel.file-list - dirprefix=$(dirname $dirprefix) - done -done -%endif - -# testing files for this project -%if 0%{?with_unit_test} && 0%{?with_devel} -install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ -# find all *_test.go files and generate unit-test-devel.file-list -for file in $(find . -iname "*_test.go") ; do - dirprefix=$(dirname $file) - install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$dirprefix - cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file - echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test-devel.file-list - - while [ "$dirprefix" != "." ]; do - echo "%%dir %%{gopath}/src/%%{import_path}/$dirprefix" >> devel.file-list - dirprefix=$(dirname $dirprefix) - done -done -%endif - -%if 0%{?with_devel} -sort -u -o devel.file-list devel.file-list -%endif +%gopkginstall +%if %{with check} %check -%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel} - -export GOPATH=%{buildroot}/%{gopath}:%{gopath} - -%if ! 0%{?gotest:1} -%global gotest go test -%endif - -# Do not run tests for aarch64 due to concurrency errors -%ifnarch aarch64 -%gotest %{import_path} -%endif # arch +%gocheck %endif -#define license tag if not already defined -%{!?_licensedir:%global license %doc} - - -%if 0%{?with_devel} -%files devel -f devel.file-list -%license LICENSE -%doc README.md -%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project} -%endif - -%if 0%{?with_unit_test} && 0%{?with_devel} -%files unit-test-devel -f unit-test-devel.file-list -%license LICENSE -%doc README.md -%endif +%gopkgfiles %changelog +* Fri May 17 20:45:14 CEST 2019 Robert-André Mauchin - 1.3.0-2 +- Update to new macros + * Tue Feb 19 2019 Elliott Sales de Andrade - 1.3.0-1 - Update to latest version - Increase test timeout to work on s390x diff --git a/sources b/sources index cde3386..0eeb31d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (golang-github-fortytw2-leaktest-1.3.0.tar.gz) = de5cc791b7e81a9133d42f8b0f1c21efb7aedbb5b0e6554be3b0ecd6d06a43e1a2c75993caac0e7b1818f3adb0788187b8b56389240953bfe3876eee15a9ea7a +SHA512 (leaktest-1.3.0.tar.gz) = de5cc791b7e81a9133d42f8b0f1c21efb7aedbb5b0e6554be3b0ecd6d06a43e1a2c75993caac0e7b1818f3adb0788187b8b56389240953bfe3876eee15a9ea7a