File git-lfs.spec of Package git-lfs

# spec file for package git-lfs
# Copyright (c) 2021 SUSE LLC
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

%define rb_build_ruby_abis     %{rb_default_ruby_abi}
%define rb_build_versions      %{rb_default_ruby}

%if 0%{?suse_version} >= 1550 || (0%{?suse_version} >= 1500 && 0%{?is_opensuse})
%bcond_with    build_docs
%bcond_with    build_docs

Name:           git-lfs
Version:        2.13.2
Release:        0
Summary:        Git extension for versioning large files
License:        MIT
Group:          Development/Tools/Version Control
Source1:        README.packaging
Patch0:         Makefile_path.patch
%if %{with build_docs}
BuildRequires:  %{rubygem ronn}
BuildRequires:  curl
BuildRequires:  fdupes
BuildRequires:  git-core >= 1.8.2
BuildRequires:  go1.14
BuildRequires:  golang-packaging
BuildRequires:  which
Requires:       git-core >= 1.8.2
Requires(post): git-core >= 1.8.2
Requires(preun): git-core >= 1.8.2

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.

%autosetup -p1

go build -mod=vendor --buildmode=pie .
%if %{with build_docs}
%make_build man

install -D -m 755 git-lfs %{buildroot}%{_bindir}/git-lfs
%if %{with build_docs}
mkdir -p -m 755 %{buildroot}%{_mandir}/man1
mkdir -p -m 755 %{buildroot}%{_mandir}/man5
install  -m 644 man/*.1 %{buildroot}%{_mandir}/man1
install  -m 644 man/*.5 %{buildroot}%{_mandir}/man5

%fdupes -s %{buildroot}


git lfs install --system

if [ $1 -eq 0 ] ; then
  git lfs uninstall --system

export GIT_LFS_TEST_DIR=$(mktemp -d)
# test/git-lfs-server-api/main.go does not compile because
# cannot be found in vendor, for some reason. It's not needed for installs, so
# skip it.

%{gotest} -mod=vendor

rm -rf ${GIT_LFS_TEST_DIR}

%if %{with build_docs}

openSUSE Build Service is sponsored by