aboutsummaryrefslogtreecommitdiffstats
path: root/community/syncthing/APKBUILD
blob: da045795f86ad23390e212870d3e83d224ac9f8a (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
# 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.3
pkgrel=0
pkgdesc="Open Source Continuous File Synchronization"
url="http://syncthing.net/"
arch="all"
license="MPLv2"
pkgusers="$pkgname"
pkggroups="$pkgname"
depends=""
depends_dev=""
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
	$pkgname.confd
	$pkgname.initd"

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

prepare() {
	default_prepare
	mkdir -p "$builddir"
	ln -s "$srcdir"/$pkgname-$pkgver "$builddir"/$pkgname || return 1
}

build() {
	cd "$builddir"/$pkgname
	export GOPATH="$srcdir"
	# 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
}

package() {
	install -d -o $pkgname -g $pkgname \
		"$pkgdir"/var/lib/$pkgname || return 1
	install -D -m755 $builddir/$pkgname/bin/$pkgname \
		"$pkgdir"/usr/bin/$pkgname || return 1
	install -D -m755 "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname || return 1
	install -D -m644 "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/$pkgname || return 1
}

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

md5sums="ad97924ff901abf39c61c758f6738da6  syncthing-0.14.3.tar.gz
c4923d6df4d3e51274869c09ea46a3e1  syncthing.confd
760e26e5ea2f1dce8ce149a45f5e99bb  syncthing.initd"
sha256sums="1c7ce74db4bf780463c04ed3d5677296ad2bb347f3e35fe4229eb26893a6604a  syncthing-0.14.3.tar.gz
da396f944d7b5b2e4f5a7a9a3a7b31529cf359ef7ebecec4c48383d0c8b6821e  syncthing.confd
4d7c1de71cfc415d716471f32fdbb1693597f0209167e4c4ea302478481ab9b3  syncthing.initd"
sha512sums="f9586013253ad031e1940e73f01f8ca398820e9ffeef0978fcd51079c535c04957c0be1314ecc635251ae06300c6b4141077ac5c3c8e7e9741d58e4545a7f3ba  syncthing-0.14.3.tar.gz
b19cc3d802caa33f4d06852de590d2d984c12cf27d0540162cd7195da4f3f149c83c72e7a10f385b32b27fff6f39d33698e7402442a3f32a9da136c5d19059ae  syncthing.confd
21fa7b0090e579ad0f02bb8cc9a78736eb99811613823bf12d477262da2281543d07b47ae0888e2e3876a687bf4cab3c89405447373a9c5ab2915989c5f9dce8  syncthing.initd"