diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7176cca --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/numcpus-0.2.3.tar.gz diff --git a/golang-github-tklauser-numcpus.spec b/golang-github-tklauser-numcpus.spec new file mode 100644 index 0000000..fb09ef6 --- /dev/null +++ b/golang-github-tklauser-numcpus.spec @@ -0,0 +1,73 @@ +## START: Set by rpmautospec +%define autorelease(e:s:pb:) %{?-p:0.}%{lua: + release_number = 2; + base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); + print(release_number + base_release_number - 1); +}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{?dist} +## END: Set by rpmautospec + +# Generated by go2rpm 1.5.0 +%bcond_without check + +# https://github.com/tklauser/numcpus +%global goipath github.com/tklauser/numcpus +Version: 0.2.3 + +%gometa + +%global common_description %{expand: +Go module to get the number of CPUs on a Linux/BSD system.} + +%global golicenses LICENSE +%global godocs README.md + +Name: %{goname} +Release: %autorelease +Summary: Go module to get the number of CPUs on a Linux/BSD system + +# Upstream license specification: Apache-2.0 +License: ASL 2.0 +URL: %{gourl} +Source0: %{gosource} + +%description +%{common_description} + +%gopkg + +%prep +%goprep + +%build +for cmd in cmd/* ; do + %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd +done + +%install +%gopkginstall +install -m 0755 -vd %{buildroot}%{_bindir} +install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ + +%if %{with check} +%check +# https://github.com/tklauser/numcpus/issues/15 +for test in "TestGetPresent" \ +; do +awk -i inplace '/^func.*'"$test"'\(/ { print; print "\tt.Skip(\"disabled failing test\")"; next}1' $(grep -rl $test) +done +%gocheck +%endif + +%files +%license LICENSE +%doc README.md +%{_bindir}/* + +%gopkgfiles + +%changelog +* Thu Jul 29 2021 Robert-André Mauchin 0.2.3-2 +- Uncommitted changes + +* Thu Jul 29 2021 Robert-André Mauchin 0.2.3-1 +- Initial release diff --git a/sources b/sources new file mode 100644 index 0000000..1698eb4 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (numcpus-0.2.3.tar.gz) = 8a88b26733ecc4ed15e80dca84f786bb848fd8136a8fad35028b1ac37b12f095c337d39d0cfafdba08629123126f75747475362533e5a7f0cf82d3e728ec8256