已开启
Compile and generate man pages #29
Compile and generate man pages #29
已开启
huijing_zhang创建于 7月20日
1 个文件变更+32-10
@@ -1,10 +1,13 @@
1%define debug_package %{nil}1%define debug_package %{nil}
2%bcond_without check2%bcond_without check
3 3 
4+%global gobuilddir %{_builddir}/%{name}-%{version}/_build
5+%global goipath github.com/git-lfs/git-lfs/v3
6+ 
4# https://github.com/git-lfs/git-lfs7# https://github.com/git-lfs/git-lfs
5Name: git-lfs8Name: git-lfs
6Version: 3.6.19Version: 3.6.1
7-Release: 110+Release: 2
8Summary: Git extension for versioning large files11Summary: Git extension for versioning large files
9 12 
10License: MIT and BSD and Apache-2.0 and MPL-2.013License: MIT and BSD and Apache-2.0 and MPL-2.0
@@ -13,6 +16,9 @@ Source0: https://github.com/%{name}/%{name}/releases/download/v%{version}
13Source1: vendor.tar.gz16Source1: vendor.tar.gz
14Patch6000: 0001-use-vendor-dir-for-build.patch17Patch6000: 0001-use-vendor-dir-for-build.patch
15 18 
19+# Generate man pages
20+BuildRequires: /usr/bin/asciidoctor
21+ 
16%if %{with check}22%if %{with check}
17# Tests23# Tests
18BuildRequires: perl-Digest-SHA24BuildRequires: perl-Digest-SHA
@@ -32,29 +38,45 @@ storing the file contents on a remote server.
32 38 
33%prep39%prep
34%autosetup -p0 -n %{name}-%{version} -a 140%autosetup -p0 -n %{name}-%{version} -a 1
35- 41+install -m 0755 -vd %{gobuilddir}/bin
36-cd ..42+install -m 0755 -vd "$(dirname %{gobuilddir}/src/%{goipath})"
37-mv %{name}-%{version} %{name}43+ln -fs "$(pwd)" "%{gobuilddir}/src/%{goipath}"
38-mkdir -p %{name}-%{version}/src/github.com/git-lfs
39-mv %{name} %{name}-%{version}/src/github.com/git-lfs/
40 44 
41 45 
42%build46%build
43-pushd src/github.com/git-lfs/%{name}47+export GOPATH=%{gobuilddir}:%{gopath}
44-make48+export GOROOT=/usr/lib/golang
49+ 
50+# Build manpages first (some embedding in the executable is done.)
51+make man GIT_LFS_SHA=unused VERSION=unused PREFIX=unused
52+pushd docs
53+go build -o %{gobuilddir}/bin/mangen man/mangen.go
54+%{gobuilddir}/bin/mangen
45popd55popd
46-# BaseOS is not support rubygem-ronn/ronn, ignore generate man pages56+ 
57+make
47 58 
48 59 
49%install60%install
50-install -Dpm0755 src/github.com/git-lfs/git-lfs/bin/git-lfs %{buildroot}%{_bindir}/%{name}61+install -Dpm0755 bin/git-lfs %{buildroot}%{_bindir}/%{name}
62+for section in 1 5 7; do
63+ install -d -p %{buildroot}%{_mandir}/man${section}/
64+ install -Dpm0644 man/man${section}/*.${section} %{buildroot}%{_mandir}/man${section}/
65+done
51 66 
52 67 
53%files68%files
54%{_bindir}/%{name}69%{_bindir}/%{name}
70+%license LICENSE.md
71+%{_mandir}/man1/%{name}*.1*
72+%{_mandir}/man5/%{name}*.5*
73+%{_mandir}/man7/%{name}*.7*
55 74 
56 75 
57%changelog76%changelog
77+* Mon Jul 20 2026 zhanghuijing <zhanghuijing@kylinos.com> - 3.6.1-2
78+- Compile and generate man pages
79+ 
58* Sun Jan 19 2025 Funda Wang <fundawang@yeah.net> - 3.6.1-180* Sun Jan 19 2025 Funda Wang <fundawang@yeah.net> - 3.6.1-1
59- Upgrade to 3.6.181- Upgrade to 3.6.1
60 - fix CVE-2024-53263: Git LFS permits retrieval of credentials via crafted HTTP URLs82 - fix CVE-2024-53263: Git LFS permits retrieval of credentials via crafted HTTP URLs