Update to latest Go macros.

This commit is contained in:
Elliott Sales de Andrade 2019-07-10 20:05:43 -04:00
parent 18fc9f2b9c
commit cfc5088268

View File

@ -1,18 +1,28 @@
%bcond_without check
# https://github.com/git-lfs/git-lfs
%global goipath github.com/git-lfs/git-lfs
Version: 2.7.2
%gometa
%global common_description %{expand:
Git extension for versioning large files.}
%global golicenses LICENSE.md
%global godocs docs CHANGELOG.md CODE-OF-CONDUCT.md\\\
CONTRIBUTING.md README.md
Name: git-lfs
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Git extension for versioning large files
License: MIT
URL: https://git-lfs.github.io/
Source0: %{gosource}
BuildRequires: golang(github.com/ThomsonReutersEikon/go-ntlm/ntlm)
BuildRequires: golang(github.com/git-lfs/gitobj) >= 1.1.0
BuildRequires: golang(github.com/git-lfs/gitobj/errors) >= 1.1.0
BuildRequires: golang(github.com/git-lfs/go-netrc/netrc) >= 0-0.1.20180827gite0e9ca4
BuildRequires: golang(github.com/git-lfs/wildmatch) >= 1.0.2
BuildRequires: golang(github.com/kr/pty)
@ -21,10 +31,14 @@ BuildRequires: golang(github.com/olekukonko/ts)
BuildRequires: golang(github.com/pkg/errors)
BuildRequires: golang(github.com/rubyist/tracerx)
BuildRequires: golang(github.com/spf13/cobra) >= 0.0.3
BuildRequires: golang(github.com/ThomsonReutersEikon/go-ntlm/ntlm)
BuildRequires: golang(golang.org/x/sync/semaphore)
# Generate mans
# Generate man pages
BuildRequires: /usr/bin/ronn
# For tests
%if %{with check}
# Tests
BuildRequires: golang(github.com/stretchr/testify/assert) >= 1.2.2
BuildRequires: golang(github.com/stretchr/testify/require) >= 1.2.2
BuildRequires: golang(github.com/xeipuuv/gojsonschema)
@ -32,6 +46,7 @@ BuildRequires: perl-Digest-SHA
BuildRequires: perl-Test-Harness
# Tests require full git suite, but not generally needed.
BuildRequires: git >= 1.8.5
%endif
Requires: git-core >= 1.8.5
@ -41,48 +56,36 @@ videos, datasets, and graphics with text pointers inside Git, while
storing the file contents on a remote server.
%package -n %{goname}-devel
Summary: %{summary}
BuildArch: noarch
%description -n %{goname}-devel
%{summary}
This package contains library source intended for building other packages
which use import path with %{goipath} prefix.
%gopkg
%prep
%forgeautosetup -p1
rm -rf vendor
%goprep
# Modify Makefile so that it expects binaries where we build them.
sed -i -e 's!/bin/!/_bin/!g' t/Makefile
sed -i -e 's!\.\./bin/!/%{gobuilddir}/bin/!g' t/Makefile
%build
%gobuildroot
# Build manpages first (some embedding in the executable is done.)
pushd docs
ronn --roff man/*.ronn
%gobuild -o ../_bin/mangen man/mangen.go
../_bin/mangen
%gobuild -o %{gobuilddir}/bin/mangen man/mangen.go
%{gobuilddir}/bin/mangen
popd
%gobuild -o _bin/git-lfs %{goipath}
%gobuild -o %{gobuilddir}/bin/git-lfs %{goipath}
# Build test executables
for go in t/cmd/*.go; do
%gobuild -o "_bin/$(basename $go .go)" "$go"
for cmd in t/cmd/*.go; do
%gobuild -o "%{gobuilddir}/bin/$(basename $cmd .go)" "$cmd"
done
%gobuild -o "_bin/git-lfs-test-server-api" t/git-lfs-test-server-api/*.go
%gobuild -o "%{gobuilddir}/bin/git-lfs-test-server-api" t/git-lfs-test-server-api/*.go
%install
%goinstall
install -Dpm0755 _bin/git-lfs %{buildroot}%{_bindir}/%{name}
%gopkginstall
install -Dpm0755 %{gobuilddir}/bin/git-lfs %{buildroot}%{_bindir}/%{name}
install -d -p %{buildroot}%{_mandir}/man1/
install -Dpm0644 docs/man/*.1 %{buildroot}%{_mandir}/man1/
install -d -p %{buildroot}%{_mandir}/man5/
@ -99,24 +102,28 @@ fi
exit 0
%if %{with check}
%check
%gochecks
PATH=%{buildroot}%{_bindir}:$PWD/_bin:$PATH \
%gocheck
PATH=%{buildroot}%{_bindir}:%{gobuilddir}/bin:$PATH \
make -C t PROVE_EXTRA_ARGS="-j$(getconf _NPROCESSORS_ONLN)"
%endif
%files
%doc README.md CHANGELOG.md
%doc README.md CHANGELOG.md docs
%license LICENSE.md
%{_bindir}/%{name}
%{_mandir}/man1/%{name}*.1*
%{_mandir}/man5/%{name}*.5*
%files -n %{goname}-devel -f devel.file-list
%license LICENSE.md
%gopkgfiles
%changelog
* Wed Jul 10 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.7.2-2
- Update to latest Go macros
* Wed Apr 24 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.7.2-1
- Update to latest version