Blame SPECS/git-lfs.spec

648d53
# Build man pages
648d53
%global with_manpages 1
648d53
648d53
%bcond_without check
648d53
648d53
# https://github.com/git-lfs/git-lfs
648d53
%global goipath         github.com/git-lfs/git-lfs
34db71
Version:                3.2.0
648d53
648d53
# golang doesn't ship i686 binaries, we don't need the build
648d53
# https://bugzilla.redhat.com/show_bug.cgi?id=1752991#c9
648d53
%global golang_arches %(echo %{golang_arches} | sed "s|%{ix86}||")
648d53
%gometa
648d53
648d53
%global gobuilddir %{_builddir}/%{name}-%{version}/_build
648d53
d0d62b
# define gobuild macro to not lose hardening, because of macro conflict
d0d62b
# https://bugzilla.redhat.com/show_bug.cgi?id=1919348
d0d62b
%global gobuild CGO_CPPFLAGS="-D_FORTIFY_SOURCE=2 -fstack-protector-all" go build -compiler gc -buildmode pie '-tags=rpm_crashtraceback libtrust_openssl ' -ldflags "-linkmode=external -compressdwarf=false ${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'" -a -v -x %{?**}
d0d62b
648d53
Name:           git-lfs
85036e
Release:        2%{?dist}
648d53
Summary:        Git extension for versioning large files
648d53
648d53
License:        MIT
648d53
URL:            https://git-lfs.github.io/
648d53
Source0:        https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-v%{version}.tar.gz
648d53
Source1:        manpages.tgz
648d53
# See this script. Generating of manpages is performed on other distros due to some missing numerous dependencies on RHEL
648d53
Source2:        gen-manpages.sh
648d53
34db71
Patch:          https://github.com/git-lfs/git-lfs/commit/11fe8dc62ed2eb158eaec28af90d2f509e7fd91f.patch
34db71
34db71
# Generated provides by vendor2provides.py
34db71
# https://src.fedoraproject.org/rpms/syncthing/blob/603e4e03a92a7d704d199629dd85304018e8279d/f/vendor2provides.py
34db71
Provides:       bundled(golang(github.com/alexbrainman/sspi)) = 909beea
34db71
Provides:       bundled(golang(github.com/avast/retry-go)) = 2.4.2+incompatible
34db71
Provides:       bundled(golang(github.com/davecgh/go-spew)) = 1.1.1
34db71
Provides:       bundled(golang(github.com/dpotapov/go-spnego)) = 298b63a
34db71
Provides:       bundled(golang(github.com/git-lfs/gitobj/v2)) = 2.1.0
34db71
Provides:       bundled(golang(github.com/git-lfs/go-netrc)) = f0c862d
34db71
Provides:       bundled(golang(github.com/git-lfs/pktline)) = 06e9096
34db71
Provides:       bundled(golang(github.com/git-lfs/wildmatch/v2)) = 2.0.1
34db71
Provides:       bundled(golang(github.com/hashicorp/go-uuid)) = 1.0.2
34db71
Provides:       bundled(golang(github.com/inconshreveable/mousetrap)) = 1.0.0
34db71
Provides:       bundled(golang(github.com/jcmturner/aescts/v2)) = 2.0.0
34db71
Provides:       bundled(golang(github.com/jcmturner/dnsutils/v2)) = 2.0.0
34db71
Provides:       bundled(golang(github.com/jcmturner/gofork)) = 1.0.0
34db71
Provides:       bundled(golang(github.com/jcmturner/goidentity/v6)) = 6.0.1
34db71
Provides:       bundled(golang(github.com/jcmturner/gokrb5/v8)) = 8.4.2
34db71
Provides:       bundled(golang(github.com/jcmturner/rpc/v2)) = 2.0.3
34db71
Provides:       bundled(golang(github.com/leonelquinteros/gotext)) = 1.5.0
34db71
Provides:       bundled(golang(github.com/mattn/go-isatty)) = 0.0.4
34db71
Provides:       bundled(golang(github.com/olekukonko/ts)) = 78ecb04
34db71
Provides:       bundled(golang(github.com/pkg/errors)) = c605e28
34db71
Provides:       bundled(golang(github.com/pmezard/go-difflib)) = 1.0.0
34db71
Provides:       bundled(golang(github.com/rubyist/tracerx)) = 7879593
34db71
Provides:       bundled(golang(github.com/spf13/cobra)) = 0.0.3
34db71
Provides:       bundled(golang(github.com/spf13/pflag)) = 1.0.3
34db71
Provides:       bundled(golang(github.com/ssgelm/cookiejarparser)) = 1.0.1
34db71
Provides:       bundled(golang(github.com/stretchr/testify)) = 1.6.1
34db71
Provides:       bundled(golang(github.com/xeipuuv/gojsonpointer)) = 4e3ac27
34db71
Provides:       bundled(golang(github.com/xeipuuv/gojsonreference)) = bd5ef7b
34db71
Provides:       bundled(golang(github.com/xeipuuv/gojsonschema)) = 6b67b3f
34db71
Provides:       bundled(golang(golang.org/x/crypto)) = 7b82a4e
34db71
Provides:       bundled(golang(golang.org/x/net)) = 69e39ba
34db71
Provides:       bundled(golang(golang.org/x/sync)) = 036812b
34db71
Provides:       bundled(golang(golang.org/x/sys)) = 665e8c7
34db71
Provides:       bundled(golang(golang.org/x/text)) = 0.3.7
34db71
Provides:       bundled(golang(gopkg.in/yaml.v3)) = 9f266ea
648d53
648d53
%if 0%{?with_check}
648d53
# For tests
648d53
BuildRequires:  perl-Digest-SHA
648d53
BuildRequires:  perl-Test-Harness
648d53
# Tests require full git suite, but not generally needed.
34db71
BuildRequires:  git >= 2.32.0
648d53
%endif
648d53
34db71
Requires:       git-core >= 2.32.0
648d53
648d53
%description
648d53
Git Large File Storage (LFS) replaces large files such as audio samples,
648d53
videos, datasets, and graphics with text pointers inside Git, while
648d53
storing the file contents on a remote server.
648d53
648d53
648d53
%prep
648d53
%autosetup -p1 -n %{name}-%{version}
648d53
648d53
install -m 0755 -vd %{gobuilddir}/bin
648d53
install -m 0755 -vd "$(dirname %{gobuilddir}/src/%{goipath})"
648d53
ln -fs "$(pwd)" "%{gobuilddir}/src/%{goipath}"
648d53
648d53
%if %{?with_manpages}
648d53
# Unpack manpages generated by %%{SOURCE2}
648d53
tar -xf %{SOURCE1}
648d53
%endif
648d53
34db71
# Modify tests so that they expect binaries where we build them.
648d53
sed -i -e 's!\.\./bin/!/%{gobuilddir}/bin/!g' t/Makefile
34db71
sed -i -e 's!^BINPATH=.\+!BINPATH="%{gobuilddir}/bin"!g' t/testenv.sh
648d53
648d53
%build
648d53
export GOPATH=%{gobuilddir}:%{gopath}
648d53
export GO111MODULE=off
648d53
648d53
# Build manpages first (some embedding in the executable is done.)
648d53
pushd docs
648d53
%gobuild -o mangen man/mangen.go
648d53
./mangen
85036e
# Removes unwanted source files
85036e
# https://bugzilla.redhat.com/show_bug.cgi?id=1852842
85036e
rm mangen man/mangen.go
85036e
popd
648d53
648d53
%gobuild -o %{gobuilddir}/bin/git-lfs %{goipath}
648d53
648d53
# Build test executables
648d53
pushd %{gobuilddir}/src/%{goipath}
648d53
for cmd in t/cmd/*.go; do
648d53
    %gobuild -o "%{gobuilddir}/bin/$(basename $cmd .go)" "$cmd"
648d53
done
648d53
%gobuild -o "%{gobuilddir}/bin/git-lfs-test-server-api" t/git-lfs-test-server-api/*.go
648d53
popd
648d53
648d53
648d53
%install
648d53
# In Fedora this is done by using %%gopkginstall
648d53
install -Dpm0755 %{gobuilddir}/bin/git-lfs %{buildroot}%{_bindir}/%{name}
648d53
install -d -p %{buildroot}%{_mandir}/man1/
648d53
install -Dpm0644 docs/man/*.1 %{buildroot}%{_mandir}/man1/
648d53
install -d -p %{buildroot}%{_mandir}/man5/
648d53
install -Dpm0644 docs/man/*.5 %{buildroot}%{_mandir}/man5/
85036e
# Remove unwanted files from man folder
85036e
# https://bugzilla.redhat.com/show_bug.cgi?id=1852842
85036e
rm docs/man/*.1 docs/man/*.5
648d53
648d53
648d53
%post
648d53
%{_bindir}/%{name} install --system --skip-repo
648d53
648d53
%preun
648d53
if [ $1 -eq 0 ]; then
648d53
    %{_bindir}/%{name} uninstall --system --skip-repo
648d53
fi
648d53
exit 0
648d53
648d53
648d53
%if %{with check}
648d53
%check
648d53
PATH=%{buildroot}%{_bindir}:%{gobuilddir}/bin:$PATH \
648d53
    make -C t PROVE_EXTRA_ARGS="-j$(getconf _NPROCESSORS_ONLN)"
648d53
%endif
648d53
648d53
648d53
%files
648d53
# In Fedora this is done by using %%gopkgfiles 
648d53
%doc README.md CHANGELOG.md docs
648d53
%license LICENSE.md
648d53
%{_bindir}/%{name}
648d53
%{_mandir}/man1/%{name}*.1*
648d53
%{_mandir}/man5/%{name}*.5*
648d53
648d53
648d53
%changelog
34db71
* Mon Jan 30 2023 Ondrej Pohorelsky <opohorel@redhat.com> - 3.2.0-2
34db71
- Rebuild with Golang-1.19.4
34db71
- Resolves: #2163744
34db71
34db71
* Mon Jan 09 2023 Ondrej Pohorelsky <opohorel@redhat.com> - 3.2.0-1
34db71
- Update to version 3.2.0
34db71
- Resolves: #2139382
34db71
d0d62b
* Mon Jan 17 2022 Ondrej Pohorelsky <opohorel@redhat.com> - 2.13.3-2
d0d62b
- Define %%gobuild macro with proper ldflags
d0d62b
- Related: rhbz#2021549
d0d62b
d0d62b
* Tue Nov 23 2021 Ondrej Pohorelsky <opohorel@redhat.com> - 2.13.3-1
d0d62b
- Update to version 2.13.3
d0d62b
- Fixed round brackets in Provides
d0d62b
- Moved manpages.tgz to look-a-side cache
d0d62b
- Resolves: rhbz#2021549, rhbz#1870080, rhbz#1866441
d0d62b
85036e
* Wed Jul 1 2020 Ondrej Pohorelsky <opohorel@redhat.com> - 2.11.0-2
85036e
- Removed mangen source file
85036e
- Cleaned docs/man folder
85036e
- Resolves: rhbz#1852842
85036e
648d53
* Wed Jun 10 2020 Ondrej Pohorelsky <opohorel@redhat.com> - 2.11.0-1
648d53
- Update to version 2.11.0
648d53
- Resolves: rhbz#1783391
648d53
648d53
* Thu Jul 19 2018 Sebastian Kisela <skisela@redhat.com> - 2.4.1-3
648d53
- Add pregenerated manpages, due to missing dependency 'ronn' in rhel7.
648d53
648d53
* Wed Jul 18 2018 Sebastian Kisela <skisela@redhat.com> - 2.4.1-2
648d53
- Initial build for rh-git218-git-lfs-2.4.1
648d53
648d53
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.1-2
648d53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
648d53
648d53
* Wed May 23 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.4.1-1
648d53
- Update to latest release
648d53
648d53
* Mon May 21 2018 Carl George <carl@george.computer> - 2.4.0-3
648d53
- Fix %%preun to correctly remove the lfs filter on uninstall (rhbz#1580357)
648d53
648d53
* Mon Mar 12 2018 Carl George <carl@george.computer> - 2.4.0-2
648d53
- Add %%go_arches fallback to work around Koji issues
648d53
648d53
* Sun Mar 04 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.4.0-1
648d53
- Update to latest release.
648d53
648d53
* Thu Feb 08 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.3.4-6
648d53
- Add patches to build with Go 1.10.
648d53
648d53
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-5
648d53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
648d53
648d53
* Mon Dec 04 2017 Carl George <carl@george.computer> - 2.3.4-4
648d53
- Use vendored libraries on RHEL
648d53
- Skip test on RHEL
648d53
- Don't build man pages on RHEL due to missing ronn
648d53
- Don't build html versions of man pages
648d53
648d53
* Fri Dec 01 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.3.4-3
648d53
- Require git-core instead of git.
648d53
648d53
* Fri Nov 03 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.3.4-2
648d53
- Patch tests to work on slow systems like arm and aarch builders.
648d53
- Fix "git lfs help" command.
648d53
648d53
* Fri Nov 03 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.3.4-1
648d53
- Update to latest release.
648d53
- Run all tests during build.
648d53
648d53
* Fri Sep 01 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.2.1-3
648d53
- Remove redundant doc tag on manpages.
648d53
- Use path macros in %%post/%%postun.
648d53
648d53
* Thu Aug 31 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.2.1-2
648d53
- Disable unnecessary subpackages.
648d53
648d53
* Sun Jul 30 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.2.1-1
648d53
- Update to latest version.
648d53
648d53
* Wed Apr 19 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.0.2-2
648d53
- Patch up to build with Go 1.7
648d53
648d53
* Wed Apr 19 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.0.2-1
648d53
- Update to latest release
648d53
- Add some requested macros
648d53
648d53
* Tue Mar 14 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.0.1-1
648d53
- Update to latest release
648d53
- Don't disable git-lfs globally during upgrade
648d53
648d53
* Mon Mar 06 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.0.0-1
648d53
- Update to latest release
648d53
648d53
* Sun Feb 12 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1.5.5-1
648d53
- Update to latest release
648d53
- Add -devel and -unit-test-devel subpackages
648d53
- Add post/preun scriptlets for global enablement
648d53
648d53
* Sun May 15 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.2.0-1
648d53
- Initial package