#1 RHEL compatibility
Merged 6 years ago by qulogic. Opened 6 years ago by carlwgeorge.
rpms/ carlwgeorge/git-lfs master  into  master

file modified
+51 -9
@@ -1,13 +1,15 @@ 

  # Generate devel rpm

  %global with_devel 0

  # Build project from bundled dependencies

- %global with_bundled 0

+ %global with_bundled %{?rhel:1}%{!?rhel:0}

  # Build with debug info rpm

  %global with_debug 1

  # Run tests in check section

- %global with_check 1

+ %global with_check %{?rhel:0}%{!?rhel:1}

  # Generate unit-test rpm

  %global with_unit_test 0

+ # Build man pages

+ %global with_manpages %{?rhel:0}%{!?rhel:1}

  

  %if 0%{?with_debug}

  %global _dwz_low_mem_die_limit 0
@@ -15,6 +17,9 @@ 

  %global debug_package   %{nil}

  %endif

  

+ %if ! 0%{?gobuild:1}

+ %define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};

+ %endif

  

  %global provider        github

  %global provider_tld    com
@@ -28,7 +33,7 @@ 

  

  Name:           git-lfs

  Version:        2.3.4

- Release:        3%{?dist}

+ Release:        4%{?dist}

  Summary:        Git extension for versioning large files

  

  License:        MIT
@@ -38,8 +43,21 @@ 

  Patch0001:      wait-longer.patch

  

  ExclusiveArch:  %{go_arches}

- BuildRequires:  compiler(go-compiler)

- 

+ BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}

+ 

+ %if 0%{?with_bundled}

+ Provides:       bundled(golang(github.com/bgentry/go-netrc/netrc)) = 9fd32a8b3d3d3f9d43c341bfe098430e07609480

+ Provides:       bundled(golang(github.com/inconshreveable/mousetrap)) = 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75

+ Provides:       bundled(golang(github.com/kr/pty)) = 5cf931ef8f76dccd0910001d74a58a7fca84a83d

+ Provides:       bundled(golang(github.com/olekukonko/ts)) = ecf753e7c962639ab5a1fb46f7da627d4c0a04b8

+ Provides:       bundled(golang(github.com/pkg/errors)) = c605e284fe17294bda444b34710735b29d1a9d90

+ Provides:       bundled(golang(github.com/rubyist/tracerx)) = 787959303086f44a8c361240dfac53d3e9d53ed2

+ Provides:       bundled(golang(github.com/spf13/cobra)) = c55cdf33856a08e4822738728b41783292812889

+ Provides:       bundled(golang(github.com/spf13/pflag)) = 580b9be06c33d8ba9dcc8757ea56b7642472c2f5

+ Provides:       bundled(golang(github.com/stretchr/testify)) = 6cb3b85ef5a0efef77caef88363ec4d4b5c0976d

+ Provides:       bundled(golang(github.com/ThomsonReutersEikon/go-ntlm/ntlm)) = b00ec39bbdd04f845950f4dbb4fd0a2c3155e830

+ Provides:       bundled(golang(github.com/xeipuuv/gojsonschema)) = 6b67b3fab74d992bd07f72550006ab2c6907c416

+ %else

  BuildRequires:  golang(github.com/bgentry/go-netrc/netrc)

  BuildRequires:  golang(github.com/kr/pty)

  BuildRequires:  golang(github.com/inconshreveable/mousetrap)
@@ -52,17 +70,26 @@ 

  BuildRequires:  golang(github.com/xeipuuv/gojsonreference)

  BuildRequires:  golang(github.com/xeipuuv/gojsonschema)

  BuildRequires:  golang(github.com/pkg/errors)

+ %endif

  

+ %if 0%{?with_manpages}

  # Generate mans

  BuildRequires:  /usr/bin/ronn

+ %endif

  

+ %if 0%{?with_check}

  # For tests

+ %if ! 0%{?with_bundled}

  BuildRequires:  golang(github.com/stretchr/testify)

+ %endif

  BuildRequires:  perl-Digest-SHA

  # Tests require full git suite, but not generally needed.

- BuildRequires:  git >= 1.8.5

+ BuildRequires:  git >= 1.8.2

+ %endif

  

- Requires:       git-core >= 1.8.5

+ # https://github.com/git-lfs/git-lfs/commit/263bfd784aa0bb23e942033605fce6c870fc8e4f

+ # 1.8.5 needed for macOS, but 1.8.2 sufficient for Linux.

+ Requires:       git-core >= 1.8.2

  

  %description

  Git Large File Storage (LFS) replaces large files such as audio samples,
@@ -103,8 +130,9 @@ 

  %prep

  %autosetup -p1

  

- # Unbundle libs

+ %if ! 0%{?with_bundled}

  rm -rf vendor

+ %endif

  

  

  %build
@@ -114,26 +142,32 @@ 

  

  # Build manpages first (some embedding in the executable is done.)

  pushd docs

- ronn man/*.ronn

+ %if 0%{?with_manpages}

+ ronn --roff man/*.ronn

+ %endif

  %gobuild -o mangen man/mangen.go

  ./mangen

  popd

  

  %gobuild -o bin/git-lfs %{import_path}

  

+ %if 0%{?with_check}

  # Build test executables

  for go in test/cmd/*.go; do

      %gobuild -o "bin/$(basename $go .go)" "$go"

  done

  %{gobuild} -o "bin/git-lfs-test-server-api" "test/git-lfs-test-server-api/*.go"

+ %endif

  

  

  %install

  install -Dpm0755 bin/git-lfs %{buildroot}%{_bindir}/%{name}

+ %if 0%{?with_manpages}

  install -d -p %{buildroot}%{_mandir}/man1/

  install -Dpm0644 docs/man/*.1 %{buildroot}%{_mandir}/man1/

  install -d -p %{buildroot}%{_mandir}/man5/

  install -Dpm0644 docs/man/*.5 %{buildroot}%{_mandir}/man5/

+ %endif

  

  # source codes for building projects

  %if 0%{?with_devel}
@@ -198,8 +232,10 @@ 

  %files

  %license LICENSE.md

  %{_bindir}/%{name}

+ %if 0%{?with_manpages}

  %{_mandir}/man1/%{name}*.1*

  %{_mandir}/man5/%{name}*.5*

+ %endif

  

  %if 0%{?with_devel}

  %files -n golang-%{provider}-%{project}-%{repo}-devel -f devel.file-list
@@ -214,6 +250,12 @@ 

  

  

  %changelog

+ * Mon Dec 04 2017 Carl George <carl@george.computer> - 2.3.4-4

+ - Use vendored libraries on RHEL

+ - Skip test on RHEL

+ - Don't build man pages on RHEL due to missing ronn

+ - Don't build html versions of man pages

+ 

  * Fri Dec 01 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> 2.3.4-3

  - Require git-core instead of git.

  

  • Use vendored libraries on RHEL
  • Skip test on RHEL
  • Don't build man pages on RHEL due to missing ronn
  • Don't build html versions of man pages

I'm not sure about this. Upstream specifically bumped this due to issues, though that was on macOS. However, since you aren't running tests, I'm not sure if it is or is not broken with the older version.

Does this work correctly with git lfs --help?

Regarding the git version, in upstream issue #410 someone else reported that RHEL7's git-1.8.3.1-4.el7.x86_64 works fine. I tried running the test suite but there are too many missing dependencies at this time.

git lfs --help works just fine with the html man page building disabled. By default, ronn creates the roff (man) and html files, but only the roff files are needed. The mangen command reads the original ronn files.

OK, I think that warrants a comment then since it doesn't match upstream's readme.

1 new commit added

  • Add comment clarifying minimum version
6 years ago

Pull-Request has been merged by qulogic

6 years ago
Metadata