# Generated by go2rpm 1.10.0
%bcond_without check
# https://github.com/oklog/ulid
%global goipath github.com/oklog/ulid
Version: 2.1.0
%gometa -L
%global goaltipaths %{goipath}/v2
%global common_description %{expand:
Universally Unique Lexicographically Sortable Identifier (ULID) in Go.}
%global golicenses LICENSE
%global godocs AUTHORS.md CHANGELOG.md CONTRIBUTING.md README.md
Name: golang-github-oklog-ulid
Release: %autorelease
Summary: Universally Unique Lexicographically Sortable Identifier (ULID) in Go
License: Apache-2.0
URL: %{gourl}
Source: %{gosource}
# Refactor default entropy and fix test
# https://github.com/oklog/ulid/pull/98
# Backported to v2.1.0 without changes to GitHub Actions in .github/
Patch: 0001-Refactor-default-entropy-and-fix-test-98.patch
%description %{common_description}
%gopkg
%prep
%goprep
%autopatch -p1
%generate_buildrequires
%go_generate_buildrequires
%build
for cmd in cmd/* ; do
%gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd
done
%install
%gopkginstall
install -m 0755 -vd %{buildroot}%{_bindir}
# Build the ulid binary as ulid-go, as suggested by upstream in:
# Multiple conflicting command-line tools called ulid exist
# https://github.com/oklog/ulid/issues/111
install -m 0755 -vp %{gobuilddir}/bin/ulid %{buildroot}%{_bindir}/ulid-go
%if %{with check}
%check
%gocheck
%endif
%files
%license LICENSE
%doc AUTHORS.md CHANGELOG.md CONTRIBUTING.md README.md
%{_bindir}/ulid-go
%gopkgfiles
%changelog
%autochangelog