## START: Set by rpmautospec ## (rpmautospec version 0.2.5) %define autorelease(e:s:pb:) %{?-p:0.}%{lua: release_number = 78; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{?dist} ## END: Set by rpmautospec %define _trivial .0 %define _buildid .4 %if 0%{?amzn} %bcond_without check %endif # https://github.com/git-lfs/git-lfs %global goipath github.com/git-lfs/git-lfs/v3 Version: 3.4.0 %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%{?_trivial}%{?_buildid} Summary: Git extension for versioning large files # See LICENSE.md for details. License: MIT AND BSD-3-Clause URL: https://git-lfs.github.io/ Source0: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-v%{version}.tar.gz Source1: https://github.com/git-lfs/git-lfs/releases/download/v%{version}/sha256sums.asc#/sha256sums-%{version}.asc Source2: https://api.github.com/repos/git-lfs/git-lfs/tarball/core-gpg-keys#/core-gpg-keys.tar.gz Source3: README.Fedora # Amazon Sources # This contains the bundled dependency packages for git-lfs. # If in future any of these packages has to be upgraded, please read UPDATE.md Source100: %{name}-v%{version}-vendor.tar.gz # Need go-rpm-macros greater than or equal to 3.2.0, which has the required commits for generating bundled Provides %if 0%{?amzn} BuildRequires: go-rpm-macros >= 3.2.0 %endif # Amazon Patch # https://github.com/git-lfs/git-lfs/commit/0345b6f816e611d050c0df67b61f0022916a1c90 Patch1000: CVE-2024-53263.patch BuildRequires: gnupg2 # Generate man pages BuildRequires: /usr/bin/asciidoctor %if %{with check} # Tests 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 tar xf %{SOURCE2} keyring="$(ls git-lfs-git-lfs-*/keys.asc)" # # Replicate gpgverify, because it requires detached signatures. # fatal_error() { message="$1" # an error message status=$2 # a number to use as the exit code echo "gpgverify: $message" >&2 exit $status } check_status() { action="$1" # a string that describes the action that was attempted status=$2 # the exit code of the command if test $status -ne 0 ; then fatal_error "$action failed." $status fi } # Make a temporary working directory. workdir="$(mktemp --directory)" check_status 'Making a temporary directory' $? workring="${workdir}/keyring.gpg" # Decode any ASCII armor on the keyring. This is harmless if the keyring isn't # ASCII-armored. gpg2 --homedir="${workdir}" --yes --output="${workring}" --dearmor "${keyring}" check_status 'Decoding the keyring' $? # Verify the signature using the decoded keyring. gpgv2 --homedir="${workdir}" --keyring="${workring}" "%{SOURCE1}" check_status 'Signature verification' $? # Clean up. (This is not done in case of an error that may need inspection.) rm --recursive --force ${workdir} # # END gpgverify. # cd %{_sourcedir} sha256sum --check --ignore-missing %{SOURCE1} %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 # cobra 1.7 changed some output. %if %{fedora} >= 39 || 0%{?amzn} sed -i '/cmp/s/$/ || true/' t/t-completion.sh %endif # Untar the bundled packages after %goprep pushd %{_builddir} tar xf %{SOURCE100} popd %build # Build manpages first (some embedding in the executable is done.) # Note that the variables are set here simply to prevent the Makefile from # shelling out to git, but the actual value is unused. make man GIT_LFS_SHA=unused VERSION=unused PREFIX=unused pushd docs %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} # 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 # This executable fails on `cannot find package` unless the provided arguments are in GOPATH %gobuild -o "%{gobuilddir}/bin/git-lfs-test-server-api" %{gobuilddir}/src/%{goipath}/t/git-lfs-test-server-api/*.go # Remove man pages from docs so they don't get installed twice. rm -r docs/man %install install -Dpm0755 %{gobuilddir}/bin/git-lfs %{buildroot}%{_bindir}/%{name} for section in 1 5 7; do install -d -p %{buildroot}%{_mandir}/man${section}/ install -Dpm0644 man/man${section}/*.${section} %{buildroot}%{_mandir}/man${section}/ done install -Dpm 0644 %{name}.bash %{buildroot}%{bash_completions_dir}/%{name} install -Dpm 0644 %{name}.fish %{buildroot}%{fish_completions_dir}/%{name}.fish install -Dpm 0644 %{name}.zsh %{buildroot}%{zsh_completions_dir}/_%{name} # Any modules.txt file within a subdirectory of /usr/share/licenses will be processed # by go_mod_vendor.prov to generate the bundled provides. # From go-rpm-macros 3.2.0 # https://pagure.io/go-rpm-macros/c/226596177c63c3dc180b5aeda45fe3b18706e877 install -Dp %{_builddir}/%{name}-%{version}/vendor/modules.txt %{buildroot}%{_defaultlicensedir}/%{name}/modules.txt %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 # modules.txt can be marked with `ghost`, which is sufficient for the rpm generator. %ghost %{_defaultlicensedir}/%{name}/modules.txt %{_bindir}/%{name} %{_mandir}/man1/%{name}*.1* %{_mandir}/man5/%{name}*.5* %{_mandir}/man7/%{name}*.7* %{bash_completions_dir}/%{name} %{fish_completions_dir}/%{name}.fish %{zsh_completions_dir}/_%{name} # Remove gopkgfiles which will process the file list produced in gopkginstall for all known kinds of Go subpackages %changelog * Tue Feb 04 2025 Sai Harsha None-78 - Fix CVE-2024-53263 * Mon Feb 03 2025 Sai Harsha - 3.4.0-1.amzn2023.0.4 - Fix CVE-2024-53263 * Tue Sep 05 2023 ssuryad - 3.4.0-77.amzn2023.0.3 - Rebuild for new gcc * Tue Sep 05 2023 ssuryad None-77 - Update amzn-changelog * Tue Sep 05 2023 ssuryad None-76 - Rebuild for new gcc * Wed Aug 23 2023 ssuryad None-75 - Bundle the dependency go packages and provide them using go-rpm-macros * Fri Aug 18 2023 Sai Harsha - 3.4.0-75.amzn2023.0.1 - Bundle the dependency go packages and provide them using go-rpm-macros - Remove gopkginstall which installs all known kinds of Go subpackages - Remove gopkgfiles which will process the file list produced in gopkginstall * Sun Jul 30 2023 Elliott Sales de Andrade None-74 - Update to latest version (#2226881) * Wed Jul 19 2023 Fedora Release Engineering None-73 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Mon Apr 10 2023 Elliott Sales de Andrade None-72 - Switch to SPDX license * Mon Feb 27 2023 Elliott Sales de Andrade None-71 - Update to latest version (#2149792) * Thu Jan 19 2023 Fedora Release Engineering None-70 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Sun Oct 02 2022 Elliott Sales de Andrade None-69 - Update to latest version (#2076796) * Thu Jul 21 2022 Fedora Release Engineering None-68 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Tue Jul 19 2022 Maxwell G None-67 - Rebuild for CVE-2022-{1705,32148,30631,30633,28131,30635,30632,30630,1962} in golang * Sat Jun 18 2022 Robert-André Mauchin None-66 - Rebuilt for CVE-2022-1996, CVE-2022-24675, CVE-2022-28327, CVE-2022-27191, CVE-2022-29526, CVE-2022-30629 * Fri Jun 17 2022 Robert-André Mauchin None-65 - Rebuilt for CVE-2022-1996, CVE-2022-24675, CVE-2022-28327, CVE-2022-27191, CVE-2022-29526, CVE-2022-30629 * Sun Apr 17 2022 Fabio Alessandro Locati None-64 - Rebuilt for CVE-2022-27191 * Sun Mar 20 2022 Elliott Sales de Andrade None-63 - Update to latest version (#2054522) * Thu Jan 20 2022 Fedora Release Engineering None-62 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Sun Oct 31 2021 Elliott Sales de Andrade None-61 - Update to latest version (#2018470) * Tue Oct 05 2021 Elliott Sales de Andrade None-60 - Update to 3.0.1 * Tue Oct 05 2021 Elliott Sales de Andrade None-59 - Verify checksums and GPG signature of source tarball * Thu Jul 22 2021 Fedora Release Engineering - 2.13.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Fri Apr 02 2021 Elliott Sales de Andrade - 2.13.3-1 - Update to latest version (#1943775) * Tue Jan 26 2021 Fedora Release Engineering - 2.13.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Sat Jan 16 2021 Elliott Sales de Andrade - 2.13.2-1 - Update to latest version (#1915996) * Mon Nov 09 2020 Elliott Sales de Andrade - 2.12.1-1 - Update to latest version (#1894780) * Thu Sep 03 2020 Elliott Sales de Andrade - 2.12.0-1 - Update to latest version (#1874604) - Remove duplicate docs/man directory (#1852765) - Add an option to disable modifying the git filter config (#1768060) * Sat Aug 01 2020 Fedora Release Engineering - 2.11.0-3 - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Mon Jul 27 2020 Fedora Release Engineering - 2.11.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Sun May 10 2020 Elliott Sales de Andrade - 2.11.0-1 - Update to latest version * Thu Feb 20 2020 Elliott Sales de Andrade - 2.10.0-1 - Update to latest version * Tue Jan 28 2020 Fedora Release Engineering - 2.9.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild * Tue Jan 07 2020 Elliott Sales de Andrade - 2.9.2-1 - Update to latest version * Wed Jan 01 2020 Elliott Sales de Andrade - 2.9.0-1 - Update to latest version * Fri Aug 30 2019 Elliott Sales de Andrade - 2.8.0-4 - Customize vendor information in version * Fri Aug 30 2019 Elliott Sales de Andrade - 2.8.0-3 - Update to latest version * Thu Jul 25 2019 Fedora Release Engineering - 2.7.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Wed Jul 10 2019 Elliott Sales de Andrade - 2.7.2-2 - Update to latest Go macros * Wed Apr 24 2019 Elliott Sales de Andrade - 2.7.2-1 - Update to latest version * Wed Feb 27 2019 Elliott Sales de Andrade - 2.7.1-1 - Update to latest version * Thu Feb 21 2019 Elliott Sales de Andrade - 2.7.0-1 - Update to latest version * Thu Jan 31 2019 Fedora Release Engineering - 2.6.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Tue Jan 15 2019 Elliott Sales de Andrade - 2.6.1-1 - Update to latest version * Mon Jan 14 2019 Elliott Sales de Andrade - 2.5.2-4 - Rebuilt for dependencies * Tue Oct 23 2018 Nicolas Mailhot - 2.5.2-3 - redhat-rpm-config-123 triggers bugs in gosetup, remove it from Go spec files as it’s just an alias - https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/RWD5YATAYAFWKIDZBB7EB6N5DAO4ZKFM/ * Fri Oct 12 2018 Elliott Sales de Andrade - 2.5.2-2 - rebuilt * Wed Oct 10 2018 Elliott Sales de Andrade - 2.5.2-1 - Update to latest version * Tue Sep 04 2018 Elliott Sales de Andrade - 2.5.1-1 - Update to latest version * Mon Sep 03 2018 Elliott Sales de Andrade - 2.5.0-1 - Update to 2.5.0 * Wed Aug 29 2018 Elliott Sales de Andrade - 2.4.2-1 - Update to 2.4.2 * Tue Jul 31 2018 Florian Weimer - 2.4.1-3 - Rebuild with fixed binutils * Fri Jul 13 2018 Fedora Release Engineering - 2.4.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Wed May 23 2018 Elliott Sales de Andrade - 2.4.1-1 - Update to latest release * Mon May 21 2018 Carl George - 2.4.0-3 - Fix %%preun to correctly remove the lfs filter on uninstall (rhbz#1580357) * Mon Mar 12 2018 Carl George - 2.4.0-2 - Add %%go_arches fallback to work around Koji issues * Sun Mar 04 2018 Elliott Sales de Andrade - 2.4.0-1 - Update to latest release. * Thu Feb 08 2018 Elliott Sales de Andrade - 2.3.4-6 - Add patches to build with Go 1.10. * Wed Feb 07 2018 Fedora Release Engineering - 2.3.4-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Mon Dec 04 2017 Carl George - 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 - 2.3.4-3 - Require git-core instead of git. * Fri Nov 03 2017 Elliott Sales de Andrade - 2.3.4-2 - Patch tests to work on slow systems like arm and aarch builders. - Fix "git lfs help" command. * Fri Nov 03 2017 Elliott Sales de Andrade - 2.3.4-1 - Update to latest release. - Run all tests during build. * Fri Sep 01 2017 Elliott Sales de Andrade - 2.2.1-3 - Remove redundant doc tag on manpages. - Use path macros in %%post/%%postun. * Thu Aug 31 2017 Elliott Sales de Andrade - 2.2.1-2 - Disable unnecessary subpackages. * Sun Jul 30 2017 Elliott Sales de Andrade - 2.2.1-1 - Update to latest version. * Wed Apr 19 2017 Elliott Sales de Andrade - 2.0.2-2 - Patch up to build with Go 1.7 * Wed Apr 19 2017 Elliott Sales de Andrade - 2.0.2-1 - Update to latest release - Add some requested macros * Tue Mar 14 2017 Elliott Sales de Andrade - 2.0.1-1 - Update to latest release - Don't disable git-lfs globally during upgrade * Mon Mar 06 2017 Elliott Sales de Andrade - 2.0.0-1 - Update to latest release * Sun Feb 12 2017 Elliott Sales de Andrade - 1.5.5-1 - Update to latest release - Add -devel and -unit-test-devel subpackages - Add post/preun scriptlets for global enablement * Sun May 15 2016 Igor Gnatenko - 1.2.0-1 - Initial package