Blame SPECS/git-lfs.spec

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