136 lines
3.8 KiB
RPMSpec
136 lines
3.8 KiB
RPMSpec
%bcond_without check
|
|
|
|
# https://github.com/git-lfs/git-lfs
|
|
%global goipath github.com/git-lfs/git-lfs
|
|
Version: 2.13.3
|
|
|
|
%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: %autorelease
|
|
Summary: Git extension for versioning large files
|
|
|
|
License: MIT
|
|
URL: https://git-lfs.github.io/
|
|
Source0: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-v%{version}.tar.gz
|
|
Source1: README.Fedora
|
|
|
|
BuildRequires: golang(github.com/dpotapov/go-spnego)
|
|
BuildRequires: golang(github.com/git-lfs/gitobj/v2) >= 2
|
|
BuildRequires: golang(github.com/git-lfs/gitobj/v2/errors) >= 2
|
|
BuildRequires: golang(github.com/git-lfs/go-netrc/netrc) >= 0-0.1.20180827gite0e9ca4
|
|
BuildRequires: golang(github.com/git-lfs/go-ntlm/ntlm)
|
|
BuildRequires: golang(github.com/git-lfs/wildmatch) >= 1.0.4
|
|
BuildRequires: golang(github.com/mattn/go-isatty) >= 0.0.4
|
|
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/ssgelm/cookiejarparser) >= 1.0.1
|
|
BuildRequires: golang(golang.org/x/net/http2)
|
|
BuildRequires: golang(golang.org/x/sync/semaphore)
|
|
|
|
# Generate man pages
|
|
BuildRequires: /usr/bin/ronn
|
|
|
|
%if %{with check}
|
|
# Tests
|
|
BuildRequires: golang(github.com/stretchr/testify/assert) >= 1.5.1
|
|
BuildRequires: golang(github.com/stretchr/testify/require) >= 1.5.1
|
|
BuildRequires: golang(github.com/xeipuuv/gojsonschema)
|
|
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
|
|
|
|
%description
|
|
Git Large File Storage (LFS) replaces large files such as audio samples,
|
|
videos, datasets, and graphics with text pointers inside Git, while
|
|
storing the file contents on a remote server.
|
|
|
|
|
|
%gopkg
|
|
|
|
|
|
%prep
|
|
%goprep
|
|
cp -p %SOURCE1 .
|
|
|
|
# Modify Makefile so that it expects binaries where we build them.
|
|
sed -i -e 's!\.\./bin/!/%{gobuilddir}/bin/!g' t/Makefile
|
|
|
|
|
|
%build
|
|
# Build manpages first (some embedding in the executable is done.)
|
|
pushd docs
|
|
ronn --roff man/*.ronn
|
|
%gobuild -o %{gobuilddir}/bin/mangen man/mangen.go
|
|
%{gobuilddir}/bin/mangen
|
|
popd
|
|
|
|
LDFLAGS="-X 'github.com/git-lfs/git-lfs/config.Vendor=Fedora %{fedora}' " \
|
|
%gobuild -o %{gobuilddir}/bin/git-lfs %{goipath}
|
|
|
|
# Build test executables
|
|
for cmd in t/cmd/*.go; do
|
|
%gobuild -o "%{gobuilddir}/bin/$(basename $cmd .go)" "$cmd"
|
|
done
|
|
%gobuild -o "%{gobuilddir}/bin/git-lfs-test-server-api" t/git-lfs-test-server-api/*.go
|
|
|
|
# Move man pages out of docs so they don't get installed twice.
|
|
mv docs/man .
|
|
|
|
|
|
%install
|
|
%gopkginstall
|
|
install -Dpm0755 %{gobuilddir}/bin/git-lfs %{buildroot}%{_bindir}/%{name}
|
|
install -d -p %{buildroot}%{_mandir}/man1/
|
|
install -Dpm0644 man/*.1 %{buildroot}%{_mandir}/man1/
|
|
install -d -p %{buildroot}%{_mandir}/man5/
|
|
install -Dpm0644 man/*.5 %{buildroot}%{_mandir}/man5/
|
|
|
|
|
|
%post
|
|
if [ "x$(git config --type=bool --get 'fedora.git-lfs.no-modify-config')" != "xtrue" ]; then
|
|
%{_bindir}/%{name} install --system --skip-repo
|
|
fi
|
|
|
|
%preun
|
|
if [ $1 -eq 0 ] && \
|
|
[ "x$(git config --type=bool --get 'fedora.git-lfs.no-modify-config')" != "xtrue" ]; then
|
|
%{_bindir}/%{name} uninstall --system --skip-repo
|
|
fi
|
|
exit 0
|
|
|
|
|
|
%if %{with check}
|
|
%check
|
|
%gocheck
|
|
PATH=%{buildroot}%{_bindir}:%{gobuilddir}/bin:$PATH \
|
|
make -C t PROVE_EXTRA_ARGS="-j$(getconf _NPROCESSORS_ONLN)"
|
|
%endif
|
|
|
|
|
|
%files
|
|
%doc README.md README.Fedora CHANGELOG.md docs
|
|
%license LICENSE.md
|
|
%{_bindir}/%{name}
|
|
%{_mandir}/man1/%{name}*.1*
|
|
%{_mandir}/man5/%{name}*.5*
|
|
|
|
%gopkgfiles
|
|
|
|
|
|
%changelog
|
|
%autochangelog
|