aboutsummaryrefslogtreecommitdiffstats
path: root/testing/zrepl/APKBUILD
blob: df8208580406f6e6cb991f54756879a242edec85 (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
# Contributor: Shawn Rose <shawnandrewrose@gmail.com>
# Maintainer: Shawn Rose <shawnandrewrose@gmail.com>
pkgname=zrepl
pkgver=0.4.0
pkgrel=2
pkgdesc="one-stop, integrated solution for ZFS replication"
url="https://zrepl.github.io/"
# s390x: failing tests
arch="all !s390x"
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 GOPATH="$srcdir"

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="4af81007ed5720c5f3615ef62f55b7be69164f1456239464ee891b2c27a91722929e67a617ce8cad837aa780aaf6f33e8b94c054e58cff066cdb29d537c534ed  zrepl-0.4.0.tar.gz
ae39a92de1bfd3f0e957b70d02fe05918426fab9203da99d9ee2ee81c173f67e3a55ae525126c4cb0966d0911d7a5bb4c0977915bc0bd11c9a1b607777d39286  zrepl.yml
a6c77686e0189aec4e1ab281d6473c530f9b4371738aca392a6dd6599ed554af9e7d50d68221b4d575bdf3f607640892da34a96d53847d74bbfcf75a25b1836a  zrepl.initd"