aboutsummaryrefslogtreecommitdiffstats
path: root/community/git-lfs/APKBUILD
blob: b54f4fdaac94326822505b83b2093aeae58dc038 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=git-lfs
pkgver=2.5.1
pkgrel=1
pkgdesc="Git extension for versioning large files"
url="https://git-lfs.github.io/"
arch="all"
license="MIT"
depends="git"
checkdepends="bash coreutils git-daemon perl-utils"
makedepends="go ronn"
# Go doesn't play well with strip tool. http://bit.ly/2jlJsSU
options="!strip"
subpackages="$pkgname-doc"
install="$pkgname.post-install $pkgname.pre-deinstall"
source="$pkgname-$pkgver.tar.gz::https://github.com/git-lfs/$pkgname/archive/v$pkgver.tar.gz
	fix-test-locks.patch
	makefile-extra_go_flags.patch
	"
builddir="$srcdir/src/github.com/git-lfs/$pkgname"

export GOPATH="$srcdir:$builddir"
# -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"

prepare() {
	mkdir -p "${builddir%/*}"
	ln -s "$srcdir"/$pkgname-$pkgver "$builddir"

	default_prepare
}

build() {
	cd "$builddir"

	make \
		EXTRA_GO_FLAGS="$_goflags" \
		GIT_LFS_SHA="v$pkgver" \
		VERSION="v$pkgver"
	make man

	# Build test executables.
	local file; for file in t/cmd/*.go; do
		go build $_goflags -o bin/$(basename $file .go) $file
	done
}

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

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

	cd "$builddir"

	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
}

sha512sums="86b277795ffaba47244f3467e58c1103804f526511c4b0c21566dc05a97eb5d48d0de36f944d906255a8652b9fd698dca4dd50f89d344703b3c6d87117f7fbc1  git-lfs-2.5.1.tar.gz
8ef31d51ef730d6fbd61e1a839b808a00cacc004b84f3d274c19c47bd2f305bc8173c770573aeb9a454b5ac3ab60947cfaac9b414c51d3bcb857f99ac8de1c41  fix-test-locks.patch
a66cbf518f15ca59f453ba28407f848aec1f752e3052007abd2196e288a0eef5618fdb1b8ffbad3aaff01bf84efef63d268f7208345e8e6d29c90a1748dd9ffd  makefile-extra_go_flags.patch"