git-lfs/git-lfs.spec

178 lines
6.3 KiB
RPMSpec
Raw Permalink Normal View History

2023-07-30 19:38:47 +00:00
%bcond check 1
2019-07-11 00:05:43 +00:00
# https://github.com/git-lfs/git-lfs
2021-10-05 04:09:17 +00:00
%global goipath github.com/git-lfs/git-lfs/v3
2024-03-05 09:08:50 +00:00
Version: 3.5.1
2018-09-03 22:09:13 +00:00
%gometa
2017-09-02 18:54:44 +00:00
2024-03-05 09:08:50 +00:00
%global gobuilddir %{_builddir}/%{name}-%{version}/_build
2019-07-11 00:05:43 +00:00
%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
2017-09-02 18:54:44 +00:00
Name: git-lfs
2021-09-26 02:39:59 +00:00
Release: %autorelease
2017-09-02 18:54:44 +00:00
Summary: Git extension for versioning large files
2023-04-10 05:24:18 +00:00
# See LICENSE.md for details.
License: MIT AND BSD-3-Clause
2017-09-02 18:54:44 +00:00
URL: https://git-lfs.github.io/
Source0: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-v%{version}.tar.gz
2024-03-05 09:08:50 +00:00
Source1: README.Fedora
# Generated provides by vendor2provides.py
# https://src.fedoraproject.org/rpms/syncthing/blob/603e4e03a92a7d704d199629dd85304018e8279d/f/vendor2provides.py
Provides: bundled(golang(github.com/alexbrainman/sspi)) = 909beea
Provides: bundled(golang(github.com/avast/retry-go)) = 2.4.2+incompatible
Provides: bundled(golang(github.com/davecgh/go-spew)) = 1.1.1
Provides: bundled(golang(github.com/dpotapov/go-spnego)) = 298b63a
Provides: bundled(golang(github.com/git-lfs/gitobj/v2)) = 2.1.1
Provides: bundled(golang(github.com/git-lfs/go-netrc)) = f0c862d
Provides: bundled(golang(github.com/git-lfs/pktline)) = 06e9096
Provides: bundled(golang(github.com/git-lfs/wildmatch/v2)) = 2.0.1
Provides: bundled(golang(github.com/hashicorp/go-uuid)) = 1.0.2
Provides: bundled(golang(github.com/inconshreveable/mousetrap)) = 1.0.1
Provides: bundled(golang(github.com/jcmturner/aescts/v2)) = 2.0.0
Provides: bundled(golang(github.com/jcmturner/dnsutils/v2)) = 2.0.0
Provides: bundled(golang(github.com/jcmturner/gofork)) = 1.0.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
2019-07-11 00:05:43 +00:00
# Generate man pages
2023-02-27 01:37:32 +00:00
BuildRequires: /usr/bin/asciidoctor
2019-07-11 00:05:43 +00:00
%if %{with check}
# Tests
2017-11-03 08:25:40 +00:00
BuildRequires: perl-Digest-SHA
2018-09-03 09:03:36 +00:00
BuildRequires: perl-Test-Harness
2017-12-01 06:40:06 +00:00
# Tests require full git suite, but not generally needed.
2024-03-05 09:08:50 +00:00
BuildRequires: git >= 2.32.0
2019-07-11 00:05:43 +00:00
%endif
2017-09-02 18:54:44 +00:00
2024-03-05 09:08:50 +00:00
Requires: git-core >= 2.32.0
2017-09-02 18:54:44 +00:00
%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.
%prep
2024-03-05 09:08:50 +00:00
%autosetup -p1 -n %{name}-%{version}
install -m 0755 -vd %{gobuilddir}/bin
install -m 0755 -vd "$(dirname %{gobuilddir}/src/%{goipath})"
ln -fs "$(pwd)" "%{gobuilddir}/src/%{goipath}"
2017-09-02 18:54:44 +00:00
2022-10-02 03:29:20 +00:00
# Modify tests so that they expect binaries where we build them.
2019-07-11 00:05:43 +00:00
sed -i -e 's!\.\./bin/!/%{gobuilddir}/bin/!g' t/Makefile
2022-10-02 03:29:20 +00:00
sed -i -e 's!^BINPATH=.\+!BINPATH="%{gobuilddir}/bin"!g' t/testenv.sh
2018-09-04 06:09:13 +00:00
2017-09-02 18:54:44 +00:00
%build
2024-03-05 09:08:50 +00:00
export GOPATH=%{gobuilddir}:%{gopath}
export GO111MODULE=off
2024-08-06 14:22:45 +00:00
# Enable FIPS support at build time by enabling CGO and enforcing strict FIPS runtime
export CGO_ENABLED=1
export GOEXPERIMENT=strictfipsruntime
2017-11-04 04:26:57 +00:00
# Build manpages first (some embedding in the executable is done.)
2023-02-27 01:37:32 +00:00
make man GIT_LFS_SHA=unused VERSION=unused PREFIX=unused
2017-11-04 04:26:57 +00:00
pushd docs
2019-07-11 00:05:43 +00:00
%gobuild -o %{gobuilddir}/bin/mangen man/mangen.go
%{gobuilddir}/bin/mangen
2017-11-04 04:26:57 +00:00
popd
2017-09-02 18:54:44 +00:00
2019-07-11 00:05:43 +00:00
%gobuild -o %{gobuilddir}/bin/git-lfs %{goipath}
2017-09-02 18:54:44 +00:00
2023-07-30 19:38:47 +00:00
# Generate completion files.
for shell in bash fish zsh; do
%{gobuilddir}/bin/git-lfs completion ${shell} > %{name}.${shell}
done
2024-03-05 09:08:50 +00:00
# Build test executables
pushd %{gobuilddir}/src/%{goipath}
2019-07-11 00:05:43 +00:00
for cmd in t/cmd/*.go; do
%gobuild -o "%{gobuilddir}/bin/$(basename $cmd .go)" "$cmd"
2017-11-03 08:25:40 +00:00
done
2019-07-11 00:05:43 +00:00
%gobuild -o "%{gobuilddir}/bin/git-lfs-test-server-api" t/git-lfs-test-server-api/*.go
2024-03-05 09:08:50 +00:00
popd
2017-11-03 08:25:40 +00:00
2023-02-27 01:37:32 +00:00
# Remove man pages from docs so they don't get installed twice.
rm -r docs/man
2020-09-04 00:02:10 +00:00
2017-09-02 18:54:44 +00:00
%install
2019-07-11 00:05:43 +00:00
install -Dpm0755 %{gobuilddir}/bin/git-lfs %{buildroot}%{_bindir}/%{name}
2023-02-27 01:37:32 +00:00
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
2023-07-30 19:38:47 +00:00
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}
2017-09-02 18:54:44 +00:00
%post
if [ "x$(git config --type=bool --get 'fedora.git-lfs.no-modify-config')" != "xtrue" ]; then
2019-01-15 06:34:58 +00:00
%{_bindir}/%{name} install --system --skip-repo
fi
2017-09-02 18:54:44 +00:00
%preun
if [ $1 -eq 0 ] && \
[ "x$(git config --type=bool --get 'fedora.git-lfs.no-modify-config')" != "xtrue" ]; then
2019-01-15 06:34:58 +00:00
%{_bindir}/%{name} uninstall --system --skip-repo
2017-09-02 18:54:44 +00:00
fi
exit 0
2019-07-11 00:05:43 +00:00
%if %{with check}
2017-09-02 18:54:44 +00:00
%check
2019-07-11 00:05:43 +00:00
%gocheck
PATH=%{buildroot}%{_bindir}:%{gobuilddir}/bin:$PATH \
2018-09-04 06:09:13 +00:00
make -C t PROVE_EXTRA_ARGS="-j$(getconf _NPROCESSORS_ONLN)"
2019-07-11 00:05:43 +00:00
%endif
2017-09-02 18:54:44 +00:00
%files
2024-03-05 09:08:50 +00:00
%doc README.md CHANGELOG.md docs
2017-09-02 18:54:44 +00:00
%license LICENSE.md
%{_bindir}/%{name}
%{_mandir}/man1/%{name}*.1*
%{_mandir}/man5/%{name}*.5*
2023-02-27 01:37:32 +00:00
%{_mandir}/man7/%{name}*.7*
2023-07-30 19:38:47 +00:00
%{bash_completions_dir}/%{name}
%{fish_completions_dir}/%{name}.fish
%{zsh_completions_dir}/_%{name}
2017-09-02 18:54:44 +00:00
%changelog
2021-09-26 02:39:59 +00:00
%autochangelog