Blame SPECS/git-lfs.spec

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