%bcond_without check # https://github.com/git-lfs/git-lfs %global goipath github.com/git-lfs/git-lfs/v3 Version: 3.7.1 %gometa %global common_description %{expand: Git extension for versioning large files.} %global goname git-lfs %global golicenses LICENSE.md %global godocs docs CHANGELOG.md CODE-OF-CONDUCT.md\\\ CONTRIBUTING.md README.md Name: %{goname} Release: %mkrel 1 Summary: Git extension for versioning large files Group: Development/Tools License: MIT URL: https://git-lfs.github.io/ Source0: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-v%{version}.tar.gz Source3: README.Fedora BuildRequires: git # Generate man pages BuildRequires: ruby-asciidoctor %{?with_check: %define _shasumver 6.04 BuildRequires: perl-Digest-SHA %define _provever 3.52 BuildRequires: perl-Test-Harness } Requires: git >= 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 %SOURCE3 . %autopatch -p1 # Modify tests so that they expect binaries where we build them. sed -i -e 's!\.\./bin/!/%{gobuilddir}/bin/!g' t/Makefile sed -i -e 's!^BINPATH=.\+!BINPATH="%{gobuilddir}/bin"!g' t/testenv.sh # Fix perl names sed -e "s/PROVE ?=.*/PROVE = prove-%{_provever}/g" -i t/Makefile sed -e "s/shasum /shasum-%{_shasumver} /g" -i t/*.sh %generate_buildrequires %go_generate_buildrequires %build %make_build man LDFLAGS="-X 'github.com/git-lfs/git-lfs/config.Vendor=Mageia %{mageia}' " \ %gobuild -o %{gobuilddir}/bin/git-lfs %{goipath} # Generate completion files. for shell in bash fish zsh; do %{gobuilddir}/bin/git-lfs completion ${shell} > %{name}.${shell} done # 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. rm -rf docs/man %install %gopkginstall install -Dpm0755 %{gobuilddir}/bin/git-lfs %{buildroot}%{_bindir}/%{name} install -d -p %{buildroot}%{_mandir}/man1/ install -Dpm0644 man/man1/*.1 %{buildroot}%{_mandir}/man1/ install -d -p %{buildroot}%{_mandir}/man5/ install -Dpm0644 man/man5/*.5 %{buildroot}%{_mandir}/man5/ install -Dpm 0644 %{name}.bash %{buildroot}%{_datadir}/bash-completion/completions/%{name} install -Dpm 0644 %{name}.fish %{buildroot}%{_datadir}/fish/completions/%{name}.fish install -Dpm 0644 %{name}.zsh %{buildroot}%{_datadir}/zsh/vendor_completions/_%{name} %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 # Disable test: t-completion.sh mv t/t{,X}-completion.sh PATH=%{buildroot}%{_bindir}:%{gobuilddir}/bin:$PATH \ %make_build -C t PROVE_EXTRA_ARGS="-j$(getconf _NPROCESSORS_ONLN)" %endif %files %doc README.md README.Fedora CHANGELOG.md docs %doc LICENSE.md %{_bindir}/%{name} %{_mandir}/man*/* %{_datadir}/bash-completion/completions/%{name} %{_datadir}/fish/completions/%{name}.fish %{_datadir}/zsh/vendor_completions/_%{name} %gopkgfiles