aboutsummaryrefslogtreecommitdiffstats
path: root/testing/zrepl/APKBUILD
blob: 17376cf571bbf10512be0b3bedec790735383a91 (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
# Contributor: Shawn Rose <shawnandrewrose@gmail.com>
# Maintainer: Shawn Rose <shawnandrewrose@gmail.com>
pkgname=zrepl
pkgver=0.6.1
pkgrel=3
pkgdesc="one-stop, integrated solution for ZFS replication"
url="https://zrepl.github.io/"
# s390x: failing tests
arch="all !s390x !armhf"
license="MIT"
makedepends="go bash"
subpackages="
	$pkgname-openrc
	$pkgname-bash-completion
	$pkgname-zsh-completion
	"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/zrepl/zrepl/archive/v$pkgver.tar.gz
	zrepl.yml
	zrepl.initd
	"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	export GO111MODULE=on
	go build \
		-mod=readonly \
		-ldflags "-X github.com/zrepl/zrepl/version.zreplVersion=v$pkgver" \
		-o "artifacts/zrepl"
	./artifacts/zrepl gencompletion bash ./artifacts/bash-completion
	./artifacts/zrepl gencompletion zsh ./artifacts/zsh-completion
}

check() {
	go test -mod=readonly ./...
}

package() {
	install -Dm0755 artifacts/zrepl "$pkgdir"/usr/bin/zrepl
	install -Dm755 "$srcdir"/zrepl.initd \
		"$pkgdir"/etc/init.d/zrepl
	install -Dm644 "$srcdir"/zrepl.yml \
		"$pkgdir"/etc/zrepl/zrepl.yml
	install -Dm0644 artifacts/bash-completion \
		"$pkgdir"/usr/share/bash-completion/completions/$pkgname
	install -Dm0644 artifacts/zsh-completion \
		"$pkgdir"/usr/share/zsh/site-functions/_$pkgname
	cd "$builddir/config/samples"
	find ./* -type f -exec install -m 644 -D "{}" "$pkgdir/usr/share/$pkgname/examples/{}" \;
}

cleanup_srcdir() {
	export GOPATH="$srcdir"
	go clean -modcache
	default_cleanup_srcdir
}

sha512sums="
0fb28014f4c50d2512eec2b767883b342f8fc6cd5661dd04bebfb75d9774f4face9402202e2e830c0ca9b831502fdeac1c00e874ea3b0e9188c8df54e353dc70  zrepl-0.6.1.tar.gz
ae39a92de1bfd3f0e957b70d02fe05918426fab9203da99d9ee2ee81c173f67e3a55ae525126c4cb0966d0911d7a5bb4c0977915bc0bd11c9a1b607777d39286  zrepl.yml
a6c77686e0189aec4e1ab281d6473c530f9b4371738aca392a6dd6599ed554af9e7d50d68221b4d575bdf3f607640892da34a96d53847d74bbfcf75a25b1836a  zrepl.initd
"