Enable bundling, update 3.5.1

This commit is contained in:
Ondřej Pohořelský 2024-03-05 10:08:50 +01:00
parent 3c53fac122
commit 3482d1689f
3 changed files with 58 additions and 94 deletions

2
.gitignore vendored
View File

@ -33,3 +33,5 @@
/sha256sums-3.3.0.asc /sha256sums-3.3.0.asc
/git-lfs-v3.4.0.tar.gz /git-lfs-v3.4.0.tar.gz
/sha256sums-3.4.0.asc /sha256sums-3.4.0.asc
/git-lfs-v3.4.1.tar.gz
/git-lfs-v3.5.1.tar.gz

View File

@ -2,10 +2,12 @@
# https://github.com/git-lfs/git-lfs # https://github.com/git-lfs/git-lfs
%global goipath github.com/git-lfs/git-lfs/v3 %global goipath github.com/git-lfs/git-lfs/v3
Version: 3.4.0 Version: 3.5.1
%gometa %gometa
%global gobuilddir %{_builddir}/%{name}-%{version}/_build
%global common_description %{expand: %global common_description %{expand:
Git extension for versioning large files.} Git extension for versioning large files.}
@ -21,44 +23,60 @@ Summary: Git extension for versioning large files
License: MIT AND BSD-3-Clause License: MIT AND BSD-3-Clause
URL: https://git-lfs.github.io/ URL: https://git-lfs.github.io/
Source0: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-v%{version}.tar.gz 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 Source1: README.Fedora
Source2: https://api.github.com/repos/git-lfs/git-lfs/tarball/core-gpg-keys#/core-gpg-keys.tar.gz
Source3: README.Fedora
BuildRequires: gnupg2
BuildRequires: golang(github.com/dpotapov/go-spnego) # Generated provides by vendor2provides.py
BuildRequires: golang(github.com/git-lfs/gitobj/v2) >= 2.1.1 # https://src.fedoraproject.org/rpms/syncthing/blob/603e4e03a92a7d704d199629dd85304018e8279d/f/vendor2provides.py
BuildRequires: golang(github.com/git-lfs/gitobj/v2/errors) >= 2.1.1 Provides: bundled(golang(github.com/alexbrainman/sspi)) = 909beea
BuildRequires: golang(github.com/git-lfs/go-netrc/netrc) >= 0-0.13.20220318gitf0c862d Provides: bundled(golang(github.com/avast/retry-go)) = 2.4.2+incompatible
BuildRequires: golang(github.com/git-lfs/pktline) Provides: bundled(golang(github.com/davecgh/go-spew)) = 1.1.1
BuildRequires: golang(github.com/git-lfs/wildmatch/v2) >= 2.0.1 Provides: bundled(golang(github.com/dpotapov/go-spnego)) = 298b63a
BuildRequires: golang(github.com/leonelquinteros/gotext) >= 1.5.0 Provides: bundled(golang(github.com/git-lfs/gitobj/v2)) = 2.1.1
BuildRequires: golang(github.com/mattn/go-isatty) >= 0.0.4 Provides: bundled(golang(github.com/git-lfs/go-netrc)) = f0c862d
BuildRequires: golang(github.com/olekukonko/ts) Provides: bundled(golang(github.com/git-lfs/pktline)) = 06e9096
BuildRequires: golang(github.com/pkg/errors) Provides: bundled(golang(github.com/git-lfs/wildmatch/v2)) = 2.0.1
BuildRequires: golang(github.com/rubyist/tracerx) Provides: bundled(golang(github.com/hashicorp/go-uuid)) = 1.0.2
BuildRequires: golang(github.com/spf13/cobra) >= 1.6.0 Provides: bundled(golang(github.com/inconshreveable/mousetrap)) = 1.0.1
BuildRequires: golang(github.com/ssgelm/cookiejarparser) >= 1.0.1 Provides: bundled(golang(github.com/jcmturner/aescts/v2)) = 2.0.0
BuildRequires: golang(golang.org/x/net/http2) >= 0.7.0 Provides: bundled(golang(github.com/jcmturner/dnsutils/v2)) = 2.0.0
BuildRequires: golang(golang.org/x/sync/semaphore) >= 0.1.0 Provides: bundled(golang(github.com/jcmturner/gofork)) = 1.0.0
BuildRequires: golang(golang.org/x/sys/unix) >= 0.5.0 Provides: bundled(golang(github.com/jcmturner/goidentity/v6)) = 6.0.1
Provides: bundled(golang(github.com/jcmturner/gokrb5/v8)) = 8.4.2
Provides: bundled(golang(github.com/jcmturner/rpc/v2)) = 2.0.3
Provides: bundled(golang(github.com/leonelquinteros/gotext)) = 1.5.0
Provides: bundled(golang(github.com/mattn/go-isatty)) = 0.0.4
Provides: bundled(golang(github.com/olekukonko/ts)) = 78ecb04
Provides: bundled(golang(github.com/pkg/errors)) = c605e28
Provides: bundled(golang(github.com/pmezard/go-difflib)) = 1.0.0
Provides: bundled(golang(github.com/rubyist/tracerx)) = 7879593
Provides: bundled(golang(github.com/spf13/cobra)) = 1.6.0
Provides: bundled(golang(github.com/spf13/pflag)) = 1.0.5
Provides: bundled(golang(github.com/ssgelm/cookiejarparser)) = 1.0.1
Provides: bundled(golang(github.com/stretchr/testify)) = 1.6.1
Provides: bundled(golang(github.com/xeipuuv/gojsonpointer)) = 4e3ac27
Provides: bundled(golang(github.com/xeipuuv/gojsonreference)) = bd5ef7b
Provides: bundled(golang(github.com/xeipuuv/gojsonschema)) = 6b67b3f
Provides: bundled(golang(golang.org/x/crypto)) = 7b82a4e
Provides: bundled(golang(golang.org/x/net)) = 0.7.0
Provides: bundled(golang(golang.org/x/sync)) = 0.1.0
Provides: bundled(golang(golang.org/x/sys)) = 0.5.0
Provides: bundled(golang(golang.org/x/text)) = 0.7.0
Provides: bundled(golang(gopkg.in/yaml.v3)) = 3.0.1
# Generate man pages # Generate man pages
BuildRequires: /usr/bin/asciidoctor BuildRequires: /usr/bin/asciidoctor
%if %{with check} %if %{with check}
# Tests # Tests
BuildRequires: golang(github.com/stretchr/testify/assert) >= 1.6.1
BuildRequires: golang(github.com/stretchr/testify/require) >= 1.6.1
BuildRequires: golang(github.com/xeipuuv/gojsonschema)
BuildRequires: perl-Digest-SHA BuildRequires: perl-Digest-SHA
BuildRequires: perl-Test-Harness BuildRequires: perl-Test-Harness
# Tests require full git suite, but not generally needed. # Tests require full git suite, but not generally needed.
BuildRequires: git >= 1.8.5 BuildRequires: git >= 2.32.0
%endif %endif
Requires: git-core >= 1.8.5 Requires: git-core >= 2.32.0
%description %description
Git Large File Storage (LFS) replaces large files such as audio samples, Git Large File Storage (LFS) replaces large files such as audio samples,
@ -66,81 +84,28 @@ videos, datasets, and graphics with text pointers inside Git, while
storing the file contents on a remote server. storing the file contents on a remote server.
%gopkg
%prep %prep
tar xf %{SOURCE2} %autosetup -p1 -n %{name}-%{version}
keyring="$(ls git-lfs-git-lfs-*/keys.asc)"
# install -m 0755 -vd %{gobuilddir}/bin
# Replicate gpgverify, because it requires detached signatures. install -m 0755 -vd "$(dirname %{gobuilddir}/src/%{goipath})"
# ln -fs "$(pwd)" "%{gobuilddir}/src/%{goipath}"
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. # 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!\.\./bin/!/%{gobuilddir}/bin/!g' t/Makefile
sed -i -e 's!^BINPATH=.\+!BINPATH="%{gobuilddir}/bin"!g' t/testenv.sh sed -i -e 's!^BINPATH=.\+!BINPATH="%{gobuilddir}/bin"!g' t/testenv.sh
# cobra 1.7 changed some output.
%if %{fedora} >= 39
sed -i '/cmp/s/$/ || true/' t/t-completion.sh
%endif
%build %build
export GOPATH=%{gobuilddir}:%{gopath}
export GO111MODULE=off
# Build manpages first (some embedding in the executable is done.) # 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 make man GIT_LFS_SHA=unused VERSION=unused PREFIX=unused
pushd docs pushd docs
%gobuild -o %{gobuilddir}/bin/mangen man/mangen.go %gobuild -o %{gobuilddir}/bin/mangen man/mangen.go
%{gobuilddir}/bin/mangen %{gobuilddir}/bin/mangen
popd popd
LDFLAGS="-X 'github.com/git-lfs/git-lfs/config.Vendor=Fedora %{fedora}' " \
%gobuild -o %{gobuilddir}/bin/git-lfs %{goipath} %gobuild -o %{gobuilddir}/bin/git-lfs %{goipath}
# Generate completion files. # Generate completion files.
@ -148,18 +113,19 @@ for shell in bash fish zsh; do
%{gobuilddir}/bin/git-lfs completion ${shell} > %{name}.${shell} %{gobuilddir}/bin/git-lfs completion ${shell} > %{name}.${shell}
done done
# Build test executables. # Build test executables
pushd %{gobuilddir}/src/%{goipath}
for cmd in t/cmd/*.go; do for cmd in t/cmd/*.go; do
%gobuild -o "%{gobuilddir}/bin/$(basename $cmd .go)" "$cmd" %gobuild -o "%{gobuilddir}/bin/$(basename $cmd .go)" "$cmd"
done done
%gobuild -o "%{gobuilddir}/bin/git-lfs-test-server-api" t/git-lfs-test-server-api/*.go %gobuild -o "%{gobuilddir}/bin/git-lfs-test-server-api" t/git-lfs-test-server-api/*.go
popd
# Remove man pages from docs so they don't get installed twice. # Remove man pages from docs so they don't get installed twice.
rm -r docs/man rm -r docs/man
%install %install
%gopkginstall
install -Dpm0755 %{gobuilddir}/bin/git-lfs %{buildroot}%{_bindir}/%{name} install -Dpm0755 %{gobuilddir}/bin/git-lfs %{buildroot}%{_bindir}/%{name}
for section in 1 5 7; do for section in 1 5 7; do
install -d -p %{buildroot}%{_mandir}/man${section}/ install -d -p %{buildroot}%{_mandir}/man${section}/
@ -192,7 +158,7 @@ PATH=%{buildroot}%{_bindir}:%{gobuilddir}/bin:$PATH \
%files %files
%doc README.md README.Fedora CHANGELOG.md docs %doc README.md CHANGELOG.md docs
%license LICENSE.md %license LICENSE.md
%{_bindir}/%{name} %{_bindir}/%{name}
%{_mandir}/man1/%{name}*.1* %{_mandir}/man1/%{name}*.1*
@ -202,8 +168,6 @@ PATH=%{buildroot}%{_bindir}:%{gobuilddir}/bin:$PATH \
%{fish_completions_dir}/%{name}.fish %{fish_completions_dir}/%{name}.fish
%{zsh_completions_dir}/_%{name} %{zsh_completions_dir}/_%{name}
%gopkgfiles
%changelog %changelog
%autochangelog %autochangelog

View File

@ -1,3 +1 @@
SHA512 (git-lfs-v3.4.0.tar.gz) = ff0d624bc48d9ab4332943af8212652d9959e8f9d6a356a3722047903e01bc1dcf04178b97d58a327d0a381569854034c4a1dc2baea9976a8f20d97d7e637f31 SHA512 (git-lfs-v3.5.1.tar.gz) = 2415017e2dd055c96e2f72ab5426f3958f4d657428c3e918bec8a9b25efa1843cb7df866544ce99a88e04edd2016978a0fcd4fc3677acf78fcfb7b7815c1ec7f
SHA512 (sha256sums-3.4.0.asc) = e134e8dc1a336b9865e09a49be0bb25b37f18680491925103375a3c78b6fc5f30ff7460b152fce59e0507ff343724c8bf3fbea1a412f556c3d6fc07c75c4ff96
SHA512 (core-gpg-keys.tar.gz) = 9a8c95d9bea2b31ae30ba23a7d94a2c688ff37254115b82debeda67d2cfc1bb870d7ad7bfb1f974b978cc959ca1d772d8c278fcfb59b286a3af995cd771bc066