aboutsummaryrefslogtreecommitdiffstats
path: root/community/git-lfs/APKBUILD
blob: 3e7e3708f062d056d5cc0aa2211614fbb74855a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=git-lfs
pkgver=2.10.0
pkgrel=1
pkgdesc="Git extension for versioning large files"
url="https://git-lfs.github.io/"
arch="all"
license="MIT"
depends="git"
makedepends="go ronn"
checkdepends="bash coreutils git-daemon perl-utils"
install="$pkgname.post-install $pkgname.pre-deinstall"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/git-lfs/$pkgname/archive/v$pkgver.tar.gz
	makefile-extra_go_flags.patch
	"
[ "$CARCH" = "x86" ] && options="!check" # tests broken on x86

# -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="-v -tags netcgo"

build() {
	make \
		EXTRA_GO_FLAGS="$_goflags" \
		GIT_LFS_SHA="v$pkgver" \
		VERSION="v$pkgver"
	make man
}

check() {
	make integration EXTRA_GO_FLAGS="$_goflags"
}

package() {
	local docdir="$pkgdir/usr/share/doc/$pkgname"
	local mandir="$pkgdir/usr/share/man"

	install -Dm755 bin/$pkgname "$pkgdir"/usr/bin/$pkgname

	mkdir -p "$mandir"/man1 "$mandir"/man5
	install -m 644 man/*.1 "$mandir"/man1/
	install -m 644 man/*.5 "$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="a4bfb3f674ef93e903e815ab0721f25ac78f772df416c865a7c57f7d19790b9efa8d4662723f2e3d87f294346d7924942d05cbfcdd8a010316e8b0420bd71e8a  git-lfs-2.10.0.tar.gz
2d793da75b37324936407948fdb634ff4c510c4dd4d3575c2459b81a0a6eb8f2464f5066ae99e88d5bf69e357fd60354b9d9d53e062cb6ba709f5f3a39858466  makefile-extra_go_flags.patch"