aboutsummaryrefslogtreecommitdiffstats
path: root/community/syncthing/APKBUILD
blob: abfc535f79b6781f426b3779d34e1d2cf26ee381 (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
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=syncthing
pkgver=0.14.35
pkgrel=0
pkgdesc="Open Source Continuous File Synchronization"
url="http://syncthing.net/"
arch="all !s390x !armhf !ppc64le"
license="MPLv2"
pkgusers="$pkgname"
pkggroups="$pkgname"
makedepends="go"
install="$pkgname.pre-install"
subpackages="$pkgname-utils"

source="$pkgname-$pkgver.tar.gz::https://github.com/$pkgname/$pkgname/archive/v$pkgver.tar.gz
	$pkgname.initd
	only-test-with-race-when-provided.patch
	enable-generic-build-on-s390x.patch
	"

builddir="$srcdir/src/github.com/$pkgname/$pkgname"

prepare() {
        mkdir -p ${builddir%/*}
        mv "$srcdir"/$pkgname-$pkgver "$builddir"/
        cd "$builddir"
        default_prepare
}

build() {
	cd "$builddir"
	export GOPATH="$srcdir"
	go run build.go -no-upgrade -version=v$pkgver
}

check() {
	cd "$builddir"
	export GOPATH="$srcdir"
	go run build.go -no-upgrade test
}

package() {
	install -d -o $pkgname -g $pkgname "$pkgdir"/var/lib/$pkgname
	install -D -m755 $builddir/bin/$pkgname "$pkgdir"/usr/bin/$pkgname
	install -D -m755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
}

utils() {
	pkgdesc="Syncthing utilities"
	for i in $(ls $builddir/bin); do
		if ! [ "$i" = "$pkgname" ]; then
			install -Dm 755 $builddir/bin/$i $subpkgdir/usr/bin/$i
		fi
	done
}

sha512sums="2a3de76e7118be6e91b8bc6bc69b10e250755836b378fa762e0feaed280bb2206d2e4552f09fd230d51e246633108fd8cff343ac355742ebb1bd06c2145fe086  syncthing-0.14.35.tar.gz
7fe49210180827c28f3ee9a1a95da3884dbef34de9bdc643f4455c9a056adba81f16c1c6ac059e83bee360aea091ace98b8a6f4c4b26a32c450f61f15206d3f5  syncthing.initd
3fd2b699e07891ae16c67af56d516ba0fde13d5e5d067dd680fc59f9fc5b2f7c5f685b040841588cca6de1f7fb4b094572e5eb73dda8ab30d4b2994d3f526047  only-test-with-race-when-provided.patch
5dec62fc0555e298a1be4aede02dde3b407e8d4adbddc5d82d6dcd2f761f3b3eed7b71de51ab08efd185b84c9706fdb9e26a1086474623eb52b344cc793cf876  enable-generic-build-on-s390x.patch"