已开启
Compile and generate man pages #29
huijing_zhang创建于 7月20日
Compile and generate man pages #29
已开启
共 1 个文件变更+32-10
| @@ -1,10 +1,13 @@ | |||
| 1 | %define debug_package %{nil} | 1 | %define debug_package %{nil} |
| 2 | %bcond_without check | 2 | %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-lfs | 7 | # https://github.com/git-lfs/git-lfs |
| 5 | Name: git-lfs | 8 | Name: git-lfs |
| 6 | Version: 3.6.1 | 9 | Version: 3.6.1 |
| 7 | -Release: 1 | 10 | +Release: 2 |
| 8 | Summary: Git extension for versioning large files | 11 | Summary: Git extension for versioning large files |
| 9 | 12 | ||
| 10 | License: MIT and BSD and Apache-2.0 and MPL-2.0 | 13 | License: 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} | |||
| 13 | Source1: vendor.tar.gz | 16 | Source1: vendor.tar.gz |
| 14 | Patch6000: 0001-use-vendor-dir-for-build.patch | 17 | Patch6000: 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 | # Tests | 23 | # Tests |
| 18 | BuildRequires: perl-Digest-SHA | 24 | BuildRequires: perl-Digest-SHA |
| @@ -32,29 +38,45 @@ storing the file contents on a remote server. | |||
| 32 | 38 | ||
| 33 | %prep | 39 | %prep |
| 34 | %autosetup -p0 -n %{name}-%{version} -a 1 | 40 | %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 | %build | 46 | %build |
| 43 | -pushd src/github.com/git-lfs/%{name} | 47 | +export GOPATH=%{gobuilddir}:%{gopath} |
| 44 | -make | 48 | +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 | ||
| 45 | popd | 55 | popd |
| 46 | -# BaseOS is not support rubygem-ronn/ronn, ignore generate man pages | 56 | + |
| 57 | +make | ||
| 47 | 58 | ||
| 48 | 59 | ||
| 49 | %install | 60 | %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 | %files | 68 | %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 | %changelog | 76 | %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-1 | 80 | * Sun Jan 19 2025 Funda Wang <fundawang@yeah.net> - 3.6.1-1 |
| 59 | - Upgrade to 3.6.1 | 81 | - Upgrade to 3.6.1 |
| 60 | - fix CVE-2024-53263: Git LFS permits retrieval of credentials via crafted HTTP URLs | 82 | - fix CVE-2024-53263: Git LFS permits retrieval of credentials via crafted HTTP URLs |