aboutsummaryrefslogtreecommitdiffstats
path: root/main/syncthing/APKBUILD
blob: f12d9b203ff559d8f0bb1d8522ccb33bb31db6e2 (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
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=syncthing
pkgver=0.11.6
pkgrel=0
pkgdesc="Open Source Continuous File Synchronization"
url="http://syncthing.net/"
arch="all"
license="MIT"
pkgusers="$pkgname"
pkggroups="$pkgname"
depends=""
depends_dev=""
makedepends="$depends_dev godep go mercurial bash"
install="$pkgname.pre-install"
subpackages=""
source="$pkgname-$pkgver.tar.gz::https://github.com/syncthing/syncthing/archive/v$pkgver.tar.gz
	syncthing.confd
	syncthing.initd"
giturl="git://github.com/$pkgname/$pkgname.git"
disturl="dev.alpinelinux.org:/archive/$pkgname/"

_builddir="$srcdir/src/github.com/syncthing"

prepare() {
	local i
	mkdir -p $_builddir
	mv $srcdir/$pkgname-$pkgver $_builddir/$pkgname
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	local _arch=""
	cd "$_builddir"/$pkgname
	export GOPATH="$srcdir"
	case "$CTARGET" in
	arm*) _arch="-goarch armv6";;
	esac
	go run build.go -no-upgrade -version=v$pkgver $_arch
}

package() {
	mkdir -p "$pkgdir"/usr/bin || return 1
	install -d -o $pkgname -g $pkgname \
		"$pkgdir"/var/lib/$pkgname || return 1
	mv "$_builddir"/$pkgname/bin/* \
		"$pkgdir"/usr/bin || 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
}

md5sums="13e1a8a3919f9e2c59baf4fef1f758e9  syncthing-0.11.6.tar.gz
c4923d6df4d3e51274869c09ea46a3e1  syncthing.confd
760e26e5ea2f1dce8ce149a45f5e99bb  syncthing.initd"
sha256sums="f9a5702f56d25ca9086cf29fc408924c9f881c18d652a2f931668ecfa962e963  syncthing-0.11.6.tar.gz
da396f944d7b5b2e4f5a7a9a3a7b31529cf359ef7ebecec4c48383d0c8b6821e  syncthing.confd
4d7c1de71cfc415d716471f32fdbb1693597f0209167e4c4ea302478481ab9b3  syncthing.initd"
sha512sums="313bb528d86a6e5e27baab66c5871a01a943b6d00220d189cf58fa1492a9cd86501fddb2383040d4e484865868c2c5b1f369369e50963aaba0baa9aa5c93f944  syncthing-0.11.6.tar.gz
b19cc3d802caa33f4d06852de590d2d984c12cf27d0540162cd7195da4f3f149c83c72e7a10f385b32b27fff6f39d33698e7402442a3f32a9da136c5d19059ae  syncthing.confd
21fa7b0090e579ad0f02bb8cc9a78736eb99811613823bf12d477262da2281543d07b47ae0888e2e3876a687bf4cab3c89405447373a9c5ab2915989c5f9dce8  syncthing.initd"