# Contributor: Jakub Jirutka # Maintainer: Jakub Jirutka pkgname=git-lfs pkgver=3.3.0 pkgrel=4 pkgdesc="Git extension for versioning large files" url="https://git-lfs.github.io/" arch="all" license="MIT" depends="git" makedepends="asciidoctor go ronn" checkdepends="bash coreutils git-daemon perl-utils" install="$pkgname.post-install $pkgname.pre-deinstall" subpackages="$pkgname-doc" source="git-lfs-$pkgver.tar.gz::https://github.com/git-lfs/git-lfs/archive/v$pkgver.tar.gz makefile-extra_go_flags.patch fix-test-branch-name.patch quote-ldflags.patch " [ "$CARCH" = "x86" ] && options="!check" # tests broken on x86 # secfixes: # 3.1.2-r4: # - CVE-2022-27191 # 3.1.2-r3: # - CVE-2021-38561 # 0: # - CVE-2020-27955 # (only affect windows) # -tags netcgo - use system's DNS resolver by default. Go's built-in DNS # resolver is buggy; it resolved localhost to totally wrong IP # address on ARM builders and so caused test failures. _goflags="$GOFLAGS -v -tags netcgo" export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}" export GOTMPDIR="${GOTMPDIR:-"$srcdir"}" export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}" prepare() { default_prepare # upgrade golang.org/x/text - CVE-2021-38561 go get golang.org/x/text # CVE-2022-27191 go get golang.org/x/crypto/ssh } build() { make \ EXTRA_GO_FLAGS="$_goflags" \ GIT_LFS_SHA="v$pkgver" \ VERSION="v$pkgver" make man } check() { make integration EXTRA_GO_FLAGS="$_goflags" TEST_SKIP_LFS_TRANSFER=true } package() { local docdir="$pkgdir/usr/share/doc/$pkgname" local mandir="$pkgdir/usr/share/man" install -Dm755 bin/$pkgname "$pkgdir"/usr/bin/$pkgname install -Dm644 man/man1/*.1 -t "$mandir"/man1/ install -Dm644 man/man5/*.5 -t "$mandir"/man5/ mkdir -p "$docdir" cp -r docs/*.md docs/api "$docdir"/ rm -r "$docdir"/api/schemas } cleanup_srcdir() { go clean -modcache default_cleanup_srcdir } sha512sums=" c339a61c23950d249ac135d75c9b9c4b871f491535d6d6a0accbf06efe36798566502ab310396f44acdc1d93aa7358a719a81428042fb2eda1ab237b08e4ba41 git-lfs-3.3.0.tar.gz 2d793da75b37324936407948fdb634ff4c510c4dd4d3575c2459b81a0a6eb8f2464f5066ae99e88d5bf69e357fd60354b9d9d53e062cb6ba709f5f3a39858466 makefile-extra_go_flags.patch 7bf0db3be06ba75429a3bbe7d45c4738443912e8e0c80fa2cbdfe76a5ffca720c0f6f638178e0dcc3e2781613b4be575e6583ca3e55f430ab76420118d87cb45 fix-test-branch-name.patch 6ca2c1d8964f616dc81e1744ebe74736ff5b70f7888eccc315e906e669f78a0d5b5cf8c5018ac14e390f778afc147ee6cbb7175504aa2f6fa4bed3c7ec663317 quote-ldflags.patch "