aboutsummaryrefslogtreecommitdiffstats
path: root/community/syncthing/APKBUILD
blob: 9a113b096f136bc4d5e7a3af96d64ae3a622af53 (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
# 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.28
pkgrel=0
pkgdesc="Open Source Continuous File Synchronization"
url="http://syncthing.net/"
arch="all !s390x !armhf"
license="MPLv2"
pkgusers="$pkgname"
pkggroups="$pkgname"
makedepends="go"
install="$pkgname.pre-install"
subpackages="$pkgname-utils"
options="!strip"

source="$pkgname-$pkgver.tar.gz::https://github.com/$pkgname/$pkgname/archive/v$pkgver.tar.gz
	sha256-simd-f3ec2e4d36d43c3a899ed4b7d9f62188edcf5afd.tar.gz::https://github.com/minio/sha256-simd/archive/f3ec2e4d36d43c3a899ed4b7d9f62188edcf5afd.tar.gz
	$pkgname.confd
	$pkgname.initd
	only-test-with-race-when-provided.patch"

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

export GOPATH="$srcdir"

prepare() {
	mkdir -p $(dirname "$builddir")
	ln -s "$srcdir"/$pkgname-$pkgver "$builddir"
	# update vendored sha256-simd dependency, remove when upstream
	# dependency manifest is updated
	rm -r "$builddir"/vendor/github.com/minio/sha256-simd
	ln -s "$srcdir"/sha256-simd-* "$builddir"/vendor/github.com/minio/sha256-simd
	default_prepare
}

build() {
	cd "$builddir"
	# recent syncthing tarballs have all deps in vendor dir
	# no need to use a go dep tool like glide/godep
	go run build.go -no-upgrade -version=v$pkgver
}

check() {
	cd "$builddir"
	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
	install -D -m644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.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="0163d894080f7591536e78f7c50a5faf3ee63e62517c4c6989c084b8c7f6406bc221f1e4bdb3831cf1a93292d942942efa240bbe7592ec7c4436e1a6b7f6121b  syncthing-0.14.28.tar.gz
af88185d41e922c8c503fa5f2023f6bcdfa0ea59da9e7d67a746b14eb6c1635544abd430e09c3de2a5d5663ff22b27a0f13d61f3142261fc6e91652590c9d78a  sha256-simd-f3ec2e4d36d43c3a899ed4b7d9f62188edcf5afd.tar.gz
b19cc3d802caa33f4d06852de590d2d984c12cf27d0540162cd7195da4f3f149c83c72e7a10f385b32b27fff6f39d33698e7402442a3f32a9da136c5d19059ae  syncthing.confd
21fa7b0090e579ad0f02bb8cc9a78736eb99811613823bf12d477262da2281543d07b47ae0888e2e3876a687bf4cab3c89405447373a9c5ab2915989c5f9dce8  syncthing.initd
3fd2b699e07891ae16c67af56d516ba0fde13d5e5d067dd680fc59f9fc5b2f7c5f685b040841588cca6de1f7fb4b094572e5eb73dda8ab30d4b2994d3f526047  only-test-with-race-when-provided.patch"